Using an Arduino to Detect a Short Circuit

Hello All,

I am new here, but I've been working with arduinos for a few years now. I use them on my model railroad and I am trying to figure out how to use an arduino as a switch for a reversing loop. A reversing loop reverses the direction of travel by sending a train in half circle and back on the same track, but without a special reversing loop module, the train causes a short circuit because the polarity of the track switches halfway through the loop.

I'm going to use relays to switch the polarity when the short occurs, but I do not have a way to detect the short circuit and trigger the relays. Is this possible?

I assume the special reversing module has it's own built-in logic so it "knows" all of the conditions and doesn't do something "bad"?

If you have multiple engines and you just want to reverse one section of track, the track sections need to have their own relays do they can be controlled separately.

If a short doesn't kill/damage the power supply, you can simply monitor for an "unusual" drop in voltage when there's a short.

...Otherwise you're essentially measuring resistance... Generally, a DMM measures resistance by supplying a (small) known current and measuring voltage (then "calculating" resistance with Ohm's Law).

It's easy if there's no voltage (other than the what your "meter" is supplying) and no train, because all you need is a power supply through a (series) current limiting resistor. You'll get full-voltage with an open circuit and no voltage with a short.

A couple of things make it difficult...

  • If there's a train you have to measure the difference between low resistance (the train motor) and very-low resistance (a short).

  • If there's voltage applied, you'd have to measure current (and the voltage). i.e. You can't use your DMM to measure resistance when the circuit-under-test is powered-up.

  • Making a constant current source isn't "easy".

  • Measuring current isn't "easy". There are current-measuring modules (Hall effect devices), or you can try to measure a (small) voltage drop across a small resistance.

  • The Arduino can only measure positive voltages and it measures relative to the Arduino ground. That makes it tricky to measure reversed voltage, and it means any "current-measuring" resistor has to be on the ground-side of the power supply.

but without a special reversing loop module, the train causes a short circuit because the polarity of the track switches halfway through the loop.

No it doesn't! The break is on each branch at the points ("switch"). You switch the polarity to the track according to which way the points are set. You must change the polarity on the main line anyway, which again would depend on the setting of the points.

If you wish to automate this, the points and the polarity of the main track are set by sensors shortly inside the reversing loop.

Not sure what this has to do with an Arduino though ..

The name of the subject line is not correct for the question on this thread

You should be able to make a siding where the train pulls off the siding
Once off the main track, you can isolate the siding by moving both points to the siding.

If you use one set of points only [as the connections for power] , and only ever have one set on at a time, then you can use the points to control the voltage.

One end is always open.

that way, the voltage and polarity is based on what points are closed.
if you have a mechanical link on the two sets of points, then you can never have them both closed at the same time.