constructing electronics for semaphore signal?

This forum is dedicated to Riding Scale Railroading with propulsion using other than steam (Hydraulics, diesel engines, gas engines, electric motors, hybrid etc.)

Moderator: Harold_V

User avatar
PRR5406
Posts: 873
Joined: Wed Oct 07, 2009 7:12 pm
Location: Eastern Maine

Re: constructing electronics for semaphore signal?

Post by PRR5406 »

Partially constructed hardware for semaphore.
Partially constructed hardware for semaphore.
Just to update everyone, this is some of the hardware we've constructed. These are oversize for 1/8th scale, but the thought is to make them apparent to the engineer operator. The spectacle is 1/8th steel, the lens holes are 3/4" cut with Harbor Freight hole saw and plenty of cutting oil. I used my wife's glass cutting tools to cut and grind the lenses, then epoxied them into the holes. The blade is aluminum sign material. I used small machine screws and nuts to put the gizmo together. I am planning to use a plastic conduit joiner box to house this assembly. Note, nothing has been cut to fit as of yet. I have cut a lever which will be placed behind the semaphore blade and sandwiched between nuts using LocTite. If the assembly requires counter-weighting, I'll deal with it. The other end of the lever is slotted and rides along a screw which has been welded to the longer or connecting nut which rides the threaded shaft. In theory As the threaded rod turns, the connecting nut will travel up or down the threads, thereby lifting or dropping the semaphore blade.

My buddy, Jim Ash, is a computer whiz-bang and also somewhat mechanically disposed. He has obtained a Chinese knock-off Arduino and related components, as well as a stepper motor, and YES! has programed them to cooperate and turn according to software instructions.

Will the assembly work when put together? That remains to be seen, but it's a fun experiment and it'll teach us what's possible or how to correct what doesn't work.

Stay tuned to this station.
Attachments
20220111_095641.jpg
IMG_2691.JPG
"Always stopping my train, and risking my ankles, with American made, New Balance sneakers."
User avatar
PRR5406
Posts: 873
Joined: Wed Oct 07, 2009 7:12 pm
Location: Eastern Maine

Re: constructing electronics for semaphore signal?

Post by PRR5406 »

Yes, it's a semaphore, a bit oversize, but something to signal clear track ahead on my outdoor layout. Some images, including my genius friend, Jim Ash. The metal work and hardware are mine, the electronics are all Jim's. The little black transistor thingy is a Hall effect sensor. When a magnet comes near, it acts as a switch with no moving parts. The motion and limits for go (green), slow (amber), and stop (red) are all controlled by an Arduino stand-alone computer chip. Jim is versed in C++ language, so he is writing a rather extensive code beyond what we have here. At present, it finds home, green, amber, and red. What it will do is find green, then glide down to red. After perhaps 70 seconds or so, it will glide up to amber, pause, and glide up to green once more. For our purposes, I think it will be sexy, but then sexy is in the eyes of the beholder. The layout isn't very sophisticated, but this adds another aspect of fun to the operation since semaphores are too cool for words. Pennsy position lights are also very cool.

https://drive.google.com/drive/folders/ ... sp=sharing

Commentary is welcome, of course.
"Always stopping my train, and risking my ankles, with American made, New Balance sneakers."
DRS_RR
Posts: 46
Joined: Sat Mar 21, 2009 10:21 pm
Location: Owasso, OK

Re: constructing electronics for semaphore signal?

Post by DRS_RR »

very cool, it looks good! I've been using some Arduino's on my N scale layout for sounds and gate operation and thought about using them to operate some signals on my small 7.5" gauge backyard railroad by using the RF transmitter/receivers so I wouldn't need to run a bunch of wires. Just run each signal off a battery, and could easily keep them in the garage out of the elements when not in use. Being a small railroad signals not really required, but as you mentioned adds to the cool factor and ambiance. Be nice to see the Arduino Sketch if Jim was interested in sharing it when he's done. Not that I already don't have a huge list of projects to be done on the railroad, but hey what's one more to the list for future ideas :)

Dave
OddDuck
Posts: 434
Joined: Fri Dec 16, 2011 1:00 am
Location: Somewhere south of Mt. Katahdin
Contact:

Re: constructing electronics for semaphore signal?

Post by OddDuck »

Just to add to the fun, when I saw this I decided to make a scale spectacle for PRR5406. Just because. Sometimes I get an idea stuck in my head and have to get it out. I had the materials on hand, too, which is always nice.
It's not exactly made to a particular scale, I'm guessing 1/4 scale or smaller?
So, took a few hours, a piece of thin plywood, my bandsaw and some elbow grease and Voila! One semaphore spectacle pattern. Did a test cast today and it came out pretty nice. I have to do a little more work on the pattern, it didn't pull cleanly in a few spots. And here it is...
Attachments
IMG_20220311_141331134~2.jpg
IMG_20220311_141338114~2.jpg
"If you took the bones out they wouldn't be crunchy!" -Monty Python's Flying Circus
User avatar
PRR5406
Posts: 873
Joined: Wed Oct 07, 2009 7:12 pm
Location: Eastern Maine

