Mobile Train SpeedoMeter - Model Train Forum - the complete model train resource
Model Train Forum - the complete model train resource

Go Back   Model Train Forum - the complete model train resource > Model Train Workshop > Technical Model Train Forum
Forgotten your password?

Technical Model Train Forum Discussion on advanced technical aspects.


Reply
 
Thread Tools Display Modes
Old 01-11-2017, 03:05 AM   #1
wvgca
Dispatcher
 
wvgca's Avatar
 
Join Date: Jan 2013
Location: yorkton, sask
Posts: 1,770
Scales Modeled: HO 1890's mountain logging "Squirrel Creek"
Images: 45
Canada Mobile Train SpeedoMeter

Suggested by another member, slightly different than the stationary speedometer ..
Anyways, Arduino Nano with a non latching Hall Effect sensor triggered by a wheelset mounted 2mm x 1mm rare earth magnet [or super magnet] ..
I used the OH360U sensor , active low .with a single trigger magnet ..
The code [as current] displays both mph and kph, and is coded for a 33" wheel, readily changes to a 36" if end user requires..and is not scale dependant ..except for physical room to mount the electronics...
The display shows speed [including tenths] below 10 mph / kph, and whole numbers above that ..
Currently the display being used [and coded for], is a standard 1602 /I2C, but will be replaced with a two digit seven segment when they come in ..just for easier viewing at longer distances ..
Results show to both display and Aruino IDE serial monitor as currently coded..
Hard parts are the nano, I2c display, sensor, one magnet & one resistor ...
For installation in a boxcar or similar .. other parts would be power pickup trucks, a small capacitor fr possible power interruptions, a bridge, and a voltage regulator ..ideally for DCC or AC / DC voltages consistently over 10V ..
I'm waiting for the larger displays before I build myself one..
If anyone wants the code, I can post it..
__________________
Warren's layout photos..>>> https://plus.google.com/photos/10301...64158873113617
wvgca is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 01-11-2017, 08:20 AM   #2
jlc41
Engineer
 
Join Date: Feb 2016
Location: New Jersey
Posts: 654
Scales Modeled: HO
Images: 8
Thanks for the information. I will at some time get to it. My grand son is always asking me how fast the trains are running.
jlc41 is offline   Reply With Quote
Old 01-11-2017, 10:15 PM   #3
wvgca
Dispatcher
 
wvgca's Avatar
 
Join Date: Jan 2013
Location: yorkton, sask
Posts: 1,770
Scales Modeled: HO 1890's mountain logging "Squirrel Creek"
Images: 45
A few images of this project, and the code, currently for 1602 lcd with I2C iterface

tsm1.png

tsm2.png

tsm3.png

train_speedo_Mobile_I2C_1602_LCD.ino.txt
__________________
Warren's layout photos..>>> https://plus.google.com/photos/10301...64158873113617
wvgca is offline   Reply With Quote
 
Old 01-12-2017, 07:36 AM   #4
RT_Coker
Conductor
 
Join Date: Dec 2012
Location: Tennessee
Posts: 455
Great Idea! Here is another way the approach to the design for anybody that might be interested.

The Bluno Beetle board could be used with just a battery, on/off switch and tachometer sensor. The display would be a hand-held Adriano-thing with a slightly modified “Bluno Basic Demo” App.
Bob
Attached Images
File Type: jpg Beetle.jpg (34.3 KB, 60 views)
RT_Coker is offline   Reply With Quote
Old 01-12-2017, 08:30 AM   #5
wvgca
Dispatcher
 
wvgca's Avatar
 
Join Date: Jan 2013
Location: yorkton, sask
Posts: 1,770
Scales Modeled: HO 1890's mountain logging "Squirrel Creek"
Images: 45
Quote:
Originally Posted by RT_Coker View Post
Great Idea! Here is another way the approach to the design for anybody that might be interested.

The Bluno Beetle board could be used with just a battery, on/off switch and tachometer sensor. The display would be a hand-held Adriano-thing with a slightly modified “Bluno Basic Demo” App.
Bob
Yes, a good alternative, especially for those wanting a remote display,
__________________
Warren's layout photos..>>> https://plus.google.com/photos/10301...64158873113617
wvgca is offline   Reply With Quote
Old 01-12-2017, 02:48 PM   #6
crusader27529
Hobo
 
Join Date: Apr 2016
Location: Sneads Ferry, NC
Posts: 28
USA

Here are some photos of my current project....it's in pre-production stage, but alkmost ready.....

