Run a HO scale model train from track power

I am trying to make a Model Railway train base board - this is not DCC.
This board would receive transmissions from a handheld device via 43 mhz.
(The handheld is completed on breadboard).

  • The train wheels pick up the power from the rail tracks which is normally 12v 2amp. it would power the L298n IC - where I am having some issue is how do I power the Nano from here - do I need to use a DC-DC converter or would a MOSFET do.
    or
    can i run the nano on 12v thru VIN.

Any help/ suggestions would be appreciated.

It is a bad idea to run 12V into Vin. The on board 5V regulator is not heat sinked so will provide limited current before it over heats and shuts down. The best is to use a 12V to 5V DC-DC converter (step down or buck converter) and connect that to the 5V pin of the Nano.

1 Like

is that contact of good quality? may be you'll need also a capacitor in front of the step down converter to deal with bumps into the current flow

Correct. And only limited current will be required in this case.

I would build your first prototype using the Nano's built-in regulator (Vin) and measure for yourself how much current is drawn from the 12V and find out whether the Nano's regulator gets hot. You will need to do this on the workbench so you can monitor the circuit. Warm is ok. But if it's too hot to hold your finger on, then you need to consider the buck regulator suggestion instead.

I would also consider a more modern and efficient motor driver. L298n is old and inefficient and will generate quite a lot of heat.

Seldomly. Intermittent contact now and then is to be expected.
Your advice about a quite large bulk capacitor is perfect. A serial resistor of some 10 ohm, before the cap, would help to keep cut downs, from the power supply, away.

Ok can you suggest what kind/size.
Would I also need on on the power out pins to the motors. Space is limited in height.

Thanks will out one in

As space is a issue what motor driver would you suggest. I have looked online and cannot figure it out.
I will test the voltage for the nano using vin.
The power throttle is on a encoder, nano so I could go down a bit on voltages.

One which comfortably exceeds the stall current of your motors.

The voltage will be 12V, you already told us that. The question was what will the current be? If you are not confident about the difference between voltage and current then you are not ready to attempt this project.

I should clarify something. I agree with @groundFungus. Generally this is a bad idea... unless you understand the limitations of the Nano's regulator and the demand your circuit will make on it. Based on your schematic (which needs improvement, by the way) I think the regulator will be ok, but should be tested carefully.

Pololu carries some pretty small (0.4" x 0.5", 0.6" x 0.8"). Like has been said, look for one that can comfortably provide the motor stall current, breifly and running current continuously and is rated for the motor supply voltage.

Avoid, please, the ancient technology L293 and L298 drivers.

Suggestions would be welcome - I am just starting to learn this process - diagrams are better for me to understand.

If I did it right the current reads .69 on 11.22 v - the readings are taken from the track.

Thank you I will take another look.

You would have to find how bad power loss can get and have a large enough capacitor to provide enough energy for the arduino not to reboot during this time. Trial and error I guess… (or measure how much current is needed say for 100ms and size the cap for that hoping you’ll never loose power for more than 100ms)

would this be what I should be looking at : A4990 Dual Motor Driver Carrier
item # 2137

Bravo, finally someone likes diagrams! Made my day! Even though you are not using DCC, you should look at some locomotive decoder designs - your project has so many things in common, and you could learn from 25+ years of ideas.

1 Like

Have you posted the stall current of your motor(s)? Without knowing that it is impossible to recommend a driver.

The linked driver has a 1A current limit.

Just my 2 cents: Lima trainset did the same thing (the rails supply the current). I didn't have Lima but perhaps somebody does.

Before DCC in North America, there was the "Chubb" system invented by, I think, Bruce Chubb. It worked with analog tones sent over the rails, similar to DTMF.

If it's only for speed control, why bother with all the extras and simply pwm the supply to the rails.