My Automated Home: Raspberry Pi + Node-Red + MQTT & Amazon Echo

In our latest My Automated home feature, Dave McLaughlin takes us through his journey developing his own smart home system. With some DIY upgrades to existing home automation hardware and some clever software integration he’s built a fascinating system…

In the Beginning

Having used Homeseer and a number of wired and wireless devices whilst in the UK, I switched to wireless when I moved overseas to Indonesia in 2005. As I was living in a rented apartment I need a solution that would not require any cables other than maybe Ethernet in the same room.

I decide on a Z-Wave system, later adding Wemo Lamp modules too. For Z-Wave side of things I chose the HomePro Appliance modules for sockets and Everspring Lamp modules for the lighting. Neither of these 2 modules were cheap.

I ran with this setup until the middle of 2016, but the following issues prompted a change. Firstly Z-Wave was temperamental with 2 units at the far end of ou apartment, even though I had an Appliance Module half way between it just never worked reliably. I would have continually press OFF on the Homeseer Touch based tablet to get my bed light to go off. later I would have 2 units that controlled lamps blow up and fail. one of the IC’s that was part of the power supply had split wide open.

The next headache was the Wemo lamp modules. The only way to get these to work was with IFTTT through their Homeseer and Wemo channels. As long as my internet connection was good this worked ok, albeit a bit slow at times. Not exactly a 10 on the WAF scale.

In early 2016 I came across a website run by Peter Scargill who used to run an electronics design company many years ago from Tyneside. at that time I used his AppCON wired controllers for home automation based on the little 8 bit pic microcontrollers. I had hundreds of meters of 4 core alarm cable run all over my apartment. The system was reliable but trying to hide all that cable didn’t go down well with my partner at the time.

Fast forward to 2016 and Peter was back doing home automation with the little ESP8266 based controllers.

These are based on a Cortex M4 core with built in 802.11 WiFi and come with an SDK that allows development with Eclipse as well as an Arduino IDE option.

As my HomePro units were troublesome I decided to re-engineer the internals and keep the mechanical parts. So I took out the old PCB and did all the measurements so I could make my own 2 stack PCB assembly in much the same as the old one. The lower PCB is the POWER supply and solid state RELAY.

I chose the solid state relays as they switch on the zero crossing and avoid any issues with pulling down the AC and causing the power supply to dip. This works faultlessly and I can switch up to 8 AMPS with this arrangement. more than enough for the intended use of these modules.

These images show the new board stack and the old boards within the module and finally the new boards installed into the HomePro enclosure.

There is an LED on the board to show status and I drilled a small hole to allow this to be seen from the outside. It flashes rapidly until it gets a WiFi and MQTT connection. using the button on the front you can press and hold this for around 3-5 seconds just after power up and this will activate an APN and webpage that you can use to configure the device. easier than trying to do this over the serial connection. Peter and Aiden have considered everything with this.

Now the lighting needed to be sorted. The Everspring units that I had purchased from the UK a couple of years ago used to show an annoying fault. They would on occasion started to switch off and then back on again. It was completely random. I replaced one unit with a new one and the same thing happened. then one day I spotted that the on/off fault was occurring when the voltage in the apartment was dropping below 209Vac – Indonesia is not very good when it comes to stability of the mains supply. I opened one of the units and found that they used a very cheap power supply design based on a capacitor/resistor dropper type. These are good when you have a stable power supply but they really don’t like it when the voltage input is too low.

So armed with the HomePro unit design, I set about creating a new PCB to fit the existing enclosures. The ESP12 was located on one side and the AC-DC power on the other. The solid state relay was also on the same side as the power supply. A prog and on/off button were also fitted so I could install the software initially. The web interface would be used to configure it later. You can see the ESP side of the PCB below. The slot in the PCB is to increase the separation of the AC power from the low voltage DC side. The large pads are the AC in and AC out to the lamp.

