How to toogle/switch various 5V devices

I’m looking for a smart relay to toggle/switch various 5V devices like ESPs (which are in deadlock) or other electronics.

I tried several ESP8266 network relay Modules like this one: https://www.amazon.de/gp/product/B07DMZMZVK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
but they don’t switch, for example an ESP32. I think because of the low power they consume.

Any ideas?

This is not your issue.

Its a relay. The contacts are either connected or physically open circuit, there is no way at all for current to flow in this case. Anything connected to it will switch off.

More likely you have a wiring fault or are not powering the relay correctly. Do you hear it click when you activate it?

1 Like

That’s a schema of the wiring.
I don’t have to correct parts in fritzing, so please see the parts as placeholders.
ESP32 relay = link
NodeMCU = ESP32 5v

If I connect a 5V device (does not matter which device) on NO, I can switch the relay. The relay clicks and switch correct, but only for 1-2 seconds and then switch back to off.

If I connect the 5V device to NC, the behavior is as expected. The device is always on and if I send the switch signal, the power gets of.

If I change the 5V device to a normal 220v bulb, everything works fine, as expected.

Actually the advert says it is an esp8266.

In any event you don’t tell us what software you are running on that relay device.

I would suggest an ESP controlled relay unit that does NOT have the relay coil adjacent to the antenna

1 Like

Sorry, I’m using esp home with this relay

esphome:
  name: esp8266-relay
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "xxxxxx"
  password: "xxxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp8266-Relay Fallback Hotspot"
    password: "xxxxxx"

captive_portal:

uart:
  baud_rate: 9600
  tx_pin: GPIO1 
  rx_pin: GPIO3 


switch:
  - platform: template
    name: 'esp8266-relay Switch'
    turn_on_action:
      - uart.write: [0xA0, 0x01, 0x01, 0xA2]
    turn_off_action:
      - uart.write: [0xA0, 0x01, 0x00, 0xA1]
    optimistic: true

  
binary_sensor:
  - platform: status
    name: "esp8266-relay Status"

sensor:
  - platform: wifi_signal
    name: "esp8266-relay WiFi"
    update_interval: 60s
    
  - platform: uptime
    name: "esp8266-relay uptime"
    
text_sensor:
  - platform: wifi_info
    ip_address:
      name: "esp8266-relay IP"
    ssid:
      name: "esp8266-relay SSID"
    bssid:
      name: "esp8266-relay BSSID"    
  - platform: version
    name: "esp8266-relay Version"


# Enable logging
logger:
  baud_rate: 0
  level: VERBOSE

do you have a link to a device you would suggest?

Yes the relay has to be powered all the time, or it’s esphome firmware is not going to function.

Yes… My bad, I thought of it as a normal relay where the inputs are controlling the relay

Perhaps something like this:

It connects to an ESP or other device over I2C
Uses a small microcontroller to power a transistor that runs the relay
Note it will probably require up to 120ma to power the relay, so your ESP board needs to have that available on the 3.3v bus

1 Like

I have Esphome running on some of these to switch USB devices

1 Like

perfect, thanks!!

I bought similar Wi-Fi relays for another project, and they work completely fine as espected!
The difference is, that I flashed the new once with tasmota and not ESP-Home.

Works fine, switching another ESP : AZDelivery ESP8266-01S ESP-01S 5V

Dont work, switching back to “off” after a Second: ARCELI ESP8266 220V 10A DC 7-30 V

There can be many differences in board components on near identical looking ESP boards, especially in regards to the power supply. When the relay is powered by the board, there is a sudden spike in the power requirement to drive the coil, and if the board is not up to it, it can cause it to reboot.

Are you powering that ARCELI device with 12V power source? Or 5V like in the diagram? 5V is not enough…