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)
Siren:
Control unit:
Wiring:
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:
Code:
switch:
- platform: gpio
pin:
number: 4
inverted: true
id: siren_relay
name: "Siren"
icon: "mdi:alarm-light"
- platform: gpio
pin:
number: 14
inverted: true
id: siren_relay_backup
name: "Siren Backup"
icon: "mdi:alarm-light"
binary_sensor:
- platform: gpio
pin:
number: GPIO2
mode:
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
https://a.aliexpress.com/_mNVQwrw
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
https://a.aliexpress.com/_m09zXxe
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
https://a.aliexpress.com/_mt9hVpw
Plastic box: US $5.63 2% Off | 1pc Plastic Waterproof Enclosure Cover DIY Electronic Power Junction Box 158mmx90mmx45.6mm Project Instrument Case White
https://a.aliexpress.com/_mq1lTiU