Help with 9V Latching Valve Circuit

Hi everyone,

I’m working on an irrigation system using a D1 Mini and 9V latching solenoid valves. The setup uses two relays to reverse the polarity (like an H-bridge) and a 4-way solid-state relay board to trigger individual valves.

Everything is controlled through ESPHome. I can see +9V and -9V correctly at the valve terminals when triggering the switches, but when I connect the actual valve, it doesn’t work properly, and the 9V battery gets hot. It seems like the valve is being powered even when it’s not supposed to.

I’ve attached a schematic showing my current setup.

Has anyone experienced something similar or have any advice?
This is the code instead: esphome: name: irrigazione-terrazzo friendly_name: irrigazione_terrazzo - Pastebin.com
Thanks!

Just give a pulse from 1 or 2sec. the valve will be open until you give a pulse “close”

You should test your circuit without SSR.
Do you have some evidence that your SSR can switch DC?

this is the valve I’m using:
Claber 9 V Valve
Usually latch valves just need a pulse.

They always just want a short pulse.

I also tried replacing the solid-state relays with mechanical relays, but the behavior was the same. If I connect the valve directly to the 9V battery (momentarily), it switches as expected.

Not likely. Both can be wired incorrectly and cause failure though…
You didn’t answer the question, do you have AC SSR or DC SSR? (quite likely AC)

Sorry, I’ve missed your question before.
This is the one I’m using: https://it.aliexpress.com/item/1005004446755656.html?spm=a2g0o.order_list.order_list_main.5.66f43696Ega7mD&gatewayAdapt=glo2ita

There’s no way you can use that on your circuit.

Is this just because is an DC AC? Should I replace them with mechanical then?
Everything else in the schematic is correct?

Try this, working for me: https://es.aliexpress.com/item/1005007219197315.html

AC SSR can’t be used for DC load. DC SSR can’t be used with polarity swap.
You can use mechanical relays. Or 2-ch motor driver board.
I’m not able to follow your breadboard “schematic”. Especially with incorrect components.
Even hand drawn diagram would be much better.

This would be ok for two <1A solenoids:
https://aliexpress.com/item/1005005973846875.html

I’ve replaced the SSR relay with a mechanical one, but it still doesn’t work.

Using the same circuit and a mechanical relay, I was able to open and close the latching valve once, but the next 4 attempts failed — the valve didn’t activate at all.

I’m still trying to figure out if the issue is with the relay timing, contact bounce, or maybe battery current limitations. I’m using a 9V battery and a pair of relays configured as an H-bridge to reverse polarity.

Any advice or tested schematics for controlling latching valves with mechanical relays would be really appreciated.

The circuit is more than simple and you don’t need 3 relays for that.
But your description smells like you don’t have the relays input setup correctly.
Is the jumper removed? Feel free to post what specific relay module you have and how it’s powered/triggered.

Why not? Two relays are used to switch the voltage provided to the pump from positive to negative in order to close the valve.
This is the relay I’m using attached to the 9v battery:


I have another module to drive the pump like in the schema above.
I didn’t removed the jumper.

Remove the jumper.
Connect 5V to JD-VCC and GND to GND.
On the other header connect 3.3V to VCC and GPIO to IN.

Set inverted: true

switch:
  - platform: gpio
    id: my_relay
    pin: 
      number: #your gpio
      inverted: true

Prefer gpio4 and 5 for relay trigger.

Your solenoid can be connected like this (DC+/- to battery):

Thanks for the suggestion.
I will check if the valve is working now with that configuration :kissing_smiling_eyes:

Attention not to connect 5V to VCC.