Want something new about switching. Come and lets get going, Make switching to the next level with Touch Sensor with our favorite Arduino UNO.
Things you'll need:
- Arduino UNO R3
- Touch Sensor
- Connecting Wire
Schematic Diagram and Actual Material
Connect Signal Pin of Sensor to Digital Pin 11 of Arduino
Vcc to 5V
Gnd to Ground
Connect the positive terminal of the buzzer to Digital Pin 7 of Arduino
Negative to Ground
Connect the pins according to the schematic diagram shown above. If you would change any pin designation, make sure to change it also in the code below.
Building the Code
Open your Arduino IDE.
Write the following code below.
int pinSignal = 11; // assign signal input for the sensor
value = digitalRead(pinSignal); // read and save the data from the sensor
/*---- http:connectedcities.com.ph ----*/
Connect your Arduino Uno and upload the code.
The program above has only one objective. If you touch the sensor, it will activate the buzzer and if you touch it again, it will then turn off.
You can also use ATmega328P to make your project smaller and easy packaging.
Comment below if you want some more amazing and advance tutorials.