Tiniest Control Board Fits Inside An N-Gauge Model Train

[kodera2t] discovered the VL53L0X Time of Flight sensor and thought it would make a great way to control the operation of a model train without touching it. He explains it in his own words in the demo video.

The sensor was small enough for an N-gauge train, which translates to 1:148 scale or about 9mm from rail to rail. His idea was to build a tiny control board that could fit inside the locomotive: 10mm by 40mm. His board consists of the ToF sensor, an ATMega328P-MMH, USB-serial, and a Texas Instruments DRV8830 motor driver. he powers the board via the 6V running through the track.

Right now [kodera2t]’s using the ToF as sort of a gestural controller to get the train to start rolling, but one could imagine the sensor could be incorporated into more advanced programming, like having the train speed up on straightaways and slow down on a curve, based on the height of the bridge over it.

We’ve published a bunch of [kodera2t]’s tiny circuit board projects here on Hackaday, including the smallest basic computer, his minimal frequency counter, and his VFD amplifier.


18 thoughts on “Tiniest Control Board Fits Inside An N-Gauge Model Train

  1. Cute! If you put the ToF sensor on the front of the train, you could use it to prevent trains from colliding with each other, and could establish a safe following distance, perhaps?

    Or make it follow your finger around the track, for example, at a fixed distance. And if your finger gets too close (i.e. approaches the train), start reversing ;-)

    1. When I read the first few lines, that’s what I was expecting it to be (automatic collision avoidance/following) rather than as a human control interface.

      If you wanted to augment it even further, one could add RFID (maybe a barcode depending upon the space) under the tracks as a way to determine what the track type was ahead (such as corners, stations, straights, crossings, etc) and automatically adjust the speed as appropriate.

  2. I remember when digital control systems for model trains costed hundreds of dollars… I never bought any such things, and just relied on good old stock standard DC speed controllers…

    I’m realizing that with the right boards, you could probably add digital controls to each train for a few bucks a piece. These days, you could probably just control it all by WiFi or something.

  3. The official N-gauge is NOT 1:148, it’s 1:160. It’s a bit like H0 where some manufacturers make 1:100 models instead of 1:87.

    And if you want tiny, why add a huge (what look like) mini-USB socket and even a USB-Serial chip… I mean, it takes half the board…

    1. Actually 1:148 is an ‘official’ n gauge scale, it just isn’t the one used where you happen to live. I know it’s hard, but please try not to forget that there are other countries on this planet.

  4. My first foray into electronics as a kid was for model railroading. I was going to build an analog command control system using crystals to select the locomotive, similar to a far more expensive analog system called DYNATROL. The intent was to use the crystals as a filter for the frequencies being broadcast down the rails.

    I never got the funds to build it and frankly knowing what I know now, I can see it would not have worked. Would have blown those crystals. But I learned a lot about electronics with that :-)

  5. Good to see a SiLabs CP2102 part on that board. Is SiLabs (Silicon Laboratories) the last U.S. chip company that hasn’t been “bought-out”? I like what SiLabs does, especially when it comes to timing/clock-distribution.

    1. Errm, don’t think so. By ‘bought out’ do you mean owned by a company outside the us? If so then I think Ti, linear, Maxim, microchip, atmel, Fairchild, Intel, amd… might have something to say!

      1. Several of those have been bought out…

        Microchip owns Atmel. ON Semiconductor owns Fairchild. Analog owns Linear.

        I *think* the others are still their own companies…

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.