Pool Control & Garden Lights
Status | Operational |
Platform | ESP8266 |
Budget | $100 |
Date Completed | May 2020 |
Summary of operation
Philips Hue controlled garden lights! Wanted them all to be DC as they're in proximity to my pool area. Didn't think 240VAC garden lights would be a good move.
This started as an initiative to control lights, but has since expanded to include controlling the pool!
Basically the assembled box includes a 12VDC power supply for the pool area garden lights, which are individually controlled by a 2-channel relay module driven by an ESP8266 running a Philips Hue emulator thanks to diyHue.org.
Alternative is to use Tasmota as the firmware rather than diyHue. It's also really good and easy to setup. Just select "Generic" module, set which outputs the relays are wired to, and be sure to follow https://www.home-assistant.io/integrations/tasmota/ to set the correct options.
Parts used
- ESP8266 D1 Mini (knock off) - search D1 Mini on eBay or Amazon and buy them in lots of 5 or 10!
- 5V 2-channel relay module. I used Pololu brand here - decent quality. If you buy online, be sure to get modules that can be switched from the 3.3V outputs of the ESP8266. Use ones with optocoupler, NPN or FET switching. Don't use ones with PNP transistor switching - the 3.3V won't be enough volts to turn them off.
- Power supply - Mean Well RD-50 - 50W dual output +12VDC & +5VDC power supply. The 5VDC powers the D1 Mini/Relays and the 12VDC powers the lights. Be a little careful of these dual-output power supplies - sometimes the voltage regulation of the outputs (RD-50A CH2 is 12V +/- 7%) is less superior than the single-output versions (RS-50A has 12V +/- 1%). Learned that the hard way once. See "Future Improvements" for my better option running now.
- 5A 240VAC fast-blow fuse on the input of the power supply.
- 10A 12VAC blade fuses on the 12V output.
- IP-rated box and some glands. Not that it's in the weather where I have it - but it keeps hands away.
- More recent additions - 150W Aqualux 24VAC pool transformer, Jandy Pool Valve Actuators, Float Switch, retic water solenoid, DS18B20 water temperature sensor among other things!
Some engineering detail
The hardware is wired up as follows:
- Use this reference to understand the D1 Mini Pins. Some go high or low during boot - due to pull-up and pull-down resistors on the board.
- Using the above - I selected D5 & D6 as the appropriate outputs from the D1 Mini to drive the two relays.
- I make sure the 240VAC is actually physically segregated from the DC by heating and bending some ABS plastic tilt panel shims. Didn't want to risk a loose connection causing problems.
Programming:
- For flashing these devices with Tasmota - I use Tasmotizer which makes it super easy!
- The diyHue option is available as a download that opens in the Arduino IDE with minimal parameters to change.
- All setup in Home Assistant (hass.io) to enable mobile phone control!
Future improvements
Recently I've done away with the 240VAC power supply and purchased a Mean Well RSD-30 DC-DC power supply which takes diode bridge-rectified 24VAC from my pool light transformer and produces 12VDC 😊
I've already added extra devices included a water temperature sensor (waterproof DS18B20) and an extra 4 relays to run some 24VAC motorised pool valves on my pool system to control the water feature, a water fill solenoid and float switch, as well as future improvements planned such as a level meter and water meter.