The possibilities to expand this build are endless, however here I will give you just the simplest solution (because I just needed on/off feature for my PC speakers).
** Parts that you will need **
There are a few components that you will need for this build and you can get them almost anywhere
- 1x MAX232 (for serial communication)
- 4x 1uF 10V Electrolytic capacitor
- 1x ATtiny2313 (you can use even cheaper/smaller that has UART and 2 I/O pins)
- 1x AVR programmer (or programmer that can program your chip. Arduino can be used to program AVR chips)
- 1x Relay 5VDC 250VAC 10A (I had one of these laying around)
- 2x 3-terminal screws (optional, you can use anything that can keep your cables fixed and connected)
- 1x Extension cable (Best option is if you have one like mine that is 1 to 1 extension cable ( 1 cable goes to wall socket and on the another end you have just one socket ))
- 1x 2A fuse (or you can use other value, calculate one for your needs)
- cables, wires etc..
- Plastic case!!! (we are going to work with AC 110/220 lines, so YOU MUST isolate them good so no one can touch them from the outside because it can cause serious injuries or even DEATH!!! So please be careful! I'm not responsible for any damage or harm done)
- 2x LED (1 Red 1 Green)
*** Please be cautious **
- One part of our build will be directly connected to the mains via relay, it is important that you know how this device works and which side you CAN NOT EVER TOUCH while the device is plugged in since it can cause serious injuries or even death!
- Author of this build suggests that you have a basic knowledge or at least that you look trough other Instructables for more information on parts and how they work or how to make your PCB and etc.
- Also consider adding 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
- This instructable is just an idea how something could be done, it may not be the best way and you should rather customize it to your needs (if you don't know ask someone to help you) rather than just copying it whole. However with few adjustments and changes you could get a pretty nice device that will add a feature to your appliance that you are looking for.
** Let's get started **
First we need to make a schematic to see how to connect devices to each other and how does this work.