Saturday, 11 March 2017

Hot water Remote Control using a Wemos D1 .... then a Raspberry Pi Zero W

For quite a while now I've been meaning to put together a project to control the Hot water heating remotely from my phone, I all ready have a 2nd generation Nest to control the heating but don't fancy spending the money for the 3rd generation just to add the water heating function.
I started with the plan to use a Wemos D1 Mini with a couple of the plug-in modules like a relay module, processor module and a button module all placed on the dual base PCB.


Button Module

Processor Module
Relay Module


Dual footprint Motherboard
For those of you not familiar with the Wemos D1 you have to be aware of which pins the different modules use because the relay module uses D1 which also happens to be used for one the I2C pins so if you wanted to use the I2C OLED display module it would clash.  I decided to re-wire my relay pin to use D6 (GPIO12) as this is the default pin that the Sonoff / arendst software uses for the relay anyway.

Once the parts were assembled and the software flashed (the button module happens to be the flash button as well)

The idea was to load some software written by a chap called arendst on Github this software allows you to control a relay via MQTT, usually used in WiFi controlled power sockets found at ITEAD but there's no reason why it can't be used on any ESP8266 to drive a relay and more importantly read a connected temperature sensor like a DHT22 or DS18B20.

I planned to control this from my Raspberry Pi 3 running Node Red, I would design a control layout using the Dashboard module, which serves up a webpage I can view on my phone/PC/tablet etc. inside my WiFi network.
Work in progress Dashboard UI in Node Red

 but could also be controlled outside my network using an MQTT app on my phone via the Cloudmqtt service using 4G data.

I also got hold of an Amazon DASH Button which I've configured using a node "node-dash-button", I've configured it so that pressing this button gives a 30 min boost to the Hot Water.

I tried several MQTT apps and found the one I liked the most was MQTT dash it let me create quite a nice interface.
Sample layout for MQTT Dash
Another one I liked was MQTT Dashboard because this has widgets that you can have on you phone desktop to switch something on or off  without opening the app first (Android only, I think).

So all was going well and starting to work when I saw that the lovely people that make the Raspberry Pis had just launched a new version of the Pi Zero, this time with WiFi and Bluetooth included and it was just under £10 .....Whoa! .... hold on a minute! under a tenner! .... I'm quite prepared to use a Pi Zero W instead of a Wemos D1 mini and shut it in the airing cupboard controlling the hot water.

The Pi Zero isn't very fast but I was certain it was plenty fast enough to control one relay and read the temperature using a DS18B20.

So I changed plans at this point a turned toward the Pi Zero W, if you want to use an ESP8266 then go over to Github and use arendst's code (I use it on 3 Sonoffs) and make it happen.

I will put together a blog entry for the Pi Zero W in a few days, I'm just sorting out the housing and wiring to put it in the airing cupboard.

As usual if there are any questions just ask them in the comments and I'll do my best to answer them.



Hot water control using a Raspberry Pi Zero W

Following on from the first blog about the hot water heating control here's what I put together for the mounting. Whilst looking for a...

Popular Posts