Touchy-Feely Lamp: Using the human body as a natural capacitor
The basis of this project is using the human body's natural capacitance (ability to hold electrical charge) to turn on a LED. The body can hold an electrical charge, and when touching a the wire connected to the Arduino, the LED will turn on.
This is one of the least complicated circuits we have done yet, with just 2 resistors a red LED, and out human hand (labeled potato battery on the csv) to run this circuit. Two wires are connected to digital ports 2 and 4, with a 1 M ohm resistor spanning them, and the "touching" wire on the 2 port one chain. Then another wire connected to the 12 digital port and a 220 ohm resistor make the red LED part of the circuit.
The code utilizes the Capacitative Sensor Library, that you have to import into the code, shown in the first line of code. This allows you to initialize the CapacitiveSensor (your own body) with the two ports 4 and 2. We then set a capacitor threshold, that while the loop() function is running, we are checking if the value determined by the CapacitiveSensor excedes that threshold, and if it does, we turn on the LED.





Comments
Post a Comment