• Models
  • Contests
  • Slicer
  • Login
  • Start Here
    thingiverse-iconprintables-iconcults3d-iconmakerworld-iconmyminifactory-icon

    3D GO

    3D ModelsContestsCollectionsSaved ModelsOn a mobile device?

3D GO

Privacy Policy
Sonoff Basic Speedo Case 3D Printer File Image 1
Sonoff Basic Speedo Case 3D Printer File Image 2
Sonoff Basic Speedo Case 3D Printer File Image 3
Sonoff Basic Speedo Case 3D Printer File Image 4
Sonoff Basic Speedo Case 3D Printer File Image 5
Sonoff Basic Speedo Case 3D Printer File Image 6
Sonoff Basic Speedo Case 3D Printer File Image 7
Sonoff Basic Speedo Case 3D Printer File Image 8
Sonoff Basic Speedo Case 3D Printer File Image 9
Sonoff Basic Speedo Case 3D Printer File Image 10
Sonoff Basic Speedo Case 3D Printer File Image 11
Sonoff Basic Speedo Case 3D Printer File Thumbnail 1
Sonoff Basic Speedo Case 3D Printer File Thumbnail 2
Sonoff Basic Speedo Case 3D Printer File Thumbnail 3
Sonoff Basic Speedo Case 3D Printer File Thumbnail 4
Sonoff Basic Speedo Case 3D Printer File Thumbnail 5
Sonoff Basic Speedo Case 3D Printer File Thumbnail 6
Sonoff Basic Speedo Case 3D Printer File Thumbnail 7
Sonoff Basic Speedo Case 3D Printer File Thumbnail 8
Sonoff Basic Speedo Case 3D Printer File Thumbnail 9
Sonoff Basic Speedo Case 3D Printer File Thumbnail 10
Sonoff Basic Speedo Case 3D Printer File Thumbnail 11

Sonoff Basic Speedo Case

jdanders avatarjdanders

December 10, 2022

printables-icon
DescriptionCommentsTags

Description

This is a case for the Sonoff Basic Wifi switch designed to fit tightly enough (like a Speedo) to allow in-wall light switch installation. I do not know if this is safe or legal, so do it at your own risk! It is definitely safer than just wrapping it in electrical tape like one Youtube video I saw.

There are two versions, thin and normal, but I only use the normal one. The normal one is designed to be rigid and thick enough to protect the board while installed. There is a thickness variable in the scad you could tweak if you want to.

The thin variation will only work with flexible material, as it actually wraps around the PCB and holds tight. Trying to get this top on is probably a lot like trying to get a real Speedo on! I printed it in TPU, and it works, but ultimately I decided that I wanted the protection of the Sonoff over the couple of millimeters saved by the super tight design. The thin version is only like two layers thick, so you need to have good printer TPU settings for it to work.

Hah, I didn't realize how many in-wall solutions were already posted! This approach keeps the light switch looking the exact same as before installation, but does heavily modify the Sonoff itself.

No one in the house even noticed the first install I did!

Print Settings

Printer Brand:

Monoprice

Printer:

Select Mini

Rafts:

No

Supports:

Yes

Resolution:

0.175mm

Infill:

Doesn't matter

Filament: 3d Solutech/Pxmalion PLA/ABS White


Notes:

This case is designed to fit exactly over the components, so print quality is important. However, my printer is poorly calibrated, so I designed in a fudge factor that you can change in the scad if you are having fit problems. I have tested it on 9 Sonoff devices (8 from one vendor and 1 from another) and they all fit. The biggest issue is the thick wires might be placed differently than my model, so you may need to push those around to get a fit.

I choose to print the top inverted. It takes a full support structure to get the overhangs to print right, and on my printer at least, the supported parts end up pretty rough and nasty looking. I print it upside down so that the inside of the case is nice a precise, and the outside is goopy from the supports. It also makes it easier to remove the supports.

I print with 12% supports, using the "Cross" infill in Cura. That seems to come off most easily. For the normal version, you should make sure supports are touching build-plate only to avoid filling in the wire holes. If you're printing the thin top, than you need supports everywhere and you'll need to clean out the lip section.

The bottom should print just fine without supports.

Post-Printing

Installation

The Sonoff Basic is an ESP board connected to a relay, designed to be installed in-line with the device you want to control. I am using them to make my lights "smart" lights, while still keeping their light-switch functionality. I use Home Assistant for central control, and ESPHome for the ESP firmware. I'll paste the ESPHome yaml file I use below.