It still needs tweaking of the packaging, and the obvious size issues are because my home-made PCBs are single sided, and to put all this together, I need access from the 'wrong' side of the PCBs to make the solder connections.....that causes the connectors to be significantly LONGER than those that will be used eventually.

The display shows MPH & KPH, and on the second line shows average speed and odometer in scale miles:

[IMG][/IMG]

[IMG][/IMG]

[IMG][/IMG]

[IMG][/IMG]

You can plainly see the magnets around the wheel and the hall effect sensor mounted on the power pickup truck.
crusader27529 is offline   Reply With Quote
Old 01-12-2017, 04:03 PM   #7
Lemonhawk
Dispatcher
 
Join Date: Sep 2013
Location: Palm Harbor, FL
Posts: 1,078
Scales Modeled: HO
You're computer mouse tracks motion, so why not use something like a laser mouse to determine speed and distance, no special connections and would work in no/low light.
Lemonhawk is offline   Reply With Quote
Old 01-12-2017, 04:34 PM   #8
gunrunnerjohn
Admin
 
gunrunnerjohn's Avatar
 
Join Date: Nov 2010
Location: SE-PA, USA
Posts: 33,534
Scales Modeled: O-gauge 3-rail
Images: 3
I'm guessing any mouse mechanism would have a real problem with the irregular surface of the roadbed between the rails.

I do have a question, do you really need that many magnets? Wouldn't one or two give you sufficient accuracy?

BTW, have you looked at OSH Park for prototype PCB? It's my "go to" place for small quantities of PC boards.
__________________
MTH ASC Certified Tech, Henning's Trains, North Penn O-Gaugers, Member TCA
My YouTube Channel

Looking to enhance your TMCC Steamers and Passenger Cars?
Super-Chuffer, Chuff-Generator, LED Passenger Car Lighting Kit, LED Lighting Regulator
YLB - RailSounds Battery Replacement, Insulated Track Signal Driver Board
gunrunnerjohn is offline   Reply With Quote
Old 01-12-2017, 05:07 PM   #9
wvgca
Dispatcher
 
wvgca's Avatar
 
Join Date: Jan 2013
Location: yorkton, sask
Posts: 1,770
Scales Modeled: HO 1890's mountain logging "Squirrel Creek"
Images: 45
I went a slightly different approach on mine, just the sensor on the truck, no pcb, three wires up .. and no pcb for the nano ..three wires to sensor , and four to the current I2C display ..
I still prefer 7segment displays for visibility, but am currently trying double height numbers using both lines for the digits ..
I assume that you are running averaging on the speed, if the magnets are even 10 thou out of the correct angle, it will change the speed reading constantly..

The blue display does have nicer contrast than the yellow ones that I have
__________________
Warren's layout photos..>>> https://plus.google.com/photos/10301...64158873113617
wvgca is offline   Reply With Quote
Old 01-12-2017, 05:11 PM   #10
crusader27529
Hobo
 
Join Date: Apr 2016
Location: Sneads Ferry, NC
Posts: 28
Quote:
Originally Posted by gunrunnerjohn View Post
I'm guessing any mouse mechanism would have a real problem with the irregular surface of the roadbed between the rails.

I do have a question, do you really need that many magnets? Wouldn't one or two give you sufficient accuracy?

BTW, have you looked at OSH Park for prototype PCB? It's my "go to" place for small quantities of PC boards.
I'm retired and 'poor', plus sort of cheap.....final prototypes and probably initial 'production' will have the boards made professionally. For now, homemade is fine, and I'm quite good at it. I use laser transfer to copper clad PCB, and I can make a PCB in an hour, depending on how many holes I need to drill. The only real problem I have with the homemade stuff is that the copper is nowhere near as robust as a professionally made part....I can lift the traces much too easily, but that's a tradeoff I can live with for now.

The code averages the timings of all the magnet detections primarily because motion start and stop are not accurate at all.

The code also does NOT use a simple detection of the magnet to trigger each part of the timing.....the initial detection presets the logic, and when the magnet detection goes away, that action is the trigger.

All that really requires more than one magnet, and actually, the more magnets yield better accuracy...I use 5, which yields 4 timings.

I agree on your assesment of the mouse HW for movement detection, as the focus distance is critical, PLUS the HW would need to decode what the mouse HW was sending...it send a pulse train which isn't simplistic.
crusader27529 is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


» Visit These Sites:
LGB World

Or Our European Train Website ModelRailForum




All times are GMT -5. The time now is 03:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.