Site icon Circuit Ideas for You

Arduino Touch Sensor Relay Circuit

Want to control appliances by touch? then this circuit makes it possible.

This Arduino Touch Sensor Relay Circuit uses Arduino and touch sensor.

Arduino reads touch signal and relay works like toggle switch.

Touch sensor is touched once and relay turns ON.

If we touch again then relay turns OFF, each touch changes relay state.

ON becomes OFF and OFF becomes ON.

This project is useful for home automation where we can control light, fan or other load devices.

Arduino Coding:

int touchPin = 2;
int relayPin = 8;

int lastTouchState = LOW;
int relayState = LOW;

void setup()
{
pinMode(touchPin, INPUT);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, relayState);
}

void loop()
{
int touchState = digitalRead(touchPin);

if (touchState == HIGH && lastTouchState == LOW)
{
relayState = !relayState;
digitalWrite(relayPin, relayState);
delay(300);
}

lastTouchState = touchState;
}

Circuit Working:

Arduino Touch Sensor Relay Circuit Diagram

Parts List:

Component NameQuantity
Arduino UNO1
Touch Sensor Module TTP2231
Relay Sensor Module1

The TTP223 touch sensor works like a switch, it detects finger touch.

It gives digital output when output is HIGH or LOW.

Arduino reads this signal and it toggles the relay output.

Relay changes contact position and connected load turns ON or OFF.

Each touch changes the state.

How to Build:

To build a Arduino Touch Sensor Relay Circuit following steps are required for connection:

Conclusion:

This is a simple Arduino Touch Sensor Relay Circuit.

It uses few components which are easily available in market.

Arduino coding is easy and relay works as toggle switch.

Project is good for beginners and it is useful in real life automation.

References:

5V Capacitive Touch Sensor Turn on 12VLED Light

Exit mobile version