Skip to main content

A few months ago while reading about programming I found a forum posting on Arduino uses.

I now want to try that program which somehow measures and displays the train speed. I can't find it now.                              Can anyone point me to that posting?

I'm slow, but I'm getting there..

Thanks,

Attachments

Images (3)
  • IMG_7420
  • IMG_7420
  • IMG_7412
Original Post

Replies sorted oldest to newest

The following link describes a project to control the speed of a conventional train.

https://ogrforum.com/topic/spe...-conventional-trains

The first part of the project describes a speed sensor car that measures the speed of a train anywhere on the track and transmits the information via blue tooth to a base unit. This speed information is then used to control the track voltage to maintain a constant speed.

For testing the train speed was displayed on the Arduino video display. A different base unit could be built to display the speed of the train from anywhere on the layout.

John,

Yes, original poster deleted the Gerbers & 3D files.

Didn't catch that when I posted the YouTube link.

Here are the files I originally downloaded from the Blog.

Tom

Attachments

@gunrunnerjohn

@Bobot

John,

Hope this helps.

Tom

Screen:  https://amzn.to/2OubMmj

From Bobot:

Pretty much as written on the board and seen in the photos: Arduino Nano v3, (2) 150-ohm ¼-watt resistors, (2) 100K-ohm ¼-watt resistors, a 47uF electrolytic capacitor, a surface mount DC power barrel jack, an 8-pin and 4-pin header, and this LED display https://amzn.to/2OubMmj Solder/wire it up, load the Arduino sketch found here: https://allthingsbobot.com/model-railroading/model-railroad-speedo-part1/ and cross fingers and pray.
IR sensors: https://amzn.to/36RQRQA Yeah, the billboard was a cool project to design and print. Thanks for watching!
Last edited by TomNe
@TomNe posted:

@gunrunnerjohn

I used these IR sensors for my build.

I actually found the ones he specified, turns out after searching the number that they are a common part.  I knew I could use something else, but I figured why reinvent the wheel if it was already working.  The question of speed comes up enough that I thought this would be a fun little accessory to have.

Wow!

I asked a question that has generated much interest and I've learned so much. So far the advice has been great and has got me thinking in different directions, especially providing the ability to monitor continuous speed readouts. Magnets on a wheel, I'd never thought of that.

Thanks to Tom's link and advice and a couple of days ago Bobot replied with the info I sort of remember seeing a while back. That concept and coding is what I need for now. Wish I had a 3D printer and his multiple skills. I do have a friend that is excited about helping me though.

With Gunrunnerjohn's ideas of parts available, I've got a running start.

So, "Katy bar the doors!

Thank You all

Bob

Step #1 is finished.  I ordered the display and fired off a print for the 3D parts overnight.  They came out just fine.  I may reprint the support base for the display with finer layers, it has more lines than I like.  Of course, it does pass the 2-foot rule, looks great from two feet away.

Track Speed Meter 3D Prints

I already have the Arduino Nano boards, so I just have to wait for the PCB's and sensors to come in and I can stick this thing together.

Attachments

Images (1)
  • Track Speed Meter 3D Prints

This is cool and I wouldn't mind having one myself.  The only disadvantage is that it only measures speed at one point in time, in one place.

Many years ago a company called Kansas Junction made and sold a kit, including a custom circuit, to build a "speedometer car."  You had to supply your own boxcar.  The kit included a circuit board with an LCD display and an IC mounted on it.  You had to add a wooden dowel to the car axle, and wrap it with a tach tape (supplied), so that an optical reader could count black-and-white stripes through a hole you made in the car's chassis.  You also had to make a mount for the display out of styrene.  The whole thing was powered by a 9V battery mounted inside the car.

It works great, although battery life isn't great, and from some angles the LCD can be a little hard to read.  Obviously you can't view it when the train is in a tunnel, etc.!  The cardinal advantage of putting the speedometer in a train car, is that it lets you measure the train's speed all the way around the loop and note the degree of variation, for example when the train transitions from straight to curved track or encounters a grade, etc.  I don't know how many were made, but these Kansas Junction kits are now very hard to find.

If you're only interested in performance testing, there's a more common and perhaps easier-to-use alternative: a Lionel steam RailSounds 1.0 box car!  These use a Hall-effect sensor to measure track speed.  Every time the speed drops below about 6 mph, the synchronized "chuff" changes to a hiss and release of air.  If a train can get around a loop repeating the air release sound and NOT chuffing, that would represent an outstanding performance!  But if it's chuffing along slowly, and then abruptly changes to the steam release sound when it enters a curve, then the motor/gearing isn't making enough torque to maintain speed in the face of the increased friction.  (Note:  All of the testing I did with this setup was in the mid-to-late 1990s, on tight tinplate curves and before the advent of speed control.  Only a few of the many locos I tested were able to get all the way around my loop at less than 6 mph.  Fun times!)

I personally think it's going to be a cool addition.  It's as much for the fun of having it pop up the speed of the passing train as it is actually doing performance testing. Of course, since virtually all my stuff has cruise control, I'm not all that worked up about measuring speed continuously.  My speed variations are very small all around, including grades and curves.

As far as the speed sensing car, it would have been trivial to add a track power option, I don't know why you'd feel stuck with batteries.

Gunrunnerjohn, I'm not familiar with how to add a track power option to the cars. Can I retrofit a flatbed or other car with collectors so I can power an Arduino and other electronics? Parts available?

I want to pursue the continuous speed monitoring path and don't want to use batteries.

I like what you've done to mount the display. No 3D printer but I am a woodworker and plan to make the sign with some nice wood. Also plan to make my own tunnel entrance surrounds from some nice wood.

I got the following error when I compiled the sketch:

C:\Users\The Jacksons\Documents\Arduino\O_Scale_Speedometer\O_Scale_Speedometer.ino:23:10: fatal error: Adafruit_LEDBackpack.h: No such file or directory
#include "Adafruit_LEDBackpack.h"
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: Adafruit_LEDBackpack.h: No such file or directory

Wish I could help Scott. But, that is what my buddy handles. (When he's available..)

When it comes to programming, Guess I'm not very useful.

I'll be glad to share what we've done after we get the rest of the programming done and the bugs worked out. We'll likely use the referenced Arduino program with stationary photo eyes first then go for the dynamic speed monitoring after.

@gunrunnerjohn

John,

You may already have this library loaded in your Arduino IDE program.  It is a common library used for control IC2 device interfaces.

Wire



Description

This library allows you to communicate with I2C devices, a feature that is present on all Arduino boards. I2C is a very common protocol, primarly used for reading/sending data to/from external I2C components. To learn more, visit this article for Arduino & I2C.

Tom

Add Reply

Post
×
×
×
×
Link copied to your clipboard.
×
×