Category Archives: Home Automation

Micro/Pocket PC

This is a 5″ display and the keyboard I just ordered. I think the size is about correct. The trouble is more finding a TFT display that hide the HDMI on the back (inside) rather than demanding cables extending to the sides. I actually need a workable console for Raspberry PI that include both keyboard and display and don’t occupy to much space – interesting…

Servo Module

The next module I want to make is the Servo Module. This is handy since the 16 channels also can be used as digital/analogue IO signals.

I will use 16 x 3xRight Angle Headers and some jumpers to select between voltage. I will only support 5V & 12V and max 10A in total. Higher voltage or effects will need to get their power directly.

Supporting 16 channels this way is a bit much as the total current usage can be quite high so I will add current sensors to monitor usage. I also need an inductor to prevent pulses from going back to the backplane. I need to review the 5V here because we currently only have a single 5V supply that also is used for the MCU. I probably need to add a 2nd 5V on the backbone to allow for separate PSU’s for modules connected to actuator/servos.

In this case we also need to feed the 3.3V MCU from the 5V/12V used for the servo’s as we otherwise might not have a ground to our signal. Communication with backbone is RS-485 based on differential siganaling not depending on anything but those two wires, so this will work fine. It also means that we will no connect to the 5V MCU/Ground at all on this module. This actually raises a question if I should switch to isolated RS-485 towards the backplane here.

All In One Home Central

Looking at my Ethernet/GSM module I realise that I with a minor change on the backbone pin-out can just add 2.54 pitch screw terminals and we have a stand-alone home sentral with 5V on the upper screw block and RSX on the lower. 5V here is in reality 4.5 to 12V, so we can just add a 2 cell LIPO directly this way. Need to think about this option, but I see no reason not to do the backbone change as this would enable all modules too be used both in rack and stand-alone “as is”.

Ethernet/GSM Module Update

Finally got the last packages in and added some extras. Still some work to do before this is done thought, but in the process of completing 1st final draft. Due to the complexity of this module I expect 1-3 revisions before we are done. Basically I just want to complete this draft & doc and let it mature a bit before I review the design.

Of notable changes is that I decided on a supercap for the RTC battery. Using a battery would cause people to run-around changing batteries. A supercap does not last that long, but I expect an hour++. I actually need to test. I also added an Analogue Audio Connector+ SIM808 USB is available on pins. I changed to Nano SIM Card and added a HMI (UART) connector. The pictures below show the 3D from side/back to illustrate.

I have not added Raspberry PI to the illustration, but it fit on back With the Connectors right. Since my Hat’s also have Zero Mount holes you can actually add several Hat’s by setting their address to 2-8. The Ethernet/GSM module have hard-wired address 1. Full size Hat’s will stick out ca 3cm.

Ethernet/GPRS Module 3D draft

Meet my new Ethernet/GPRS module. I am not finished routing the PCB and lack some 3D packages, but you get the idea. This 3D modeling tool is a bit ruff in the edges anyway, but it serves it purpose. Also, I still have a few loose ends here – so work in progress…

This 3D show a small button battery holder for RTC, but the SIM808 has a build in battery charger for a single 3.7V LIPO so considering if I can use that or add my own – I consider attaching a larger 3.7V LIPO battery on the back side to drive both MCU and SIM808, but I also need on/off for RPI if I do that. Basically the 5V from the back plane would charge the battery. For RTC I could use my old trick an insert a small supercap.

This shows the backside with the connector and mounting holes for a Raspberry PI Zero Wireless add-on. This add’s secure wifo + bluetooth as well as a very capable Linux server. HDMI & USB will be at front. Needless to say this can also connect a full Raspberry PI 3 using a 40 pin cable.

I am considering using the Space left of the Raspberry PI module for a LIPO battery as mentioned earlier.

As for the All-In-One Home Central I could just make a 1-2 card dedicated backbone with a 5-6V adapter and this would serve the purpose…

At precent I see no purpose in makeing a separate GSM, Ethernet or RPI module as indicated earlier – this combi does the job very well. Don’t be surpriced if you see the Zero W popping up as an option on more modules.

