Introduction
- In this article, I will explain about the Working With Touch Sensor By Using In Arduino Mega.
- When we touch the things that we have kept or connected to the Arduino, it will be used to blink the LED.
Parts Of Lists
- Arduino Mega 2560
- Touch sensor
- Bread Board
- LED
- Hook Up wires
Touch Sensor
- Touch Sensor enables you to replace the press with touch.
- It can detect the change in capacitance when a finger is nearby.
- That means no matter your finger directly touches the pad or just stays close to the pad.
- Touch Sensor would output HIGH also.
Step 1: Connection From ArduinoMega To Touch Sensor,
- Connect the SIG pin to Ao of the Analog pin to the Board
- Connect the VCC pin to 5v of the Arduino Board
- Connect the GND pin to Gnd of the Arduino Board.
Step 2: Connection From ArduinoMega To LED,
- Connect the positive side to 02 of board
- Connect the negative side to the GND of the board.
Programming
- void setup()
- {
- pinMode(2, OUTPUT);
- }
- void loop()
- {
- if(analogRead(A0) > 600)
- {
- digitalWrite(2, HIGH);
- }
- else
- digitalWrite(2, LOW);
- delay(100);
- }
Explanation
- In this article I explained about the Working With Touch Sensor By Using In ArduinoMega.
- It can clearly display the output on the LED blink
- When we touch the sensor it will glow high automatically.
Output
Figure 2: Output