Touch Sensor with Arduino
With Following tutorial, you will be able to use Arduino digital input and output pins.
To replicate exact results of this tutorial you will be required following
1. Arduino Uno
2. Capacitive Touch sensor
Buy Now
3. Small 3V DC Toy Motor For Arduino
Buy Now
Procedure:
- Connect Arduino Uno to PC for power and programming
- Connect Touch sensor's VCC pin to Arduino 3.3V output pin.
- Connect Touch Sensor's GND pin to any of Arduino ground pin.
- Connect Touch Sensor's SIG input to any digital input of Arduino pin (1-13) I am connecting to digital pin 3
- Connect DC motor one leg to Digital Pin 13 and another leg to ground.
- Program Arduino with the following sketch.
#define TOUCH 3 //the touch sensor is connected to D3
int DCMOTOR = 13; // pin for the DC motor.
void setup()
{
pinMode(DCMOTOR, OUTPUT);
pinMode(TOUCH, INPUT);
}
void loop()
{
int sensorValue = digitalRead(TOUCH);
if(sensorValue)
{
digitalWrite(DCMOTOR, HIGH); // Start DC motor
while(digitalRead(TOUCH) == HIGH);
digitalWrite(DCMOTOR, LOW); // Stop DC Motor
}
}
Now you are ready for your experiment.
When capacitive sensor receive touch its capacitance changes and SIG output signal gets generated on SIG pin.
On such detection, Arduino generates a driving voltage for DC motor.
Note:- If you don't have DC motor you can still use above program, instead of motor rotation you can see Ardunio inbuild led on pin 13 .toggling on sensor touch.
Please view following Video.
Thanks, l like you! l am wantysz, We have the capacitive touch digitizer manufacturer
ReplyDelete