In this exercise, you will use the capacitive sensor to count the number of times a newspaper box has been opened. When it has been opened a certain number of times, a coupon will be dispensed. A RGB LED will act as a signal for when this happens. (Later, if you want, you can on your own to add a servo to make an actual dispenser.) The certain number provided by the Central Yún.
Materials
- Arduino Yún
- Jumper wires
- 10k resistor (The colors on it are brown , black, orange and gold)
- Long wire
- Tin foil
- Breadboard
- Insert wire through hole in door and wrap around handle – secure with copper tape
- Open the “e5_coupon_dispenser” from the examples
- Upload the sketch to the Yún
- When the onboard LED L13 is on, the Yún is ready.
- Open the Serial Monitor and test the sensor by opening and closing the newspaper box. Check the Central Yún ’s serial monitor to see all the saved values.
- Go to this URL: http://verkstad.cc/iot/mmx/4/index.php to see current state of the coupon dispenser.