Introduction: Touch Button to Trigger Anything
Hi! In this Instructable, I will be showing you how to build a button that you can touch or wave to trigger. You will need:
- An Arduino Uno
- A piece of glass
- An enclosure smaller than the glass, but bigger than an Arduino. Can be made from cardboard or 3D printed. I don't have a 3D printer (yet...) so I made mine out of cardboard. The back does not look very nice.
- A 10M mohm resistor
- An L.E.D.
- Aluminum Foil
- A printed decal
- Something to trigger
Step 1: Assemble Glass
Take your piece of glass. Print a photo or text to put behind the glass. Fasted it to the glass with tape (try to keep it hidden) or glue it to the glass (you will not be able to change it). Take a piece of aluminum foil. Tape or glue it behind the glass and attach a wire to it. Tape or glue the LED (with extended leads) above the foil so that it can be seen through the the glass. You are now finished with the glass for the button!
Step 2: Assemble Back
Now, take your enclosure and put it around the foil on the back of the glass. Fasten it with glue or tape. You now need an insulator so the Arduino does not short. Take a piece of cardboard and cover the foil. I'm sorry if this was too hard to understand, but you are now finished with the enclosure!
Step 3: Assemble Electronics
You should now have a piece of cardboard with three wires sticking out, as shown in the picture. Place the Arduino there. Make sure the wires can reach the Arduino. Put the resistor between pins 8 and 9, with the gold band facing pin 9. Attach (solder or twist) the wire connected to the foil to the side of the resistor with the gold band. If you are using breadboard cables like me, you should be able to squeeze them both into pin 9. Attach the ground LED leg (shorter) to GND and attach the positive LED leg (longer) to pin 13. With the wires attached, move your Arduino's USB port to the side of the enclosure. Cut a hole to access it (you can also cut a hole to the power connector if you want. I used USB power). After you cut a hole, mount it. I used 3M mounting tape to stick the Arduino in place. I just put a piece on the back, aligned the USB port to the hole, and pressed it down. Before you close up the case, connect anything you would like to trigger to pin 12 and GND. You can also use pin extenders to extend the pins outside the case. This means you will be able to access it at any time and change things connected to it. Once everything is connected, place the backing on the enclosure.
Step 4: Software
The code is attached to this Instructable. If you want the LED to flash five times when activated, choose the Touch_Button_LED_Flash code. If you want the LED to light up only when touched, use the Touch_Button code. Upload the one you like to your Arduino. The code is based off of Paul B's capsense.
Step 5: Sensitivity
You can adjust the sensitivity for the button. By default, you just touch the button. You can adjust it so that you have to place your whole hand on the button, or so that you can wave your hand in front of the button. To adjust, open the serial monitor (with the Arduino plugged in). You should see numbers scrolling down in the serial monitor. Try touching it. The values increase by a lot. Now try waving in front of it. The values increase as you move your hand closer. Place your hand how you would like the button to be activated. Record the value shown while you do this. Save that number. Find the highlighted value from the image above in your code. Change to 90 to the value you recorded before. Now, upload the updated code and place your hand in the same spot. The button should be triggered.
Step 6: Improvements/Mods
The touch/wave button can trigger many things. Plug anything low powered into pin 12 and GND to activate it. It can activate Halloween decorations, automatic doors, doorbells, audio recorders, alarm systems, etc. These are just a few ideas. Be creative! You can also remove the glass to make it more sensitive, but it won't feel as nice. This was originally meant to trigger a recorder module to output to a stores PA system or radios for assistance, but I realized it can be used for many other things. If you do not want an LED, you can just leave it out. No need to change up the code. Thanks for reading and a vote in the Epilog VII Contest would be greatly appreciated!
Participated in the
Epilog Contest VII