Loose ends/notes:

  • Battery charger/LIPO- I have little Insight into the build-in charger, so consider finding a different solution that also can be used on other Boards. Need digital on/off for RPI.
  • Antenna – not sure about the quality of my PCB shielding so considering using these micro taps and allow people to supply a shielded cable directly rather than adding 3-4cm of PCB lanes.
  • USB. I have space to output pins, but not for a connector.
  • Mic/Speaker – I have space to output pins to a header.
  • Bluetooth antenna on SIM808. Should try to add a micro antenna connector – yet another component I need package for. Not sure I ever need this, but I do have space for it, so why not.
  • GPS antenna crossing RPI header. Should ground pin 15 (GPIO22) & 16 (GPIO23) on the RPI header to create a continious ground plane under the antenna signal.
  • GSM Antenna is close to the SIM card. Possible to just move the card holder to the otherside with strong ground plane support to minimize effect. Either that or moving the SIM card holder to the middle of the card in which case it will be a pane to insert card. Not sure if this is a big issue.
  • RTC oscillator must be added, but little space here. We can use the HSE/8, but not sure how accurate that option is. Possible we can ignore the RTC clock on STM32 as we also have one on SIM808.
  • Consider if we need to add TVS on 4V. The Reference recommend this due to 2A on/off surge. This should not be any issue with a LIPO connected here. But, we should have space for this TVS so could just add it on PCB.
  • Some other LEDS from SIM808 – not sure if they add any value.
  • Top/Bottom edges need a clean up. Considering using a sliding holder and avoid screws in which case we need 1-2 mm clearing on top/bottom for a track.
  • Need to increase aura around drill holes and avoid these being ground. This is a mistake I have done repeatedly as I by old habit ground through mounting holes.
  • Need to adjust mounting holes for Raspberry PI Zero accurate.

PCM Interface – I2S

PCM Interface is a kind of standard build on the same principles as SPI. The SPI interface can handle the clocked bit-streams, but I2S can also handle the PCM encoding. In simple words I should be able to send/receive voice effortless – just need to get my head around register settings in STM32F405 which is made easier with STM32CubeMX (see Picture) – just a few clicks and you have sample code to play with. Just watch out because not all options are available in CubeMX.

Not sure if this is the correct setting – the PCM_CLK from SIM808 is fixed to 256Khz which is twice the frequency I need for 8000 Hz which is telecom standard (8000 * 16 = 128000) – assuming 1Hz on the clk is 1 bit I am missing something…

This is the issue dealing with various Chinese components – documentation in English is often limited – but we will sort it out.

The M4 is basically so fast that I was prepared to do this protocol the hard way – first time I look into the I2S and how it’s used. We have 2 of these available.

Ethernet/GSM/GPS/RPI Module

I decided to replace ESP-12 with a Raspberry PI Zero W fitted on the back facing front. The PLC card is of the same height as the PI Zero Length, so this is perfect. Mountimng it on top was difficult due to the Ethernet connector sticking out +  I had no space fr routing. I had to use a SMD version of a 2.54 pin header, but that’s fine. One of the things that made my decition is lack of encryption on ESP-12, something a Zero W does easily and you get a full Linux server as a add-on for 10.- USD.

The SPI Flash is still shown as an option, but I have no 4th SPI port so this is in reality ditched. I do however have an annoying right top corner with nothing – perfect for a RTC battery. I am in the process of routing this PCB and we are still at 80 x 65 mm. It will still take me a few days before this module is done.

SIM808 GSM, GPRS + GPS

Choosing GSM modules is a pain, but I landed on SIM800/SIM808. The difference is that the later contains GPS for an additional 4.- USD. I was first tempted to save those, but decided that a GPS add a very nice function for anything that is mobile. At a price of ca 10.- USD this is still affordable – so here we go – updated draft of the Ethernet module above and the RPI module below.  The only reason to chose SIM800 would be price, but I actually expect these prices to drop.

As mentioned earlier the RPI version will be a Hat that also plugs into the PLC backbone. I will work on the layout details – RPI is a bit tricky as it has connectors on 3 edges.

The reason I want both these are because I want an alternative that don’t include a Raspberry PI due to size, cost, slow start-up and SD-card (in)reliability. I am not blind for the option to combine these two into one – making Raspberry PI an optional add-on module.