Arduino Capactive Touch Sensor With LEDs
by DaisyDream in Circuits > Arduino
543 Views, 1 Favorites, 0 Comments
Arduino Capactive Touch Sensor With LEDs
The inspiration from this creation comes from the website Arduino/ESP32 Capacitive Touch Sensor
The original website was instructing capacitive touch sensors on Arduino and ESP32. It used the serial port to determine whether the sensor is touch. However, I added LED lights to have a better understanding of if the sensor is touched. I further changed the code to make the sensor more sensitive.
Supplies
- Arduino development board *1
- Wires *4
- Alligator clip *1
- Breadboard *1
- Some tinfoil
- LEDs *2
- USB input line *1
- Precision resistance *2
- Computer *1
Step 1: the Wiring
The original website chose the analog pins A0, which I continued to plug A0 for the touch sensor. The original website used wire for connecting the tinfoil, which needed to use tape for connection. However, I used the alligator clip to attach the tinfoil since the tape is resistant to electric current. I added the LEDs, which used D11 and D10 for my digital pins. I used 2 of the precision resistor to have better stability on the electric current.
Step 2: Coding
I continue to utilize some of the code from the original website. The author wrote the code awesome. However, I changed the resolution value from 100 to 1, and make a change on the float multiplier value, from 1.7 to 1.2. These changes made my sensor has a better sensitiveness. I think this is because the original website used tape for the connection between the wire and the tinfoil. I added the code of LEDs in the loop, which made the light blink.
The code is in code.
Step 3: the Use of the Sensor
The video above is the final product of this project. As you can see, when you touch the tinfoil the red light would change to blue light. You can also look at the serial port to see the high/low of the sensor's touching. When you find the sensor is not as sensitive as the start, this is because the tinfoil is wrinkled, change a new piece of tinfoil to have better sensitivity.
Step 4: Final Product
Put your Arduino board with the breadboard into the box. Make sure to pock a hole so the USB line can go through.
I hope you have a great time making this product.