Having liberated my Raspberry Pi when I migrated this site to a hosted server, I needed a new project. Having discovered the wonders of cheap imported electronic components from China, I thought a nice little home automation project would be a laugh. I have dubbed it "DomIO".
The plan is as follows:
I looked over what I could do and initially planned on using an ESP8266-12E to give wifi to an Arduino which would in turn communicate with a Raspberry Pi running Node-Red to automate a few gadgets around the place. This original plan eventually changed a little when I found out how to use the ESP8266 to replace the Arduino entirely.
The whole device would need to be small (fit in a cube 5cm to a side), run on mains power to avoid running special cables everywhere and be safe to avoid burning my house down. Encryption would be a bonus.
The first protoype was very crude - simply a cardboard cutout taped to the rough footprint I wanted and knew I could source regarding PCBs. This was mainly to pitch the idea to my wife and to reassure her that the finished product wouldn't be totally ugly. I also built it out on breadboard and then protoboard to make sure I could get the parts working together as planned.
The next step would need actual PCBs. I looked at Eagle, which is free under 10cm to a side, but decided on kicad. For reasons. It took me a good while to (kinda) get the hang of kicad's multi-step process, but I eventually got to the stage that I could quickly crank out an idea in it. I would then send my designs to DirtyPCBs to get a protopack done.
As you know, I work at a 3D printing service so naturally, I'd be 3D printing the case. I needed parametric CAD to do this without losing my sanity, can't figure out FreeCAD for love nor money and hadn't yet discovered the wonderful SolveSpace, so I went with OnSpace.
I first modeled all of the PCB + components. This would give me my internal footprint, around which I could build my case. I left as much room inside as possible to allow for changes but insisted on remaining inside the initially planned 5cm envelope.
The first iteration of the circuit assumed an Arduino would be necessary for the logic. So the first circuit included a power converter, ESP8266 and an Arduino, which made for a very fidgety board and lots of soldering. Not only that, but the lack of remaining space meant that two PCBs would be needed, one for the logic, power and comms, another for the sensors themselves! But as you can see on the protoboard I soon changed plans...
The second iteration uses the ESP8266 for both logic and communication, so the circuit could be cleaned up a lot and the number of PCBs reduced to one. This version also included better protection with a thermal fuse (73°C). This was also the version that served as the model for the case, so I could actually use it! At which point I discovered that while my schematic footprint for the BH1750 lux sensor was right, the pcb footprint had been mirrored... I done f'ed up.
This second iteration is (apart from the lux sensor) fully functional and has it's own rudimentary web server that I can load on the local network.
Version 0.3 is still under development. It will feature a correctly oriented lux sensor, but also both overvoltage and current protection on top of the existing thermal protection. All 3 of these would be vital if I'm ever going to build this into a wall or ceiling.
Versions 0.4 and up will (I hope) start to feature the ESP32, which includes Bluetooth Low Energy (detect who is in the room thanks to their phone!) and encryption (don't hack my sockets bro).