There isnt a project category, so I am putting it here in hardware, hopefully this can inspire others to make something similar, and together we can share the projects with each other.
I am working on a box with two outlets. The purpose of this box is to easily be able to switch the outlets on and off, in a not too ugly looking box, and wires hanging out left and right.
This is the box I found. It is pretty cheap (30dkk), got two outlets, and they are not connected together inside.
As you can see, on the inside there is plenty of space to add some extra electronics, and then still not muchâŠ
The big problem is to find a power supply small enough to fit in between the two out lets, find room for the TTL adapter so it is possible to re-program it inside the box, have room for the relays, and also have enough room to geet some wires from the relays and up to the terminals for the outlets.
To get room for everything, and hold it in place, I decided to go with SMD components, and design a PCB for it all.
On this PCB, from the top, we got the two relays (still missing the transistor to drive them), in the middle the connector where mains voltage will come in, further down to the right, the regulator which will bring the 5v down to 3.3v for the ESP8266. Just below the voltage regulator a series of capacitors to help stabilize the output from the regulator, and just below those the ESP8266, which is the brain in this thing. Above the ESP8266 to the right, there are two resistors, which will later be connected to the transistors for the relays.
In the middle in the bottom, we got the power supply which will convert the 230V mains into 5V DC. To the left of the power supply, there is a 6 pin header, so we can connect the TTL adapter and re-program the ESP8266 easily. Just below the TTL connector, there is the option to connect a jumper and bring the ESP8266 into flash mode.
Before continuing, I wanted to see how much space I got between the components.
Found a few places where it was a bit too tight, so I had to move a few components 0.5mm, that was all I had, and luckily it seems to be enough.
Update 2015/11/01
All components are in, now I am just waiting for another power supply to arrive. The one I started out with was a 600mA 12V, but there is a 700mA 5V version, in the same size, which is much better suited for this.
Another update today, this time with a lot of the copper pour removed, to give a higher isolation from the mains voltage.
http://gerblook.org/image/zsDFiu3fV2zAELuUCtkRCH/top.png
Update 2015/11/02
Printed the design out, and tried how it fits in the box. I am glad I did, because the first version was way offâŠ
Update 2015/11/22
Finally did a bit of cleanup in the schematic, so here it is.
Stay tuned for more updates.