Optical Occupancy Detection for Eastern Route Staging

Started by jbvb, May 04, 2025, 01:13:22 PM

Previous topic - Next topic

jbvb

Some information in this 2022 thread was made obsolete when Rob Paisley discontinued selling these particular detector cards. But I think his schematics and maybe circuit board art work can be found in archives, and there are other commercial products with similar functionality.  More generally relevant LED/detector issues are also discussed.

16-Jan-2022: My two long (~30 cars) staging tracks are about 60% hidden behind the backdrop. I made a window behind a building flat so operators could see their train before it reached (and maybe shorted) the gaps at the east switch. And I rigged up a turnout position indicator in the upper floors of the same building, using a relay driven by a contact on the twin coil switch machine. But I didn't draw the whole circuit, so it took me a while to figure out what I'd done four years ago.

I chose Rob Paisley's 8-phototransistor 'Inverting Photodetector' card. I ordered Orange and Purple LEDs from LED-Switch.com, so occupancy wouldn't be confused with signal aspects. And I chose a panel location where it could be seen from the south half of my attic. Here's the panel, masked and all but one hole drilled, ready for the final coat of paint:

IMGP4936_v1.JPG

David_J_Buchholz asked:
QuoteSo what does the card do? How does it work?

17-Jan-2022:  The Inverting Photodetector has 8 places to connect phototransistors. which conduct electricity when infrared or visible light shines on them. And it has 8 connections for LEDs, each of which turns on when its phototransistor is dark ("inverting"). It runs on 12 VDC. Rob Paisley's long description used to be online, but may be archived under www.circuitous.ca/8PhotoInverting.htm

desertdrover (Louis) commented:
QuoteNice choice, I had gone with the Circuitron BD-1 system years back. When you can't see where those trains are staged you need them.
The biggest challenge, as you know is having super perfect track, because you can't get to the trains easy without crawl spaces and other obstacles.

17-Jan-2022: I glanced at the BD-1, Louis; they have several features I don't need, and the lowest price I saw for a BD-1 is as much as Paisley's card with 8 independent sensors. The visible end of Saugus staging is easy to access. The rest is a hands-and-knees crawl with little headroom once behind the layout. The code 100 flextrack was laid more than 10 years ago and hasn't given trouble. Here's the schematic display panel in progress:

IMGP4938_v1.JPG

In this photo, the invisible railroad-east (towards Portsmouth) end is to the left. I need to show two things: First, where the train is relative to the left turnout:: Leftmost LED shows it's too close, the next LED's sensor is a foot from the first's. Second, at the center: where the ends of trains are so I can store two short trains on one long track. Again, the sensors are a foot apart.

IMGP4937_v1.JPG

I needed 9 wires from the Paisley card, so I used 24 GA solid for the cathode (positive) feed and old Cat 5 network cable for each LED's operate lead. Telco color code puts Blue first, then Orange, Green and Brown. All the occupancy LEDs are orange - purple was a bad purchasing decision as they need 3 VDC where the orange lights on 2 VDC.The two unwired LEDs will repeat existing turnout position LEDs, once I figure out and document how I wired the existing ones. The block at the right end will anchor the cables.

IMGP4934_v1.JPG

Two of the phototransistors Paisley supplies, ready to be pushed into holes between the rails and wired to the control board. As with the LEDs, there's one common line but this goes to the 12 VDC ground. I have one more 4-phototransistor harness to wire and install, then I can start hooking the components up.

18-Jan-2022: "First Light" was not the occupancy, but the switch position indicator repeater:

IMGP4939_v1.JPG

Narrow_Mark commented:
QuoteI like the set up. Also wondering if the now ready availability of webcam type devices means there's a video option to consider?
I had a temporary 50' LGB shuttle line set up with trains running from a staging area inside my garage through a tunnel opening crafted in a temporary plywood access door out to the street as a covid-distanced Halloween candy delivery system in 2020. Used a simple diode arrangement so that I could not overrun the end of the track out by the street and set up a web cam at that end which linked to a laptop inside the garage for me to monitor activity. Also had a buzzer set so that the kids could summon a train pulling a candy gondola. For what was very much a lash-up, it worked well. Just a thought.

19-Jan-2022: Video would give an overview and answer a range of questions, but I'd need two cameras, one for each critical point. There aren't good camera angles; the ceiling is too close..  And the farther the viewer is from the display, the larger it has to be. A signal light conveys simple information quickly and effectively from a distance, and these LEDs are visible from anywhere in the south half of my layout. Of course, I'll find out what my operators think once the current wave of contagion passes.
James

jbvb

24-Jan-2022: I'd gotten all the LEDs on the panel to light. The orange occupancy indications are enough brighter than the bi-polar red/green signal repeaters that the Red doesn't stand out. Both are fed from the same +/- 12VDC supply so first step is to see what dropping resistor Rob Paisley installed (his instructions show 1K ohm as typical). My red/green LEDs are using 470 ohm.

IMGP4940_v1.JPG

