Sonoff Basic: cheap and hackable DIY WiFi switch
If you think the Sonoff S20 is already an incredibly cheap WiFi switch, then you don’t know the Sonoff Basic yet. For about half the price of an S20, you can already switch a device on or off via WiFi. Where the S20 goes for 10 euros over the virtual counter, the Basic is usually available for around 5 euros on the various Chinese websites.
Like the S20 you can use this switch operate with the eWeLink app (Android / iOS), or with Google Home Assistant, Amazon Alexa, Nest or IFTTT. If you do not want to operate it with a “cloud” -based app or service, the Basic is also easy to hack.
The package contains the switch, manuals in English, German and Chinese, and a bag with screws. With these screws, you can attach the cover caps (which also act as strain relief) to the Basic. The Sonoff that we are reviewing here is the second version of the Basic, the “RF R2 Power V1.0”.
Connecting the Sonoff Basic
Unlike the S20, the Sonoff Basic is not plug-and-play, but more a do-it-yourself switch. Where you can simply plug the S20 into a socket, you have to fit the Basic into the wiring. For example, if you want to switch a table lamp, you must place the Sonoff Basic in the wire between the lamp and the plug. You do this as follows:
- Cut the wire and strip the ends (not too far).
- Find out what the wire color coding is for your country. For most European countries, the neutral wire is blue and the live wire is brown. For the US, the neutral wire is white and the live wire is black.
- Connect the piece of wire with the plug to the Sonoff input: the neutral wire on the terminal marked with N and the live wire on the terminal marked with L.
- The piece of wire with the lamp connected to it in the same way at the on the output, also here the neutral wire on terminal N and the live wire on terminal L.
- Attach the cover caps (strain relief) to the Sonoff and screw them in. Insert the plug into a socket and check with the push button on the switch whether it works properly.
The Basic has no ground connection. If you still want to switch a device that has grounding, then you will have to route the earth wire outside the Sonoff.
If you have connected everything properly, you can now link the Sonoff to the app.
Linking Sonoff Basic to the eWeLink app
The procedure is described in the English manual. If you want a more detailed description, you can also read the chapter “Link Sonoff S20 to eWeLink app” in the previous article ” Sonoff S20 Smart Socket: easy home automation “, the procedure is the same.
In short, the procedure comes down to this:
- Download the eWeLink app for Andriod or iPhone.
- Open the app and register a new account, or log in if you already have one.
- Plug the plug of the Basic into the socket.
- Press the button on the Basic for 7 seconds until the LED starts to flash quickly.
- Click on the ‘+’ at the bottom of the screen in the app.
- Select on the next screen ‘Quick Pairing Mode’, then ‘next’.
- Choose your WiFi network, enter the WiFi password and press ‘next’.
- The app will now ‘pair’ with the Basic. If pairing fails, try again. If it still does not work, choose “Try Compatible Pairing Mode”.
- If the pairing is successful, you can give the device a name, for example, “Sonoff Basic”. Then press ‘Complete’.
The Sonoff Basic is based on the ESP8285 WiFi chip. This is an ESP8266 with 1 MiB flash memory already built in, so a cheaper single-chip version. And also with this device, the serial port on the PCB is available, so that offers possibilities for flashing an alternative firmware.
The connection points for GND, 3V3, Tx and Rx are indicated on the PCB on the back.
By flashing an alternative firmware such as Tasmota on the switch, you can include it in your own IoT network. Then you can, for example, control it via MQTT with Node Red. The possibilities for home automation are endless, we will get to work with it in the next article.
- Voltage range: 90-250v AC(50/60Hz)
- Max current: 10A
- Max Wattage: 2200W
- Dimensions: 88 x 38 x 23mm (L x W x H)
- Enclosure Material: Fire-retardant ABS
- Wireless Standard: 802.11 b/g/n
- Security Mechanism: WPA-PSK/WPA2-PSK
- Weight: 51.0g
Just love these units – have one on my pool pump – another (Power) on the warm water geser – and another on external lights for that late night home coming.
Even connected the input 220v to the output – the two glass fuses on board died – never even tried to fix it!
Any idea how to convert this unit to 12v DC? Want to run my irrigation system on it as well – I currently use an AC to DC converter on the output to give me the 12v I require – such a combersom way to do it! I’m sure it should be easy to modify the unit to only get the relay contact (switch) on the output to switch anything that requires just an open/ close contact – e.g. controlling the Alarm system.
Nice link to flash Sonoff