Working With Touch Sensor Using Arduino Mega

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.
 
Figure 1: Touch Sensor
 
Connection
 
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
  1. void setup()    
  2. {    
  3.    pinMode(2, OUTPUT);    
  4. }    
  5. void loop()    
  6. {    
  7.    if(analogRead(A0) > 600)    
  8.    {    
  9.       digitalWrite(2, HIGH);    
  10.    }    
  11.    else    
  12.    digitalWrite(2, LOW);    
  13.    delay(100);    
  14. }   
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