Does this relay switch have a flyback diode?

Wait wait. I need 12V for the solenoid valve/pump. I need 5V for the arduino, for the relay switch, and for 4 more sensors attached to the Arduino. I didn't want to have two power suppliers for the box, so I got a 12V power supply, connect the 12V to the pump, and then buck down to 5V for everything else.

Was this not a good way to go?

The Nano can run from 12V since all it is doing is determining when to actuate a relay - and outputting that "control signal".

Is the "buck converter" output connected to Nano 5V ?

If I was doing this project, if I were to use a relay board, I figure I would do it this way --
image

In actuality, I would use a transistor - not a relay board.

I was strongly advised AGAINST having 12V going into Vin, as the Arduino Mini's regulator would likely get really hot really quickly.

Really hot depends on the current draw from it.

You could do it this way (I note your failure to post wiring diagrams) --


and pick off 5V from the "buck" for 'sensors'.
Relays don't need regulated supplies (they should be operated with certain margins).

What is their voltage and current ratings? AC or DC?
Do you have kickback suppressors across them?

How do you know it's not a software problem.
Have you tested the program without the pump or solenoid?

12V DC. I have a 12V power supply and a buck converter to feed 5V to everything else.

No I don't have kickback suppressors -- I am readying an order though ..

I am a software engineer. Not a software problem. Out of caution, I ran the cycle with no delay for 280,000 times and it ran seemessly.

OK.

This is PRECISELY what I am doing!!!
And the thing crashes if opening and closing the relay (when attached to the pump) more every 200ms...

Merc.

Did you add the flyback diodes?

Not yet, I need to order them first.
Do I need the diodes though? The switch module I have already includes them.

For the coils of the relais, not for the pump and valve. Your powersupply is not resilien enough to take care of that. Oh, tke care of the direction of the diodes ...

That's what I SURMISED, thanks for the confirmation. It's not a great idea. The transient response of the "buck" may be less than phenomenal.
A separate 6V battery circuit could prove that out.

Is that with an "M.R.E." - a sketch that clicks the relay (and nothing else)?

That is correct.
The WORST part is... I called my wife to show her how the thing crashed. I tried with 200ms. No crash. I lowered to 100. No crash (while shortening the lifespan of my poor solenoid valve...). Then tried with 20ms. It roared happily for a minute, till it finally stopped.

Weird.

What are coils?

Since you were so helpful, I fished out an old schema of the circuit I created in Fritzing... and here it is, the updated version. It's only missing a sensor, but the gist is there.

Where would you put the diodes? And where the capacitors?

Please note that I DO know that powering things with digital outputs is not great. but those things draw basically nothing, and must only be turned on while used (which made writing the software... "interesting").

Give it a try. If you do not connect the motor to the Arduino 12V on Vin would be fine. Be sure to watch the regulator temperature for a while when first starting. You could also look at a solid state relay, they work great.

The diode on that relay module would be for the relay coil, not your load.

There is more to electricity than VOLTS, what about CURRENT (Amps), RESISTANCE (Ohms) and POWER (Watts)?