Hello!
I have this project where I have 2 solenoid valves powered by a 12Vdc power supply and I want to control them with an arduino nano supplied by that same 12Vdc and a relay. I also added some 1N4001 Flyback diodes to the valves, but I am having a problem. Once I connect the 12Vdc power supply the valves open at the same time during 5 seconds and close during 5 seconds as programmed but as time passes the valves open and close faster and faster until I have to disconnect them, this happens in less than a minute. If I power the arduino and the valves from different power supplies this does not happen but I would like to use only the 12Vdc if possible, how can i solve this problem?
Here is a picture and the code I am using:
If you are powering the Nano with 12V through the VIN pin then pulling relay current through the 5 volt regulator, it may be overheating and causing resets.
The relay module needs a separate 5 volt supply.
Yes but make sure it's wired correctly, remove the Vcc - JDVcc jumper, separate 5V+ to JD-Vcc pin, separate 5V- to GND on relay board, no connection from Arduino GND to relay.
Ok, it is not working I guess there is something wrong with the wiring. Here is a picture of the wiring on the relay module and a schematic of the wiring right now.
I forgot to conect it, but just did it. But now it opens and closes the really 2 times and then stops. The difference I have is the GND of the arduino is also connected to the GND of the relays through the Step down converter...