Re: constructing electronics for semaphore signal?

Post by PRR5406 »

It will be a few weeks before the final Arduino code is written, but I imagine Jim will share whatever he develops. My layout still requires a few lengths of track to complete the loop. Ballast will have to go down once the lawn dries out, so there's lots of time ahead. The semaphore is designed to come indoors if the weather goes poorly, and come out when operating sessions are planned.

Pete, the aluminum spectacle is a great size to dress up my train shed or the mailbox. I love to see ideas spring forth!
"Always stopping my train, and risking my ankles, with American made, New Balance sneakers."
ashcan
Posts: 2
Joined: Mon Jan 18, 2010 10:54 pm
Location: Whitefield, NH

Re: constructing electronics for semaphore signal?

Post by ashcan »

Details for those so inclined:

Design criteria:
1. Cheap (inexpensive, hopefully not in quality)
2. Simple
3. Rugged (Dick's place is a 3 1/2 hour drive for me. I can't be there every time this thing takes a powder.)
4. Cheap

I'm sure there's a couple more implied but not stated.

I moved the whole shebang from an Arduino Uno for initial development to a Pro-mini clone I got from ebay for just under $5 each. I may move it to a stand-alone ATMega328P on a custom circuit board, but I'm more inclined to just put the Pro-mini in a socket so it's interchangeable if the smoke gets out of the wires.

In its current form, the brains gets its inputs from a push button and two hall-effect sensors. The outputs are the motor and an LED to signal a system fault (for which I'll probably just use the on-board LED in the final form). With the exception of the button, the rest of it will all be contained in the main assembly. It would be easy to rig an opto-isolator for the button, but we're still working on the basic prototype. I might be more inclined if I could find one with a Schmitt trigger built in. I've left the power supply as a problem for Dick, but I'll probably knock the 12vdc (give or take) for the motor down to the low-current 5v I need for the logic with a little buck converter to prevent needing two separate supplies externally.

The system has no idea where it is when it first powers up. The logic is set up to go find 'home', which is effectively a hall-effect sensor placed just beyond the green position like a limit switch, and a magnet stuck to the traveling nut. With the neodymium magnets we're using, the sensor fires when the magnet is within about half an inch, so we can compensate for crudeness of the system and a host of other evils by bending the leads on the sensor a little, adjusting the flag position wrt the lever, and fooling with software. This totally avoids the hassles of having to deal with accurate mechanical mounting and adjustments with microswitches.

The units of position are steps wrt the home position. The motor is a 200 steps/rev unit and the driver board is rigged for whole steps. So for example, green could end up being 400, yellow 2500, and red 4500; I'll come up with the final numbers once it's all together. I created a sketch to send it home from where ever it is and report how many steps it took to get back there. For example, if I tell it to go to yellow at 2500, then home again, it's been reporting back 2500 +/- about 5 (usually within 3), which was a pleasant surprise. Given the crudeness and looseness of the system, skipped steps, and a bunch of other other unknowns, I was expecting a whole lot worse. Take the win. That said, I've had a concern that the system would drift as it cycles back and forth from use, so I've designed it with another hall-effect sensor between the yellow and green positions to re-calibrate the position as it goes by, functioning like a phase locked loop (in the sense of machining, it will only do it in one direction, to minimize gear lash). Given the apparent repeatability of the system, I'm tempted to skip the calibration sensor completely and just have it briefly go home when it's sent to green every 5 or 6 cycles for re-calibration; green is so close to home, it would barely be noticeable. I haven't made up my mind on that one yet.

I built a bit of a fail-safe into the code in case it doesn't hear from the home sensor in time. It will only attempt a prescribed number of steps when attempting to find home. If the home sensor doesn't fire and we hit the step limit, the system will signal a fault and shut down. This motor has some goose to it even at 12 volts, so if it were to just keep going, things could get broken or bent. A few times during testing, I ran the wrong sketch or with the wrong value and it tried to run off the end of the earth, in both directions. More than once, I scrambled to disconnect the 12v supply to shut it down, but sometimes not before it managed to attempt some unnatural acts first. It wasn't pretty. Once the code is completed, it shouldn't (the programmer's last words) go off the deep end on the high side, only the low side, and this fault limit should cover that.

I left the assembly at Dicks place last week, so I need some basic stuff to complete the software; I could do it, but it would be a lot more challenging without it. I have everything but the motor to put together another mock-up with an old piece of wood like is shown in the photos. Amazon Santa Claus shows one out for delivery today, so the completion of the software will mostly be subject to how much time I can put into it and how annoying Dick is this week.
User avatar
PRR5406
Posts: 873
Joined: Wed Oct 07, 2009 7:12 pm
Location: Eastern Maine

Re: constructing electronics for semaphore signal?

Post by PRR5406 »

Annoying? You cut me,sir!
"Always stopping my train, and risking my ankles, with American made, New Balance sneakers."
Post Reply