I have 6 9V RainBird latching solenoid valves and I would like to control each one (open close one at the time) using my mkr 1010. I have only the very basics of electronics so this is why I am asking for guidance, I have no problem with the coding part.
I have read multiple threads on here about the same topic and I tried to apply what I learned although I still have some questions about the feasibility of my solution. Below is the scheme of what I'm trying, I apologize for the mess, please imagine a longer relay module capable of connecting to the 6 valves:
A brief explanation of my thought process is the following:
External li-po battery for the arduino
9V battery powering each valve/relay
Use the arduino's 5V output pin to power the relay
Use the GPIO pins to send a pulse to trigger the valve latching to turn on and off
With this I have several questions:
Should I use a power bank and power the arduino via usb to get the 5V?
I have read different opinions on how to connect the arduino to the relay module, in my case i'm connecting the 5V out to the relay module's VCC and GND to arduino's GND. I have also read about removing the jumper from VCC JDVCC and connecting it differently, what would you suggest?
Assuming I use the current schematic do I need a freewheel diode between each valve and the relay?
Looking at the picture You have more trouble then coding.
Put that 9 volt battery back where it belongs, in a fire alarm.
Maybe using 6 x AA will work.
The controller is not a powersupply so no 5 volt powering the relay coils.
Try it. It might work. Some P B shuts off if there is too little current flowing.
Let the relay be powered by the 9 volt line, not controller 5 volt.
Thank you for your inputs, I agree on changing the 9v battery for 6x AA batteries and also that the arduino shouldn't power the relay module VCC, I just had no other idea how. But i'm still a bit confused, the AA batteries should connect to each relay's com port but what then you say that should also power the relay module's VCC? Or do you mean have the 9V (or AAs batteries) powering the VCC? If yes then do I need a voltage regulator assuming this is a 5V relay module?
Yes it could happen but this system will be installed in a place of easy and frequent access, there's also an "upstream" manual valve for the pipe that feeds into this system if anything goes wrong.
From what I understand from latching solenoids, they only take energy to open and close, this system will only actuate the valve once each day at most.
@caan
You can use the 9V battery for the valves, it should last a long time
However, you will want to use a MOSFET switch board instead of the relay board
EDIT: This board is better