I have a modelrailroad track with 2 turnouts that are switched with 2 pairs of relays.
As soon as i connect the wiring for the turnouts, the arduino starts resetting at random, the spread is about 9 to 25 min.
When I leave the power for the turnouts disconnected the arduino runs without any resets for hours.
I use the onboard led to show a reset. In setup() it is turned ON, then i use a pushbutton to turn it OFF.
So after a reset the Led is on.
note: the relayboard is opticly decoupled from the arduino. It is wired accordingly.
the powersupplys have been replaced by others. Did not help.
Research showed i need a snubber over the contacts of each relays (not the coil).
I do not know how to calculate the values of the capacitor and resistor to put in series over the contacts.
Hi, Do these turnouts have two electromagnets; one for each direction of throw?? If so the current flows only one direction in each magnet and you can use a reverse silicon diode to absorb the transient voltages when they are switched OFF.
And SOLDER your wires to it, and plug it into the UNO, the leads and connectors you are using are good for prototyping but not for final use.
Laying your wiring out will help as well.
What is the current rating of both of your 5V power supplies.
Terry's suggestion will certainly help.
You circuit diagram needs to include the point solenoid coils.
With wires that long I would be bypassing all the digital inputs that you are using, with 0.1uF capacitors.
No i can switch the turnouts automatic once every minute for about 9 to 25 minutes. Then it resets.
Then then it takes again 9 to 25 minutes before it resets again....and so on.
note: the relayboard is opticly decoupled from the arduino. It is wired accordingly.
Make sure there's no GND connection from the relay board to the Arduino or to the GND of Arduino's supply. The GNDs of both 5V power supplies should not be connected together at any point. The 14V power supply ground should not be connected to any other supply GND.
Research showed i need a snubber over the contacts of each relays (not the coil).
I wouldn't worry about arc suppression across the relay contacts at this point. Should have flyback diodes installed across the electromagnets.
All the Commons of the relays are tied together to 14V+.
each relays-pair drives 2 electromagnets per turnout.
Like this? (1 relay - electromagnet pair and flyback diodes shown)
The bundle on the right hand side is worrying.
All your relay output wiring should go STRAIGHT out from the relay terminals.
All your relay input wiring should go STRAIGHT into the relay terminals.
What do the two relays on the right do.
What does the multicore cable do that is in the bottom left hand corner, what signals go through that?
What is your Points Power Supply, AC or DC? Edit, re-read post #1
When activating a point, do you just pulse the coil, or does it need constant operation to stay in position?
If you leave points power connected, but point coils disconnected what happens?
Can you please post a copy of your complete circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
(Please include all gnds and power supplies, I know its a pain, but we need to see how that whole system is connected)
johnrevier:
I do not know how to calculate the values of the capacitor and resistor to put in series over the contacts.
The power that gets switched is about 14V-DC
RC snubber is for AC inductive loads and you have to know the inductance of the load and frequency of
the AC to figure out appropriate values.
What kind of DC load are you switching from that 14V DC? If its not inductive no problem. If its inductive
a free-wheel diode may be all you need, and it goes across the load, not across the relay.
If you cannot get to add a diode across the load a snubber is the next best approach, but you still want to know the inductance being switched.
The 14V-DC that gets switched are coils for "turnouts" or "points" -motors for a model railroad.
So there is a inductive load. Diodes are already ordered
I'm having the same problem switching a water pump. The arduino mega only resets when the relay is connected to the pump. Doesn't do it when it is connected to other devices (like a light) or when disconnected completely. Only when connected to the pump. It's an AC pump and I don't understand enough about SNUBBING to start changing what I already have. Help would be very, very much appreciated.