This is a 3 parts enclosure for the Sonoff Basic that fits nicely in a typical electrical box.
This is a work in progress and I intend to make many versions of the top cover to accommodate different configurations (sensors, LED, buttons, switch, etc).
The middle part let the headers (that you added) out, so you can connect what you want.
All the parts snap together nicely.
The first top cover here can accommodate a 16mm button with LED ring.
Demo installed in wall:
For the top cover I use 50% support density so that the wings print properly.
For the middle section, just use 15% support density
No need for supports for the bottom part.
Connecting the LED button
To connect the button
- Bridge the negative pin of the LED and the common pin of the switch.
- Solder the ground wire to the pins you've bridge in step 1. Cover with heat shrink
- Solder the the button wire to the NO pin. Cover with heat shrink
- Solder the LED wire to the positive pin of the LED. Cover with heat shrink.
- Connect the wires to the headers:
- Ground wire to the 2nd farthest header pin from the embedded button (GND)
- Button wire to the farthest header pin from the embedded button (GPIO14)
- LED wire to the middle header pin (TX pin)
Flashing the Sonoff
Use the Tasmota firmware to be able to use the button and the LED. There are a lots of video and web pages describing the process of flashing the Sonoff.
Before flashing the firmware, don't forget to configure your wifi settings. Additionally you will need to edit the "sonoff_template.h" file and change these two lines. This will enable the possibility to reallocate the function of the embedded LED and button to the one you plugged in instead.
GPIO_KEY1, // GPIO00 Button
GPIO_USER, // GPIO00 Button
GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
GPIO_USER, // GPIO13 Green Led (0 = On, 1 = Off)
In the Tasmota/Sonoff web interface go in "Configure Module" and set
- GPIO14 Sensor to "13 Button1"
- GPIO1 Serial Out to "48 Led1"