The next issue is making the occupancy lights go out. Eight resistors on the board set sensitivity, one per phototransistor. As shipped, the LEDs go out when I hold my CFL work light over the phototransistors. The rightmost sensors are indifferent to the 3-white-LED piece of light strip already mounted above them. Rob says 10K ohm is typical, I'll check what's actually there. Soldering is required because more sensitivity requires more resistance in this circuit...

The red 'ghosts' below the track are reflections of the pilot lights on the power supplies for 12VDC LED light strips that are part of my layout room lighting.

30-Jan-2022: I planned to illuminate each pair of sensors with a 3-LED snippet of some old 12 VDC LED light strip I was given. I was hoping to illuminate the right (east) pair with an existing light, but that wasn't effective. I just installed a second snippet and that's bright/direct enough to work with Rob P's as-shipped resistor values. Next step is to install the 2 left (west) light fixtures and their sensors. Finally, I have to either relocate the rightmost LED light strip or add another, better situated. Photos when I have time, today was a lot of snow removal and registering my cars, tomorrow is sorting tons of scrap in a foot or two of snow at Seashore Trolley Museum.

David_J_Buchholz asked:
QuoteAny chance of showing the actual installation pics rather than the panel?
 Also. Where did you end up locating the circuit board?

31-Jan-2022: The circuit board is screwed to an L-girder where it was relatively easy to reach and doesn't waste much wire. I could have saved a few more feet if I'd mounted it behind my spray booth, but not worth the complications working on it. I'll take some pictures behind the scenes when I return to working on it later this week.

3-Feb-2022: The whole detector setup is for track hidden behind a backdrop, so I have to supply light for the phototransistors to detect. Here's a picture of the first "light fixture" I built:

IMGP4942_v1.JPG

I cut the angle so it would clear the sloping ceiling of my attic. Weldwood contact cement attaches the LED strip to the wood block and the wood block to the Lauan plywood backdrop.

This one works fine. But when I tried re-mounting my older "see train through hole" LED light strip to better illuminate another pair of phototransistors, bad news. One phototransistor wouldn't detect its light at all, even if I held individual LEDs 1/4" above the phototransistor. The other one would admit the LEDs were 'light' but only when directly over the phototransistor. Both phototransistors accepted my CFL work light as actual light. So now I must make another 'fixture' and confirm its light works with its pair of phototransistors, then repeat twice more.

I expect the phototransistors with leads attached were assembled in Asia, and everybody involved only tested them under whatever "room lighting" was handy. They're said to work with infrared too, which I imagine a 5000K color temperature LED produces very little of.

Hi, ho, if I wanted to sit and be entertained, the world brims with opportunity.

Michael_Hohn commented:
QuoteThat's interesting in a geeky sort of way, if I can say that without insult. I like your philosophical attitude.

4-Feb-2022: I know how to fix it, it's just more complicated than I'd hoped when I started.

deemery (Dave) commented:
QuoteThat's interesting... Some LEDs are specifically designed to minimize light outside of their color spectrum (particularly UV, which can cause fading.) 
3200/3500k lights are pretty easy and cheap, worth trying them...

The non-blue light you see from most, if not all current White LEDs comes via the phosphor coating They modify the phosphor and lose lumens/watt efficiency to provide deep red or IR light, so it's quite reasonable that 5000K LEDs don't bother. Luckily I was given an old strip with cracked encapsulation and maybe 3500K color temperature. A chunk of that worked once, now to see if it will again.

4-Feb-2022: I tested the 2nd 3-LED segment of the "warmish, decrepit" LED strip on the rightmost (east) pair of phototransistors: worked fine. So here's behind the scenes:

IMGP4947_v1.JPG

The caboose is still over track B's "too far East" phototransistor, so the model board looks like this:

IMGP4945_v1.JPG

The four left (west) occupancy phototransistors aren't wired yet, so their orange LEDs are lit. Only one of the four right (east) LEDs is lit. You can also see my original 'route' signals in the leftmost windows of the Acme Fast Freight terminal, and the repeaters at the east end of the model board.

Next step is two more 'light fixtures' and a harness incorporating the last four phototransistors. Then I screw the detector board in place, secure wires that need it and finally, letter the model board.

Pruitt showed an IRDOT installation:
QuoteInteresting. I did something sort of similar on an earlier version of my CB&Q in Wyoming.
MicroMark used to sell something called the IRDOT, or InfraRed Detector Of Trains. It was designed to mount underneath the track board, and projected an IR beam up between the ties. A detector mounted adjacent would detect the beam when it reflected off the bottom of rolling stock and would affect an LED on my control panel.
Here's what a couple of the IRDOTs looked like installed under the subroadbed:

Pruitt_IRDOT1.png

QuoteAnd here's a close-up shot of the control panel. The blue LEDs indicated the selected ladder track at each end of the yard. Green LEDs indicated clear track.
When they turned to red they showed an obstruction to the beam, reflecting it back to the sensor (hopefully the obstruction was a train in staging!).
Pruitt_IRDOT2.png

QuoteThe detectors were kind of expensive, but that wasn't a major consideration at the time. I don't think they're available anymore.
Anyway, it was another way to accomplish the same thing James is doing today.
BTW, I really like the marker lights on that caboose...
James