So now I had a number of upgraded appliance modules and lighting controllers but how was I going to control all of this? It was time to retire my old Homeseer 2 system. The PC was noMy Automated Home: Raspberry Pi + Node-Red + MQTT & Amazon Echo (###) In our latest My Automated home feature, Dave McLaughlin takes us through his journey developing his own smart home system. With some DIY upgrades to existing home automation hardware and some clever software integration he’s built a fascinating system…

In the Beginning

Having used Homeseer and a number of wired and wireless devices whilst in the UK, I switched to wireless when I moved overseas to Indonesia in 2005. As I was living in a rented apartment I need a solution that would not require any cables other than maybe Ethernet in the same room.

I decide on a Z-Wave system, later adding Wemo Lamp modules too. For Z-Wave side of things I chose the HomePro Appliance modules for sockets and Everspring Lamp modules for the lighting. Neither of these 2 modules were cheap.

I ran with this setup until the middle of 2016, but the following issues prompted a change. Firstly Z-Wave was temperamental with 2 units at the far end of ou apartment, even though I had an Appliance Module half way between it just never worked reliably. I would have continually press OFF on the Homeseer Touch based tablet to get my bed light to go off. later I would have 2 units that controlled lamps blow up and fail. one of the IC’s that was part of the power supply had split wide open.

The next headache was the Wemo lamp modules. The only way to get these to work was with IFTTT through their Homeseer and Wemo channels. As long as my internet connection was good this worked ok, albeit a bit slow at times. Not exactly a 10 on the WAF scale.

In early 2016 I came across a website run by Peter Scargill who used to run an electronics design company many years ago from Tyneside. at that time I used his AppCON wired controllers for home automation based on the little 8 bit pic microcontrollers. I had hundreds of meters of 4 core alarm cable run all over my apartment. The system was reliable but trying to hide all that cable didn’t go down well with my partner at the time.

Fast forward to 2016 and Peter was back doing home automation with the little ESP8266 based controllers.

These are based on a Cortex M4 core with built in 802.11 WiFi and come with an SDK that allows development with Eclipse as well as an Arduino IDE option.

As my HomePro units were troublesome I decided to re-engineer the internals and keep the mechanical parts. So I took out the old PCB and did all the measurements so I could make my own 2 stack PCB assembly in much the same as the old one. The lower PCB is the POWER supply and solid state RELAY.

I chose the solid state relays as they switch on the zero crossing and avoid any issues with pulling down the AC and causing the power supply to dip. This works faultlessly and I can switch up to 8 AMPS with this arrangement. more than enough for the intended use of these modules.

These images show the new board stack and the old boards within the module and finally the new boards installed into the HomePro enclosure.

There is an LED on the board to show status and I drilled a small hole to allow this to be seen from the outside. It flashes rapidly until it gets a WiFi and MQTT connection. using the button on the front you can press and hold this for around 3-5 seconds just after power up and this will activate an APN and webpage that you can use to configure the device. easier than trying to do this over the serial connection. Peter and Aiden have considered everything with this.

Now the lighting needed to be sorted. The Everspring units that I had purchased from the UK a couple of years ago used to show an annoying fault. They would on occasion started to switch off and then back on again. It was completely random. I replaced one unit with a new one and the same thing happened. then one day I spotted that the on/off fault was occurring when the voltage in the apartment was dropping below 209Vac – Indonesia is not very good when it comes to stability of the mains supply. I opened one of the units and found that they used a very cheap power supply design based on a capacitor/resistor dropper type. These are good when you have a stable power supply but they really don’t like it when the voltage input is too low.

So armed with the HomePro unit design, I set about creating a new PCB to fit the existing enclosures. The ESP12 was located on one side and the AC-DC power on the other. The solid state relay was also on the same side as the power supply. A prog and on/off button were also fitted so I could install the software initially. The web interface would be used to configure it later. You can see the ESP side of the PCB below. The slot in the PCB is to increase the separation of the AC power from the low voltage DC side. The large pads are the AC in and AC out to the lamp.

So now I had a number of upgraded appliance modules and lighting controllers but how was I going to control all of this? It was time to retire my old Homeseer 2 system. The PC was noFan,…

121 Reviews

£222.99

buy on Amazon

2

Raspberry Pi 400 4GB official Start-up Kit, UK layout

215 Reviews

£110.56

buy on Amazon

3

FREENOVE ultimate Starter kit for Raspberry Pi 4 B 3 B+ 400, 561-Page detailed Tutorials, Python C…

2,835 Reviews

£42.95

buy on Amazon

To get this even lower I came across the Itead studio Slampher and the S20 smart Switches. These are around US$12 each for the S20 modules and $8.50 for the light controllers so considerable less than any of the Z-Wave modules on the market. They come with Itead’s own firmware that is controlled from a iOS or Android app but I wanted to be able to use Peter’s code. Peter had been doing some research into this and found that with minor changes to his code, it would programme into the Itead units and work. You need a USB to UART with 3.3V output to do this but this is simple enough if you can wield a soldering iron. The only downside is that the Itead modules come with a 512KB FLASH and to allow Peter’s code to do OTA updates, we need to change this out to 8MB. The memory IC’s are around $3 for 5 on eBay. Armed with a hot air rework station (borrow a friends if you don’t have one) the job is quick and doesn’t risk damage to the boards. The following image shows the SOIC IC top left after removing the old one and the new one fitted.

You also need to solder on a header to the single row of 4 holes on the PCB. This applies power to the board and allows you to programme it with the custom MQTT firmware. I have a detailed blog on how to do this.

The S20 modules look very smart and modern. The power switch allows you to switch it on and off locally. The ones shown here are Euro sockets but Itead will be offer both us and UK options very soon.

The Slampher modules are ES27 based lamp controllers so not ideal for the UK at present but they work very well.

Considering they are offering the switch modules as UK I would expect that a bayonet version may come along soon. I actually prefer the screw type now for easier installation.

These are easy to open and modify as before with one additional step other than the replacement of the FLASH IC and that is to move a single zero ohm link fr

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

European styleEuropean style

keeping with the Edwardian roots of their 1910 triplex, Montreal homeowners Susan as well as Nicolas embellished each space with antique furniture as well as accessories, like the cherry chaise