In order to fit in a light switch box, I remove the built-in switch and LED, and then solder two thin-gauge wires to the top two pins of the built-in switch. These thin wires go through the board (through one of the cut-outs with a knot in the wire for stress relief) and comes out one of the small holes in the bottom of the case. They connect to the old light-switch in the wall. This allows local control of the Sonoff switch just like before the Sonoff was installed.

There are two options for the old light switch input:

  • any switch toggle, up or down, toggles the light's current state. This is like a traditional two-way switch
  • toggle up turns on the light if off, toggle down turns off the light if on. If it's already off and you toggle down, nothing happens

I have been using the second option because I don't like inverted switch behavior.

Actual installation is a lot like installing a dimmer switch:

  • Life's a lot easier if you kill power to the light before installation, but sometimes I live on the edge :)
  • Remove old switch
  • Make room in the box. For me this is often the hardest part because my house is wired with 12 gauge wire that is tough to squish and is too thick for the Sonoff connectors. I have found it easiest to get a short thinner gauge wire and use a wire nut to connect to the thick wires. Then I push all that back as tight as I can. Since I'm driving LED lights, even something as thin as 18 gauge is okay to use.
  • Connect wires.
    • The main wires: connect the supply black to input L and white to N (colors in the US at least), and load black to output L, output N is not needed as long as supply and load white wires are connected in the box).
    • The two light switch wires simply wire to the two terminals on the light switch. There is no polarity.
  • Screw it all into place. If you have wired directly to the sonoff with the main wires, be careful not to apply two much force to the terminals, as the PCB can flex and break.

The installation pictures shown might help a little. The white one is printed in PLA, and the clear-ish one in ABS. The material shouldn't matter too much.

Here's the ESPHome yaml:

esphome: name: light_swtich_name platform: ESP8266 board: esp8285

wifi: ssid: 'myssid' password: 'mywifi'

mqtt: broker: 'broker.addr' username: 'mqttuser' password: 'mqttpass'

Enable logging

logger: level: DEBUG

ota: password: 'updatepass'

output:

  • platform: gpio

id: relay pin: number: GPIO12 inverted: false

light:

  • platform: binary

id: light_output name: Light output: relay

binary_sensor:

  • platform: gpio

name: Light Switch pin: number: GPIO0 inverted: true filters:

  • delayed_on: 100ms

on_press: then:

  • light.turn_on: light_output

on_release: then:

  • light.turn_off: light_output

How I Designed This

This was designed using my $10 plastic calipers and OpenSCAD. This is my most involved OpenSCAD design yet and could probably be improved, but it seems pretty well organized and manageable. The trickiest part was figuring out how to turn my model into a shell of the model, but the grow function seems to work well enough.

Category: Electronics

License:

Creative Commons — Public Domain

Related Models

Thor Mjolnir Hammer Bic Pen preview image

Thor Mjolnir Hammer Bic Pen

effektz profile image

effektz

9,081

Diverse Schilder / various labels  for hobby & makers preview image

Diverse Schilder / various labels for hobby & makers

RPK profile image

RPK

2

Cacciavite Portachiavi - Scewdriver keychain preview image

Cacciavite Portachiavi - Scewdriver keychain

Butti Maker Studio profile image

Butti Maker Studio

21

Vorpal The Hexapod Walking Robot preview image

Vorpal The Hexapod Walking Robot

vorpal profile image

vorpal

4,981

MakerZ – Open Source 1/28 RC Drift Chassis by Fails & Makes | Açık Kaynak 1/28 RC Drift Şasisi preview image

MakerZ – Open Source 1/28 RC Drift Chassis by Fails & Makes | Açık Kaynak 1/28 RC Drift Şasisi

Fails&Makes profile image

Fails&Makes

Cute Fluffy Puppy Figurine to Print preview image

Cute Fluffy Puppy Figurine to Print

bonowski. profile image

bonowski.

3

Snap-Together Mini Minecraft Jack-O-Lantern with integrated LED preview image

Snap-Together Mini Minecraft Jack-O-Lantern with integrated LED

scottrlindsey profile image

scottrlindsey

4,447

Small Parts Storage Drawers - Organizer preview image

Small Parts Storage Drawers - Organizer

GT 3D Makers profile image

GT 3D Makers

29

8