Arduino Push Button Relay Control

preview_player
Показать описание
Hey friends in this video i will show you how to control relay with a push button.

Materials
Arduino UNO
Relay Board 2 Channel
Push Button
Breadboard
Jumpers

Follow me on:-

snapchat:- viraldodhia20

---------- VIRAL SCIENCE © -----------
Рекомендации по теме
Комментарии
Автор

can this be modified to make the buttons act like momentary switches? if so how would i go about doing that?

cyberstar
Автор

Bro!!!! Crazy. Innovative. Awesome. Keep making videos. Nice hard work in videos.
One suggestion, pls add your voice too. In future uploads/videos.
👍👍😇😇😊😀😄

techy_science
Автор

Congrats on another great vídeo.Full in details.Very important for us noobs :))

GonzoRibeiro
Автор

I wonder if it would be a good idea to add a 10000 ohms resistor to protect pins of the push-buttoms from ground, like in a pull-down or pull up resistor circuit.

rafaelaprende
Автор

hello i wanna ask you if i can upload a programme in arduino then i upload another program without combine it it can function?

malekdahmen
Автор

is it possible to combine this with voice control using a single arduino ?
or 2 arduino ? 1 is for voice control and the other is for push button
please answer me sir thank you

hakyouaaron
Автор

//Code for this video.
int pbuttonPin = 2;
int relayPin = 10;
int pbuttonPin2 = 3;
int relayPin2 = 11;

int val = 0;
int lightON = 0;
int pushed = 0;

int val2= 0;
int lightON2 = 0;
int pushed2 = 0;

void setup(){
Serial.begin (9600);
pinMode(pbuttonPin, INPUT_PULLUP);
pinMode(relayPin, OUTPUT);
pinMode(pbuttonPin2, INPUT_PULLUP);
pinMode(relayPin2, OUTPUT);


}
void loop (){
val = digitalRead(pbuttonPin);
val2 = digitalRead(pbuttonPin2);

//Relay 1
if(val == HIGH && lightON == LOW){
pushed = 1-pushed;
delay(100);
}

lightON = val;

if(pushed == HIGH){
Serial.println("Light ON");
digitalWrite(relayPin, LOW);
}
else{
Serial.println("Light ON");
digitalWrite(relayPin, HIGH);

}
//Relay 2
if(val2 == HIGH && lightON2 == LOW){
pushed2 = 1-pushed2;
delay(100);
}

lightON2 = val2;

if(pushed2 == HIGH){
Serial.println("Light ON");
digitalWrite(relayPin2, LOW);
}
else{
Serial.println("Light ON");
digitalWrite(relayPin2, HIGH);

}
delay(100);
}

WizzyFilms
Автор

Congratulations Congratulations Congratulations. Yes, as I would use an input mcp23017 to manage 16 physical buttons, how can you make such a system that you made with the video by adding a mcp23017? . Thank you very much for the attention .

Elettronica-xtnm
Автор

Please make a video on Arduino sketch explanation

ramkrishnadhote
Автор

It will be off when I tell it to be off. For example, if I clap my hands, the light will come on. I will turn on the light until the next clap. How do I please brother

pollabexperiment
Автор

Great video, thank you! i have a question though, what does the statement [ pushed = 1-pushed; ] do? I just started with arduino in April.

genevatungate
Автор

You should put a note about Bulb lamp's phase should be connected to relay for security reason.

onurolce
Автор

hi, i have a cuestion, what if i want 4 relay's? i need help with the gcode

rseguras
Автор

Sir, I making project of Arduino boice control cat, but facing a big problem, , can you pls help me, , ....I'm in class X

Adityakumar-uhwo
Автор

I would use switch case instead of if and else in the code. Cleaner that way🙂

TheEdmaster
Автор

sir great plz arduino nano bike automation bnaaye plz

rkmusicbasopatti
Автор

For this you can use cheap 555 timer, not an arduino.

pawel
Автор

cant download code.pls help sir.thanks.

mr.kalikut