Introduction: Very Cheap and Simple IoT Garden Floodlight Solution
This short instructable explains how to make a remotely controllable garden floodlight for very little cost.
In UK you can get the following items :-
- Aldi 120W floodlight with PIR - £6.99
- Sonoff WiFi Smart Switch Module - about a fiver.
Basically you're replacing the movement sensor with a Sonoff module. You obviously lose the motion sensing, but you gain an online floodlight with wifi, a web server, an MQTT client and Alexa compatibility.
You just need some basic tools, screwdrivers and wire cutters. If you have a soldering iron you can make it even easier.
Let's get started ...
Step 1: Warning - Mains Power
There is no need at all to connect any mains power to the floodlight until you completed the modification and have put all the cases back on.
Please be very careful when dealing with mains electricity, it can easily kill! Please be very sure you know what you are doing and if not sure please refer to an expert to install the floodlight for you.
Step 2: Open Up the Modules
Pop open the white Sonoff housing and discard the plastic casing. You just need the Sonoff PCB itself.
With a sharp instrument or small screwdriver pop off the black plastic screw caps on the bottom of the floodlight PIR sensor housing. Remove the two small screws underneath and put safely to one side.
Step 3: Remove the PIR Sensor
Open the main wiring casing and also the joint between the casing and the PIR module. This is to allow you to gain some extra length on the wires while you switch over to the Sonoff.
Wiggle the two PIR boards out of their housing. Either snip off or (preferably) unsolder the blue, brown and red wires.
Discard the two PIR boards.
Step 4: (Optional) Reflash the Sonoff
You can use the stock Sonoff firmware and the Ewelink App if you like but I much prefer the Tasmota firmware available here :-
I prefer the security of the flashed version. The stock firmware connects out to a cloud service and all control is via the cloud service, which bothers my security-conscious mind. For the average user I'm sure it will be fine. For those who prefer to be in control (and to get loads more features) there are many Instructables detailing how to flash Sonoff with Tasmota.
Tasmota is compatible with Alexa, has an on-board web server for controlling the switch, and works with MQTT.
There are various options in the Tasmota 'user_config.h' but the mains ones to set are your SSID details so the module connects to your wifi on boot up.
Another option that I like to set for the floodlight is the APP_POWERON_STATE setting which I set to 1. This is the Power On state of the relay. Having this set to 1 means that you can still operate the floodlight by the wall switch if needed by just using the switch to power cycle the lamp.
Step 5: Install the Sonoff Module
Use the original casing of the Sonoff to work out which end is input and which is output. On my board the input is nearest to the black mains relay.
If you desoldered the wires you will have the ends handily stripped and tinned. If you cut them you'll need to strip the ends first.
Connect the live (brown) and neutral (blue) wires to the input terminals, following the guide on the original casing.
Connect the red (switched live) wire to the live pin of the output terminal.
Insert the board back in to the PIR housing and carefully take the slack of the cables back up in to the main housing.
Screw back together the joint between the housing and the PIR module, taking care not to pinch the wires and also making sure the rubber ring seal is properly in place.
Screw the PIR housing cover back on.
Install the floodlight wherever required and connect mains to the standard terminals through the hole in the main housing.
Step 6: Done!
You now have an Internet of Things floodlight.
If you flashed with Tasmota you can browse to the IP of the floodlight and start controlling it.
If you did not flash it then use the Ewelink app and follow the instructions within.