logo elektroda
logo elektroda
X
logo elektroda

ESP32 + TASMOTA + relay module - no response

008 3807 9
Best answers

How can I get a Tasmota-configured ESP32 to control a relay module when the relay clicks only when I connect the signal wire manually, but not from the web interface?

Power this relay module from 3.3V instead of 5V on this ESP32 setup, because that solved the problem and made the relay respond correctly [#21128794] ESP32 GPIO uses 3.3V logic, so a relay board that expects 5V may not switch properly without a level-shifting circuit [#20857690][#20857775] Also, VIN on an ESP32 dev board is the board’s supply/input rail, not automatically the right control voltage for the relay board, so it’s worth measuring the relay module’s VCC and IN1 voltages directly while GPIO26 is high and low [#20858699][#20857940][#20858650] The fact that the relay clicked only when the signal pin was physically connected pointed to a wiring/voltage mismatch rather than a Tasmota template name issue [#20858749]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
This content has been translated flag-pl » flag-en View the original version here
  • Relay module likely needs active-low drive

    #1 20857513
    008
    Level 7  
    Posts: 61
    Rate: 6

    As per topic. I'm trying to make a relay module on an ESP32 with TASMOTA software uploaded.

    I've tried various configurations but the relay doesn't respond to the state change signal. I hear a click when I connect the signal pin (brown cable), but when I click the switch from the web interface nothing happens.

    I have the signal pin connected to GPIO 26
    In the module connected to In1

    Red Vcc -> VIN
    Black Gnd -> Gnd

    In the Template tab in the TASMOTA settings GPIO26 is set to Relay. I also tried the settings Relay_and Relay_b as well as Relay_bi but it doesn't change anything.

    Anybody knows how to make this work and what the number means with the GPIO setting?

    The relay module was labeled for the Arduino but I hoped it didn't matter much but something feels like it won't work.

    ESP32 connected to a relay module and Tasmota interface .
    Attachments:
    • ESP32 + TASMOTA + relay module - no response esp.png (893.16 KB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #2 20857690
    urkotrebor
    Level 21  
    Posts: 335
    Help: 37
    Rate: 81
    The ESP32 operates at 3.3V and these relays need 5V , another thing is that you probably broke the ESP32 because it was loaded with too much current .
    You need a circuit that will adjust the ESP output to the relay operating parameters .
    GPIO are the pin designations of the ESP connectors .
  • #3 20857715
    008
    Level 7  
    Posts: 61
    Rate: 6

    How can the ESP32 run on 3.3 when it is powered from a USB port which is 5V? I've been using it with this power supply for 3 years and somehow it works.
  • ADVERTISEMENT
  • #5 20857775
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #6 20857940
    xury
    Automation specialist
    Posts: 7078
    Help: 878
    Rate: 1495
    The relays are on 5V. The question is what is the name of the pin from which the relay board is powered. There are different ones. In some where the red wire is plugged in there is an IN that goes through the diode to the stabiliser, and in some there is 5V which is directly connected to +5V from the USB.
  • VIN has 5 V but relay still does not click

    #7 20858650
    008
    Level 7  
    Posts: 61
    Rate: 6

    According to what is written on the ESP32 forum, if the board is supplied with 5V then that voltage should also be present on the VIN pin, which is the one I have connected the relay to. The status change signal reaches the board because the blue LED flashes when the MQTT transmission is active, but the relay does not respond - I do not hear a click. It only clicks when I connect the pin.

    https://esp32.com/viewtopic.php?t=11904

    Forum screenshot discussing ESP32 and 5V power supply. .
  • ADVERTISEMENT
  • Measure relay VCC and GPIO input voltages

    #8 20858699
    Anonymous
    Level 1  
  • Relay input stays high and won’t release

    #9 20858749
    008
    Level 7  
    Posts: 61
    Rate: 6

    Okay if I set the used pin 26 (D26) to Relay_i then on VIN and IN1 I have the following voltages:

    1.6V - if the virtual switch in the interface is in OFF state
    4.9V - if the virtual switch in the interface is in ON state

    The relay when the IN1 pin is connected clicks (closes) but there is no response when I try to turn it off.


    Screenshot showing GPIO pin configuration in the interface.

    User interface with ON button and additional configuration options.
    .
  • #10 21128794
    008
    Level 7  
    Posts: 61
    Rate: 6
    If anyone had a similar problem with this module, the problem is solved by connecting it to 3.3V instead of the 5V the vendor says it requires to work.

Topic summary

✨ The discussion revolves around issues faced when connecting a relay module to an ESP32 using TASMOTA software. The user reports that the relay does not respond to commands from the web interface despite hearing a click when the signal pin is manually connected. Various configurations were attempted, including setting GPIO 26 to different relay modes. Responses highlight that the ESP32 operates at 3.3V while the relay requires 5V, suggesting potential voltage mismatches. Users recommend checking the voltage levels on the relay module's VCC and IN inputs during operation. A solution was proposed where connecting the relay to 3.3V instead of 5V resolved the issue.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT