A simple ethernet (wt32-eth01) based smart alarm siren

Hi there!

I just want to share my simple solution for a smart ethernet based siren.

  • Ethernet module: wt32-eth01 (with ESPHome)
  • Relay: 5V, two channel, low triggered (the second channel is functioning as a “backup” if the first one stuck)
  • Siren: 5V 120dB mini siren
  • Voltage divider for state reporting (green wire)


Control unit:

I have three power circuits (siren, relay and wt32) coming from an 5V power source. I supply the relay with 5V through JD VCC pin (i had to take out the jumper that originally connected JD VCC and VCC) and control it with 3v3 through wt32 (GPIO4 to IN1, GPIO14 to IN2, 3v3 to VCC, GND to GND).

I also added a parallel circuit for a voltage divider with two resistors (10K and 20K). The aim of the divider is to be able to check if the circuit of the siren is open or closed. I thought it’s a crucial part as some say these relays stick once in a while, so it seems useful if I can monitor the real state of the siren. As the siren is operating at 5V and 350mA, I had to reduce the current and voltage this way in order to be able to safely connect it to a pin on wt32 (GPIO2).

The relay has a strange wiring indeed. The main idea is that I use relay1 as the main control unit, but in rare cases when the state of the GPIO2 (siren state) differs than the relay state (so it stuck), I want to be able to control the siren via relay2. With this wiring if relay1 stops working and leaves the siren on, relay2 can close the circuit. If relay1 stuck closed, relay2 can intervene and open the circuit. Also when you can’t turn the siren with neither of the relays, it may imply that somebody cut the wires. You can check the wiring diagram here:


  - platform: gpio
      number: 4
      inverted: true
    id: siren_relay
    name: "Siren"
    icon: "mdi:alarm-light"

  - platform: gpio
      number: 14
      inverted: true
    id: siren_relay_backup
    name: "Siren Backup"
    icon: "mdi:alarm-light"

  - platform: gpio
      number: GPIO2
        input: true
        pulldown: true
    id: siren_status
    name: "Siren Status"

Source of components:

Wt32: US $13.04 34% Off | WT32-ETH01 Embedded Serial Port Networking Ethernet WIFI Combo Gateway MCU ESP32 Wireless Module WT32 ETH01

Relay: US $0.97 1% Off | Low Level Trigger Relay Module,5/12/24V,1/2/4/6/8/16 Channels,With Optocoupler Relay Output,Home Intelligent Control Module

Siren: US $3.00 5% Off | RedandBlack Mini Wired 72mm Cable 120dB Loudly Siren Horn for Home Security Sound Alarm System DC12V 24V 5V Protection for Home

Plastic box: US $5.63 2% Off | 1pc Plastic Waterproof Enclosure Cover DIY Electronic Power Junction Box 158mmx90mmx45.6mm Project Instrument Case White


Code? Wiring? Source of components?

I added more info


Thanks for the added info.