How to use 12VDC Relay Module with Arduino

preview_player
Показать описание

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

Thanks mate, it was very difficult to find the answers to my questions about 12v relay modules and arduino, but this video had the solutions :)

ronnyrobertson
Автор

This has been the best explanation and tutorial I have seen in many days of searching...
But I am running into a problem.
When I connect my setup like this (I am using a WEMOS D1 R2 (looks like the Arduino Uno style board), and I seem to only be able to turn off my relay if I manually move the data pin from D2 which I was trying to use, to a ground on the board.

I have everything else in the wiring setup like you have, but I am using a S8050 D-331 NPN transistor instead (its what I had on-hand).
If I touch the D2 pin's wire (coming from the D1 board) to the base of the S8050 D-331, and the data IN on the 12V relay (same exact look as what u have -- I compared #'s on top), my 12V relay switches to the ON position. If I touch both the D2 pin (my chosen data pin) and the IN on the 12V relay together, the relay switches also.

So I think I might need the other type of transistor, as the bottom of my relay says "Low Level Trigger". I suspect that's why it works when I connect it to ground pins.
I am having so much trouble finding out what I am doing wrong, as I have been trying this 12V model relay and I have tried 5V models w/o success. I just tried the 5V relay (does not say low level trigger) and it does not seem to react whatsoever, unless once again I just take the data pin and connect it straight to a ground.

Getting a damn relay to work should not be more difficult that programming the code that it's going to use, and yet it's much more difficult to fig out.
I have built CO2 sensors and temp sensors that utilize MQTT and WiFi... yet I cant get a stupid relay working. It's so beat.

-ColorMehJewish-
Автор

really helpful dude, i try so many times with relay 12V cannot work normally

Teknisi_otak_atik
Автор

the transistor solution help me to solving my relay issue, thank you

md.emranhossain
Автор

I wondered why my 12v relay doesnt work with arudino. Thanks for the explanation

kezif
Автор

thanks a lot, its give me answer after i destroyed 1 esp due to short circuit 😩

ilham
Автор

I also use an Arduino Uno and a 12V relay module. And for some reasons, I can still control the relay module without a transistor 😅

setoku
Автор

Hi passion, why is the collector pin not connected to anything? I thought you need voltage from collector pin to generate current from collector to emitter.

MeanderingMonkey
Автор

This is a nice video.
I had a doubt, what exactly is the NPN transistor doing so that the solenoid is 5 seconds ON and 5 seconds OFF?

adityavenkateshwaran
Автор

It work thanks, but i use a module 4 relay 12v and the transistor make all the relay become one relay

majdizamiti
Автор

Whats the specific model of BC547 you use?...i tried BC547 B 080..it wont work

juliusferrer
Автор

But some relay modules have transistors on the board, or doesnt yours have because on my board i can see a j3y transistor SMD

DodoTheCreator
Автор

If I used a 5v relay instead of the 12v relay, I wouldn't need a transistor, right?

joescopo
Автор

Would the circuit be the same if you use a 24v power source and a 24v relay?

oliveradriel
Автор

I use 2n2222, i connect the data to emmiter and collector to in, and it works strangely 🤣

m.fadhiilhaekal
Автор

I’m trying to do it on a raspberry pi 4. What do you suggest? Can I have the code and circuit diagram of the project that you have done ?

prajeetbohara
Автор

Its not working with esp boards. Its always low in the esp board no matter what you do. Can you explain whats the problem

arindumroy
Автор

i have a question why we used a transistor what is he role of this transistor in this case

hemahema
Автор

I have arduino uno r3, 12v relay module and 12v dc water pump, and 12v dc supply but the pump is not running

pavankumarnarala
Автор

I have the same problem with NODEMCU ESP8266 and i try your solution but not working😟

majdizamiti