** Once again... the mains **

I know I have bored you with the mains bla bla bla talk, but please, I cannot emphasis enough how important is that you are extremely careful while working with mains. Make sure no one can touch them, pack your PCB in a closed plastic case for safety and put it out of reach so no one can hurt themselves.



** Design notice **

- My mains are 220V/50Hz so you should check if this design is compatible with your mains. It should be but please, better be sure than sorry. :)



** Source Files **

- Here are the source files that contain the schematic, PCB layout, microcontroler code, hex files and VB.NET application with source code.

- If you modify this build it would be nice to mention original authors name, but if you don't... I won't be mad :)



** I want to see your build and/or suggestions **

- If you have done this build please let me know, send me some pictures in comments or PM me. Also if you have questions or have suggestions/ideas for others, let us know.



** Room for improvement **



-More security features to your device, some of them may include but should not be limited to:

-> cable strain relieve (so you can't pull out the cable from the box)

-> enclosed box that is waterproof so you can't spill anything on it

-> optical insulation and/or separate power supply for microcontroller and relay

-> different relay that would break both lines instead of just one

-> add zero crossing detection to extend the lifetime of the relay



- Like I said in the start of this build, room for improvement is endless. Here are some of the ideas that you could incorporate in your design.



- Use FTDI232 to communicate with PC over USB (since not all PCs have serial port) or you could use another MCU that has hardware USB support or use AVR software USB library (requires more programming skills).

- Add a wireless communication via 433MHz RF modules, WiFi modules or any other.

- Power the PCB from the mains with transformer, diodes and caps or use the transformerless power supply design or get a transformer and power it from the mains.

- Add more relays and power outlets to control more than one device



** Notice **

I made this device to enable my PC to turn on my Logitech x530 speakers every morning to wake me up with music. My device is located in corner of a room where it's nearly impossible to reach it, so many of the safety features are omitted. This device is safe to use (I've been using it for long time now) but you wouldn't want people stepping on it, touching it, placing it high humidity places or where someone could spill something on it etc. My Logitech X530 have zero crossing detection so I didn't add that feature but it is advisable to add it to extend the lifetime of your relay and to ad extra safety.

When you start building your own device, please consider which security features you would need, if you are not sure, add them because it's better to be sure than sorry. Also I suggest that you try to understand the principle and customize this device to your need rather than just copying what I've done here.



Thank you for all for you support, critics, comments and suggestions. Your feedback is greatly appreciated.