The Arduino Projects Book includes "15 Hacking Buttons". I dislike this project for multiple reasons:
- It involves potential destruction of home appliances. From the project:
"You’ll be opening up an electronic device and modifying it. You’ll void your device’s warranty, and if you’re not careful, you might damage the device....We recommend you use inexpensive items you don’t mind damaging for your first few projects, until you develop experience and confidence."
- I tried many permutations of this project without success. In every case, once the optocoupler (I used MOC3021) gets activated, it remains permanently activated even when the sketch executes digitalWrite(optoPin, LOW)...even when I physically disconnect the anode of the optocoupler from the Arduino UNO pin.
Therefore, I created a series of projects that teach the same optocoupler concepts in a simpler way. Moreover, these projects also teach Triacs. Anyone can download the files for these projects here: p15_HackingButtons.zip
**These projects use high-voltage electricity from a home outlet. If you do not have previous experience with high-voltage circuits, you should probably avoid these projects. **