Push button switch

Components

Touch sensor

The touch sensor is a capacitive sensor that serves as a button to learn more about the can click here.

Touch Sensor Arduino
Touch Sensor Arduino

Relay to 220V

It is a device to separate electrical circuits of the arduino powered 5v to the bulb that operates at 220V.

Relay Arduino
Relay Arduino

Circuit

We will use the same circuit that we did for the relay or the touch sensor.

5V control circuit

Relay Arduino prototyping
Relay Arduino prototyping

Power a 220v circuit

connection of the relay to 220v
connection of the relay to 220v

THIS ASSEMBLY CAN HAVE CERTAIN ENDANGERMENT TO THE WORK WITH 220V IS RECOMMENDED HAVE CERTAIN KNOWLEDGE OF ELECTRICITY AND DISCONNECT THE CIRCUIT WHENEVER IS CHANGE, NOT WORK WITH THE USB DIRECTLY TO THE PC AND USE A POWER INDEPENDENT FOR ARDUINO.

Program

The software will be a rise detector, bulb has a status that can be switched on or off, having a change in the detector from “low” to “high” must change us that State, so we will use the flanks detector

Code

PUSH BUTTON SWITCH
pinLED int = 13;
int pinTouch = 8;
int SenalActual = 1;
int SenalAntigua = 1;
int State = 1;

void setup() {}
 On light bulb
 pinMode (pinLED, OUTPUT);
 sensor input
 pinMode (pinTouch, INPUT);
}

void loop() {}
 flank detector
 SenalActual = digitalRead (pinTouch);
 If (SenalActual == HIGH & SenalAntigua == LOW)
 {
 If there is a rise flank, it changes the status of low to high 0 from high to low.
 State =! State;
 We get it
 digitalWrite (pinLED, State);
 };
 SenalAntigua = SenalActual;
}


Once programmed by touching the sensor should change the status of the light bulb.

Video of operation

If you are looking for a developer for Arduino, this is your site.

Exhibitor Arduino

If you wish to buy an Arduino for this or other projects click here or on the image.

Arduino genuine one
Genuine Arduino

Summary
Push button switch
Article Name
Push button switch
Description
How do I convert a button on a switch with Arduino? With an (optional) relay sensor touch (or button) and an Arduino are going to solve it.
Author
Publisher Name
Drouiz
Publisher Logo

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.