Hydroponics: Controlling AC mains devices
For my hydroponics setup, I want to be able to turn on and off both the LED grow lights and the water pump using a microcontroller. This is typically done using relays, and is the implementation I described in yesterday's blog post.
I've been thinking it over more and realising that having a solution that can be implemented by anybody shouldn't rely on dealing with AC mains voltages and wiring. Smart plugs using Bluetooth or WiFi having been coming down in price a lot, to the extent that they're a viable alternative to relays, especially if you take the cost of AC sockets and enclosures into account. If you don't want to have exposed wiring, you may want to consider putting your electronics inside a plug case.
Smart plug options
Bluetooth LE smart plugs are used by HomeKit and Philips Hue, but they're still a bit expensive at around £30 per plug. They also don't make use of the standardised Bluetooth profiles and services, but implemented their own proprietary BLE services.
WiFi smart plugs are around £10 each, and you can buy a WiFi power Strip with 3 outlets for £30. Unfortunately these smart plugs are getting more locked down, where you may be forced to use the manufacturer's app and proprietary API to get access to the plugs.
Thanks to Espruino's excellent documentation, I found another option: remote control sockets at around £5 each. They operate in the 433MHz range, which means you use a dirt cheap 433MHz transmitter to talk to them.
I really like this last option, as they use a simple wireless protocol that's easy to implement, and they're almost cheaper than using relays.
I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.