The object of the exercise is to produce a train controller for a 3 year old, that only has one knob, but that limits (in software) both top speed and acceleration/deceleration. The theory being that the little hands of my Brother’s 3 year old nephew are unlikely to ruin his embarrasingly expensive trainset by either crashing a loco at full speed or mashing the gears by going from full ahead to full reverse in a split second.
What I did was wire up a simple motor shield using an H-bridge. If you know what that means, skip ahead. If not, read on. An H bridge is an arrangement of transistors (or other switching gidgets, such as relays) in an H shape. The transistors switch on and off in response to the Netduino’s very feak and weeble signal. The transistors work in diagonal pairs across the H shape, to allow you to reverse the power to the motor (or in this case, the train tracks) to reverse the direction of rotation (or locomotion).
![Home made motor shield on my Netduino](/images/netduinopwm/Home_made_motor_shield_netduino.jpg)
But it wasn’t enough to make my brother a train controller, I also had to send him a whole model railway, including a train. I needed something I could pack up small (tiny) for shipping, which meant n-gauge, but not too expensive, which doesn’t really mean n-gauge. God Bless Ebay! I was able to find the tightest radius N-gauge track in production and have it shipped specially from Japan Tomix C103-60 if you’re interested - I bought set 91080 “super mini oval layout set” but left out the straights. (You weren’t interested were you?)
I also found a miniscule little 0-4-0 train from Bachman. It’s an American design, but it’s also the shortest wheelbase train I could find. This thing would think twice before staring down a cockroach. Coupled with a couple of little trucks (which grumbled on the tight radius) and some comedy cargo I had a complete, self contained model railway, complete with power supply, controller (software re-programmable), track and rolling stock, and the whole lot fit into an old 3.5” hard disk box for shipping to the other end of the world.
![Tiny Bachman n-gauge 0-4-0 model steam train](/images/netduinopwm/tiny_n-gauge_model_train_bachman_0-4-0.jpg)
This is the entire trainset dismantled and ready for packing up. The whole lot was squeezed into an old 3.5” hard disk box.
![Netduino powered n-gauge train set dismantled](/images/netduinopwm/netduino_powered_train_set.jpg)
I’ll write up the electronics and software details in another post (including evidence of my super-human ability to make soldering look harder than it is).