How to use 12VDC Relay Module with Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ค. 2022

ความคิดเห็น • 51

  • @ronnyrobertson629
    @ronnyrobertson629 ปีที่แล้ว +10

    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 :)

  • @-ColorMehJewish-
    @-ColorMehJewish- 9 หลายเดือนก่อน +3

    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.

  • @johncooper5769
    @johncooper5769 9 หลายเดือนก่อน +1

    thank you for the detail explanation

  • @rivqiiqbalmufassiri1593
    @rivqiiqbalmufassiri1593 7 หลายเดือนก่อน +2

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

  • @md.emranhossain8156
    @md.emranhossain8156 6 หลายเดือนก่อน +1

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

  • @DodoTheCreator
    @DodoTheCreator 8 หลายเดือนก่อน +2

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

  • @juliusferrer2071
    @juliusferrer2071 5 หลายเดือนก่อน +1

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

  • @prajeetbohara4816
    @prajeetbohara4816 8 วันที่ผ่านมา

    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 ?

  • @adityavenkateshwaran1913
    @adityavenkateshwaran1913 ปีที่แล้ว +2

    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?

    • @passiontechmmr7748
      @passiontechmmr7748  ปีที่แล้ว

      Transistor is semiconductor, imagine as simple switch which you make as on and off by using our hands but transistor is making on and off by using a small current instead of hand that is why they call semiconductor.NPN means need positive voltage to make on and off, PNP is need negative voltage to make on and off.I hope you get the answer.

    • @adityavenkateshwaran1913
      @adityavenkateshwaran1913 ปีที่แล้ว +1

      @@passiontechmmr7748 Thank you for thr explanation. Will try it out🔥

    • @boylarga3705
      @boylarga3705 2 หลายเดือนก่อน

      The program ina rduino was the one doing onnd off.

  • @ClerickDangatan-qj2sf
    @ClerickDangatan-qj2sf 8 หลายเดือนก่อน +1

    Avery helpful🎉🎉🎉

  • @sukhanchand1112
    @sukhanchand1112 10 หลายเดือนก่อน

    i want your help with a circuit that i am making

  • @MeanderingMonkey
    @MeanderingMonkey 9 หลายเดือนก่อน +2

    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.

    • @passiontechmmr7748
      @passiontechmmr7748  9 หลายเดือนก่อน

      Relay board is active low so it just need Edmitter to trigger on and off for stable voltage.

  • @majdizamiti
    @majdizamiti ปีที่แล้ว +2

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

  • @joescopo8933
    @joescopo8933 ปีที่แล้ว +2

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

    • @passiontechmmr7748
      @passiontechmmr7748  ปีที่แล้ว

      Yes...for 5V relay no need to use transistor.It work directly to trigger 5v.

  • @satoseitoku
    @satoseitoku 6 หลายเดือนก่อน +1

    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 😅

  • @pavankumarnarala177
    @pavankumarnarala177 ปีที่แล้ว +1

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

    • @passiontechmmr7748
      @passiontechmmr7748  ปีที่แล้ว

      Is it the pump not working or relay is not active?
      Actually this method should work if your components is all complete it should work well. Remember, to be able to active 12V relay board you must use NPN transistors otherwise relay will not active.

  • @labfab9633
    @labfab9633 9 หลายเดือนก่อน +1

    really helpful great

  • @pokfunglo7924
    @pokfunglo7924 ปีที่แล้ว +2

    what types of power supply do you use?

  • @oliveradriel196
    @oliveradriel196 9 หลายเดือนก่อน +1

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

    • @passiontechmmr7748
      @passiontechmmr7748  9 หลายเดือนก่อน

      Yes 24v use is the same circut.

    • @adrielvm2106
      @adrielvm2106 9 หลายเดือนก่อน +1

      @@passiontechmmr7748 What is the name of the gray component you use? Can I replace it with a 12 vdc geared motor that has a positive and a negative terminal?

    • @passiontechmmr7748
      @passiontechmmr7748  9 หลายเดือนก่อน

      @@adrielvm2106 instead of solenoid you can replace any appliances like DC motor or fan or lamp etc .

    • @adrielvm2106
      @adrielvm2106 9 หลายเดือนก่อน

      @@passiontechmmr7748 Is the signal from the relay to the emitter necessary for resistors to the transistor in this case?

  • @hemahema2999
    @hemahema2999 ปีที่แล้ว +1

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

    • @passiontechmmr7748
      @passiontechmmr7748  ปีที่แล้ว

      Transistor is semiconductor here we use as switch because Arduino Uno 5V can not trigger 12V relay so from Arduino Uno out put trigger to Transistor and from transistor output trigger to 12V relay board. I hope you clear it.

    • @hemahema2999
      @hemahema2999 ปีที่แล้ว +1

      @@passiontechmmr7748 thank you . one more question : in this case is it necessary to use transistor or we can use another semiconductor .
      + resistance should use with transistor or not
      and thank you for your efforts

    • @passiontechmmr7748
      @passiontechmmr7748  ปีที่แล้ว

      @@hemahema2999 as long as NPN transistors it wil work in this circuit.but only resistor will not work it.

  • @juliusferrer2071
    @juliusferrer2071 5 หลายเดือนก่อน

    why you dont show the full code

  • @m.fadhiilhaekal7693
    @m.fadhiilhaekal7693 ปีที่แล้ว +2

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

  • @rajeshghosh2192
    @rajeshghosh2192 3 หลายเดือนก่อน +1

    Thank you

  • @majdizamiti
    @majdizamiti ปีที่แล้ว +1

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

    • @passiontechmmr7748
      @passiontechmmr7748  ปีที่แล้ว

      Means , you can't control 12V relay board with Node Mcu esp8266 ?

    • @majdizamiti
      @majdizamiti ปีที่แล้ว

      @@passiontechmmr7748 yeah

  • @anonymousinfinido2540
    @anonymousinfinido2540 6 หลายเดือนก่อน +1

    Can I use a 12 V battery with this.

  • @beastscientist
    @beastscientist ปีที่แล้ว +2

    I just Fry my Arduino because of stupid 12v Relay module