jbvb

BurleyJim commented:
QuoteJames, This is a neat setup. Are those phototransistors the type that looks like a black 5mm LED? You might hit your local Goodwill store and look for a 'dead or alive' TV remote control. They have a IR LED in them. about 150 ohm resistor and 12 V will give you a nice IR light source cheaply. I bought 50 pairs of the
Ptrans and IRLEDS on ebay for about $8.00 that I use on the speedometers I've built.

6-Feb-2022: Rob Paisley's phototransistors are clear, in a 3mm/T-1 package. With the heat shrink on the terminals, mine have needed a 13/64" hole. There's a picture of a couple, wired, about half way down Page 1 of this thread.

BurleyJim replied:
QuoteThose clear LEDs really 'camo" themselves into that photo.

6-Feb-2022: Thanks, Mark and Jim. Mark, Paisley's board with 8 phototransistors was $24 in 2019. Azatrax makes I/R optical train detectors, which they advertise as using coded IR pulses instead of a steady beam. I've only used this on their Spring Switch controller. It needs 3/16" holes in the roadbed for "reflective sensing" off the bottom of the car. I/R would actually be a little less useful behind my backdrop. I don't mind extra visible light on the staging tracks.

The caboose's LED markers are from Tomar. Installation thread not yet reposted on Modelersforum.

Today I got all 8 phototransistors wired up correctly. But the two "light fixtures" I added for the mid-siding sensors aren't doing the job. Poking around with my voltmeter, I find my +/-12 VDC buss is at around 11.5 volts. Before I do anything drastic, I'll try those LED strips on my lab power supply. It's possible I've reached the capacity of the 2 amp wall-warts presently supplying that buss.

[edit] Applying full 12VDC to the LED strip segments corrected one LED on one that was flickering but no effect on the phototransistors. Feeding them 16VDC made 2 of the 4 phototransistors work. Next experiment will be an actual red LED. For science, I guess...

7-Feb-2022: The first LEDs I tried were orange T-1s left over from led-switch.com's 25 for $1.50 packaging. They worked, hurrah! So I added a pair to one 'light fixture', centered exactly over the two tracks. Using 470 ohm resistors, they're pretty bright but don't draw enough current to worry me.

IMGP4948_v1.JPG

The orange LEDs are Weldwooded into little pockets in the wood. All that remains is to modify one more 'light fixture' and letter the model board.

11-Feb-2022: The 3rd light fixture shown above worked just fine. There was one more bump in the road, but the project is finished now:

IMGP4949_v1.JPG

I made the 4th 'light fixture' using two additional Orange 3mm LEDs as shown above, but when installed, it only provided enough light to trigger one of the two phototransistors under it. Rather than redesign/rebuilt, I went back to Rob Paisley's instructions.

There's one resistor per phototransistor, which I think a real EE would call a 'pull-up'. The phototransistors connect one side of an LM339 voltage comparator (4 to an IC) to ground. The 'pull-up' connects that same side to +12. If the phototransistor conducts more than the 'pull up' resistor, the comparator senses 'low'. This turns the output LED (on the panel) on, indicating 'light', which means "no train" in this "Inverting Photodetector". So if I wanted more sensitivity I needed more 'pull-up' resistance (Rob's instructions do say this).

I unsoldered the offending resistor; it measured 455K ohms, which makes it 'officially' 470K ohms. I chose an 820K ohm (officially) 1/4 watt from my inexpensive resistor assortment. I cleaned out the holes in the board with a 'solder sucker' and a little drill bit for what couldn't be sucked out. Soldering it back in was a snap; lots less effort than reconnecting all 19 or 20 inputs to the board under the layout. I applied power and of course it didn't work until I crawled back under and aligned the phototransistor directly toward the orange LED.

So, I know a little more about 1980s analog IC applications. If I need more (or am helping a friend), I'll get Rob's kit rather than the assembled board. And I'll get my phototransistors from Digi-Key, Mouser etc., reading the spec carefully to see how much sensitivity varies. Then I'll test before I install. If despite my precautions, those phototransistors have significant variation in sensitivity, I'll adjust the pull-up resistors before I crawl under the layout to install the detector board.

Note: When I say a 455K resistor is 'officially' 470K, I mean it. They make resistors by mixing carbon and clay together, but not awfully thoroughly. Then they mold the carbon/clay around the wire leads and bake them. When cool, they're run through a tester, which sorts them into 620 ohm 5% tolerance, 620 ohm 10%, 560 ohm 10%, 560 ohm 5% etc etc. The thing I didn't expect was that when I tested a few strips of resistors of the same value, they were all under, or exactly on, none over. I'd expected the range would go both ways. Of course maybe that VoM is off by a bit. I should compare all 3 of mine...


4-May-2025: This installation has worked fine to date. It makes it much easier to position trains in Draw staging. And it's easy to tell visiting operators: Stop when that (pointing) light goes on. Or even Go till that light goes on, then goes out and stays out.
James

Powered by EzPortal