How to use an Arduino Relay Module

preview_player
Показать описание
Arduino relay circuit and Arduino relay code:
In this video we’ll learn how to use a SainSmart 4-Channel 5V relay module with an Arduino. We also discuss the SainSmart relay board’s capability, its use of optocouplers for optoisolation, and how to hook up the Arduino relay circuit. We use the Arduino to switch a light on and off, demonstrating the relay’s ability to control high voltage loads with an Arduino.

Where you can buy the tools and materials:

Links:

More on Optocouplers

More on Wiring Relays:
Рекомендации по теме
Комментарии
Автор

As an electrician I suggest you consider using low voltage examples. The method you used to strip and terminate the cables is dangerous at best and potentially deadly for people less familiar with electricity. exposed wiring is an accident waiting to happen

mjneil
Автор

Can someone help me? I need to control 4 relay with a 4 axys joystick. On position 1 of the joystick, 3 relay need to be on. On position 2, 2 relay need to be on. On position 3, 2 relay beed to be on. On position 4, one relay need to be on. Those relay will control some hydrolic valve...

ericlessard
Автор

I was going to comment about the AC wiring, but what's the point? He's probably already dead.

jmscnny
Автор

It's recommended that just in front of the pinMode command, you make the pin high with a digitalWrite. That way, the pin will never be accidentally randomly low when it changes to output from the default of input: that could be catastrophic if it was say a motor or something that might activate accidentally in setup().

jimbrownza
Автор

Super useful, could not for the life of me figure out why the relays were energised when the arduino outpu was set to low! Wish i had found this video before i spent the past few hours trying to figure out what i did wrong! Thanks!

briantoste
Автор

Why does the relay need 2 VCC's'? One VCC is coming from the BB PS and then you connected 5V from Uno? Why is that? Cheers

Mat-vber
Автор

At 1:02 why do you remove the jumper? Can it be used without the jumper? Does removing the jumper pose any risks?

ekanshdeepgupta
Автор

2:06 that edit hurt haha, thanks for the video though, helped me get mine up and running. CAREFULLY, but its working.

editorialbrain
Автор

Nice video... but dude, buy some wire strippers XD

gordonbrown
Автор

Thank you for posting this. I would love to see a follow up video with the Arduino controlling a relay based on input to the Arduino. In other words if I press one button the relay would be activated for one second. If I press a second button the relay would be activated for 10 seconds and if I press a third button the relay would stay activated unless a separate signal told Relay to shut off.

I am trying to control an AC motor that will raise a platform to various heights.

Shibu
Автор

Is the surge protector necessary for this setup to work?

nathanjohnson
Автор

Can I use this method to connect esp32 board? [Esp32 provides 3.3v ]

AshiqurRahman
Автор

The idea and the code are great.... BUT SERIOUSLY
If anyone follows your technique they are putting themselves at very high risk of:
o Getting an ELECTRIC SHOCK from the AC supply
o Slicing their fingers open with that knife

Firstly – NEVER EVER allow that much copper to be exposed at the relay terminals. The chances are the wires will make contact causing a spark or even fire.

Second – allowing that much exposed copper open someone up to inadvertently touch it.

The wire should be stripped back with wire strippers (not a knife) and only a little copper showing on the TIP of each end of the cut wire. (Far better to use bootlace crimps to reduce risk) insert into relay output screw terminals with wire installation hard against outside of terminal block

Third the knife… arrgh like others have stated get a set of wire strippers why run the risk

Fringedweller
Автор

Can you explain how to connect the high voltage circuit? I want a 12V circuit: for the load, on the output side. + goes to NC, - goes to com, but where to wire up the input + and - wires from the 12V battery?

rubenvaneupen
Автор

Why do I need to provide 5V to the VCC port from the arduino if you are already providing it in the isolated channel?

zColdEli
Автор

I don't get when you say "digital pin 3" in 1:55 but in your code 3:15 the digital pin is equal 2

MrSpock-smdd
Автор

Can you convert these modules into a solid state relay by switching out the relay with with a mosfet?

azimalif
Автор

Can I use two 3.7V lithium ion (18650) batteries to connect to the JDVCC pin to get opto isolated circuit?

raj_srikar
Автор

even though i never used high voltage, i would not recomment leaving the wires exposed. just in case sombody tryied to do it, but greatvideo anyways! :)

azazer
Автор

As pointed out by many, the stripping of the Hot wire was done poorly and, the naked wires fairly dangerous although it's just the Hot wire and not very dangerous since not touching the ground or eart, but what if a student tries this standing barefooted on a damp concrete floor and the electricity was earthed ! Otherwise nice job explaining the function and usage of a Relay. Thanks.

cym.