ESP 32 Connect 5V Relay via Logic Level Converter (ESP32)

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ค. 2024
  • ESP 32 is a wifi and bluetooth integrated very powerful chip manufactured by Espressif.
    This video shows how to use a logic converter to use this chip with a 5v relay.
    5V relay needs 5V input, sometimes it works with 3.3 but this is unstable and can not guarantee that it will work always. This video show a stable and proper way to drive 5V relay with ESP 32. ESP 32 has 3.3 v output from its pins.
    Detailed information about ESP 32: www.espressif.com/en/products...
    0:00:50 - Drawing / wrong way to connect relay (Common mistake)
    0:01:45 - How to connect 5V relay in a wrong way
    0:04:14 - Drawing / correct way to connect relay (with Logic Level Converter)
    0:05:50 - How to connect 5V relay with logic level converter
    To buy ESP32: www.amazon.com/ESP32/s?k=ESP32
    To buy 5V relay: www.amazon.com/HiLetgo-Channe...
    To buy Logic Level Converter: www.amazon.com/FTCBlock-3-3V-...
    Here is the very basic blinking code for Arduino to program ESP32
    // the setup function runs once when you press reset or power the board
    void setup() {
    // initialize digital pin LED_BUILTIN as an output.
    pinMode(26, OUTPUT);
    }
    // the loop function runs over and over again forever
    void loop() {
    digitalWrite(26, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(1000); // wait for a second
    digitalWrite(26, LOW); // turn the LED off by making the voltage LOW
    delay(1000); // wait for a second
    }

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

  • @jamesdean8110
    @jamesdean8110 3 ปีที่แล้ว +3

    Great demonstration showing two relays of the same type and how "temperamental" the relays can behave. Excellent solution to the problem too, the logic level converter !!! thanks,

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      Thank you James. happy to hear that

  • @PatrickRankin
    @PatrickRankin 3 ปีที่แล้ว +3

    Sound is way better! Thank you so much, exactly the info I was looking for.

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      Thank you for your comments and support 👍

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

    Your video just saved me from going nuts, thank you.

    • @techinfo5824
      @techinfo5824  11 หลายเดือนก่อน

      It is the best statement i heard today :) Thank tou

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

    ......detailed explanation...hope more vdeos to come....

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      Thank you Elmer. I will continue as well as I finished my thesis.

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

    Thank you for sharing this video.

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

      I am happy to hear that. Enjoy and thank you

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

    Thank you. Very clear and very helpful.

    • @techinfo5824
      @techinfo5824  11 หลายเดือนก่อน

      Thank you Tom🙏

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

    You are the best! Thank You!!!

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

      Thank you for your kind comment! Always welcome

  • @alexiz.7569
    @alexiz.7569 ปีที่แล้ว

    This channels needs more respect! The guy is out here helping everyone through feedback in the comment section. 🤙Thank you from everyone TechInfo

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

      That is really a honor for me to hear that! Thank you my friend, thank you🙏

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

    What happens when you power this circuit with a 3.3 volt battery? Your serial is carrying 5 volt already is it not?

    • @techinfo5824
      @techinfo5824  6 หลายเดือนก่อน

      If you power with 3.3 volt, trigger signal becomes 3.3 as maximum and it is not enough to drive relay

  • @timmiyg5894
    @timmiyg5894 4 หลายเดือนก่อน

    Are you missing the GND on the level shifter board?

  • @ekdilipkumar
    @ekdilipkumar 4 หลายเดือนก่อน

    The best thing is use the VIN of the esp32 and it provides 5v output, to control the relay use the logic to 0 to turn on.. This way it worked for me..

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

      Can you explain how to do it?

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

    If I power my relay module with external 5v power. And connect just the data pin eith esp32 ...
    Will my esp 32 burn?

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

      No. Most important part is not applying power to esp pins

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

    Hi thank you for this tutorial. I have a logic level converter which has TXO and RXI to TX1 and RX0, is this the same wiring? Also is it possible to control a 4 channel relay like this?

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      Thank you. Same wiring yes. But here are the points for your situation; RXI -- High voltage input to voltage divider from high-voltage device. Signal will be shifted down and sent to low-voltage device on "RXO" pin.
      RXO -- Low voltage output from voltage divider to low-voltage device. Signal is shifted down from "RXI" input.
      TXI -- Low voltage input/output of MOSFET circuit. This pin interacts with "TXO" on the high side. Bi-directional, but this is the only shifter that will shift from low to high.
      TXO -- High voltage input/output of MOSFET circuit. This pin interacts with "TXI" on the low side. Bi-directional, but this is the only shifter that will shift from low to high. To send a signal from the low-voltage side to the high-voltage side (e.g. from 3.3V to 5V), the signal must be input at "TXI". It'll pass through the converter and come out as a higher voltage on the "TXO" (transmit output) pin.

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      And yes you can control a 4 channel relay with this way. If you can share exact model type of your LLC i can help you to wire it

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

      @@techinfo5824 Hi thanks for your answer! In the end I decided to get a 4 channel bi directional converter and that works great!

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      Marlot Meyer great !

  • @lycorecokawaiii
    @lycorecokawaiii 10 หลายเดือนก่อน +1

    Thankyou for the information. Just my esp32 board doesn't have 5v output and only 3v3. Does that 5v really required? or I can just connect 3v3 to the LLC and output as 5v? does it work like that or I'm completely wrong?
    Currently I need to connect esp32 to the peristaltic motor through 5v Relay. But I can't seem to make the relay activate at all, it just flickering light of led with low intensity. So really wonder how to make this work or I should just use external power source.

    • @techinfo5824
      @techinfo5824  8 หลายเดือนก่อน

      Hello, 5v is just for provide input to esp and llc, on pin output side you do not need 5v, 3.3 volt triggers llc to provide a 5v output

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

    Any suggestions on if I make a custom ESP32 board without 5v connection. How should I supply the 5v to the relay?

    • @techinfo5824
      @techinfo5824  2 ปีที่แล้ว

      You need 5V for relay, that is mandatory. So you can apply 5V to circuit as main power input and use a 5v to 3.3 v regulator for esp power input.

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

      Or you can use 3.3 v relay like this one 3V Relay Power Switch Board, Icstation 1 Channel Optocoupler Module Opto Isolation High Level Trigger for IOT ESP8266 Development Board (Pack of 5) www.amazon.com/dp/B01M0E6SQM/ref=cm_sw_r_cp_api_glt_fabc_BJRVXPQQB2MP0HMXHSQX?_encoding=UTF8&psc=1

  • @Oh-ou4lp
    @Oh-ou4lp 3 ปีที่แล้ว +1

    so how do you connect more then one relay, say 4 and external power to realy with out kill esp32, not sure how to sink 5v to ground with out hurt esp32, looking for way to make all on but save esp32 from death, very good demo for one:D

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      J Be Hello J, you can use same technique but this time use an external power supply as 5V and use common ground

  • @bbogdanmircea
    @bbogdanmircea 3 ปีที่แล้ว

    Hello, can you help why 4 Relay module with Optocoupler is causing the ESP32 not to connect to Wifi if ESP32 is booting and the relay module is connected? If I disconnected the VCC from the VIN of the ESP32, then then ESP32 will boot ok, and then I connect VCC and I can control all 4 relays without any level converter. I also tried to provide VCC and GND to the relay board from external 5V but still the ESP32 does not connect to WiFi and does not communicate. I use pins 14,27,26,25. Of course I can buy a level converter but I think it will not help as the relays are triggering ok only starting with the relay module connected is not possible.

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

      Hello. Sometimes pin 14 generates some problem while initializing wifi. Firs please try with no connection to pin14. (just connect 3 channel). If it works change pin 14 with another one. (Maybe 26). If that works I will explain technical details of that problem.

    • @bbogdanmircea
      @bbogdanmircea 3 ปีที่แล้ว

      @@techinfo5824 Ok initially I had 12 14 27 26 then I read that with 12 high it will not boot so I moved to the right with 1 pin, ok I will let also 14 free and hopefully it is ok. Thanks for the advice!

    • @techinfo5824
      @techinfo5824  3 ปีที่แล้ว

      Please inform me 👍

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

    Hai sir, Can i use this module to detect high frequency of square wave having amplitude 5v?

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

      Hello, sorry for late answer. This module just gives output 0 or 5 volt by measuring threshold (around 2.6 volt). By using this logic you can try to solve your problem , but it is related to your frequency value

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

      @@techinfo5824 Thanks for replying.... I got my hands on one of these modules and it worked fine for me.I wanted to detect frequency output from an arduino nano using an esp32.

  • @aljoharaha6116
    @aljoharaha6116 3 ปีที่แล้ว

    Hi, I currently working on my graduation project and i faced some problem with pH sensor with esp8266, its need 5v and the esp has 3v, can u please help me? I really will appreciate it. :(

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

    I liked it but wished you'd have run code and turned on something. Still Thanks

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

      Good idea. I will update it. Thanks

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

    türkmüsün lan

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

      Bence Türk :)

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

      ​@@memetseyhanbencede aksanından çok belli oluyor