Search for question
Question

we want to add to below code, signal send to relay switch with 5 volt to switch the relay from open to close when there is touch on the sensor. So, when there is any finger on sensor the arduino send 5 volt to switch to close. Only we need this part to be add to below code. " #include <Capacitive Sensor.h> CapacitiveSensor Sensor = Capacitive Sensor(4, 6); long val; int pos; #define led 13 void setup() { Serial.begin(19200); pinMode(led, OUTPUT); } void loop() { val = Sensor.capacitive Sensor(100); Serial.println(val); { if (val>= 100 && pos == 0) digitalWrite(led, HIGH); pos = 1; delay(100); } { else if (val <= 0 && pos == 1) digitalWrite(led, LOW); pos = 0; delay(100); } delay(50); } "I/n