Detecting Individual Cars

I’m the guy referenced here…the detector consists of 2 tssp4038 IR detectors that work at 38KHZ, and an IR source driven at that frequency.

The way it works is that an Arduino NANO monitors the sensors and can tell the direction of the movement across the sensors, and knows if the count increases or decreases for any block. Obviously, both adjacent blocks need to be informed of the transition, and an individual count is maintained.

The system can detect anything going past the sensors, with the smallest size being detected based on the placement of the detectors, closer equals smaller detection. The detectors were initially at the side of the track, and because of the size if the detection surface, it actually counted trucks as they passed.

My current system uses Fiber Optic cable to link the detectors to the track, and the detectors are mounted close to and just above the railhead. It works flawlessly.

Like ALL my work for model railroad use, it’s all open source/DIY. I’m setting up a web site to sell the bare PCBs if anyone wants them. The complete system including HW & SW is included, but most won’t want to get their own PCBs made, so that’s the reason for the web site.

The system requires soldering, and I’m considering offering pre-soldered PCBs. Every part that can be socketed is socketed, allowing easy installation and troubleshooting/parts replacement.

I’m not in this to make any money, but I certainly don’t want to lose money, so prices will be LOW. Hopefully, I’ll get this all done in the next few months.

I put some video of my prototypes on YouTube. Please ignore the quality of the video. Enjoy" https://www.youtube.com/channel/UCGxniu22N3COHRWq_gfEpsw

I forgot to mention that there are NO modifications required

I had better luck using some 3mm emitters and sensors I bought off eBay for an earlier project. I bought them in a ten pack paired 3mm 940nm. I swapped out the 5mm that came on the FC-51 modules, I left the leads long enough to extend to the bottom of the ties or the top of the cork roadbed and they will clear a 5/32” hole. Using ¾” plywood base and Midwest cork roadbed, the lenses are level with the roadbed with ¾” leads off the module board making the total length 1” off the board.

I drilled a ⅛” pilot hole for each emitter and sensor then sized it with a 5/32” bit. The code 83 tie spacing is just a hair under 5/32” but by being careful I didn’t ding either tie. I slightly angled the holes so that the IR beam focuses at car bottom to get max reflection.

With the emitter and sensor about 1/32” apart at the cork the module sees the entire car and by tweaking the sensitivity pot it doesn’t see the couplers. I don’t care about the couplers so I increased the sensitivity setting for insurance.

Using the above method my overhead LED room lighting doesn’t effect the FC-51 module.

Barcodes, inexpensive & proven technology. For smallest size use 2D Data Matrix (looks like a messed up checkboard) which has automatic error correction for damaged images. Free download fonts online for Excel, etc, and simply enter the car number. Place barcode on car bottom and “keyboard wedge” type scanner underneath layout.

Actually Data Matrix is overkill for a simple 4-5 digit number so might as well enter other data like price, type of car, etc. You get 3000 characters.

I explored barcodes some time ago and generally found the technology somewhat overkill, as you mention. The other drawbacks were the bulkiness of the scanners and their cost. No such thing as a small, hobby sized scanner and the investment for a half dozen or so was prohibitive for the application.

As for gregc’s post above - indeed, I presently use heat shrink tubing over my emitters and recievers to not only focus the beam but help shield from unwanted reflection. Nevertheless, as accurately as I can get the basic detection operation to work I can not conquer the reflectivity problem off of many closely coupled cars, particularly a string of box cars. Reflections off of the car ends is really frustrating. Sure - I experimented with long shank couplers, and that did the trick for the most part, but going through my roster and modifying all of the offending rolling stock wasn’t what I had planned on.

Meanwhile, I am convinced that a practical (small, cost effective and easily implemented) and reliable sensing mechanism that will detect a specific and precise mark, such as a spot of specific color paint, on the underside of a loco or cars would solve the two major problem here: spurious reflections off of the variety of shapes, sizes and proximity of the objects being detected AND the low IR reflectance at all from dark (black) surfaces. That’s the prize.

-Geoff

As a test I put a Avery ¾ white round dot sticker on the bottom of an Athearn passenger car and turned the sensitivity way down on the FC-51 and it only sees the dot.

At my original settings I have all 8 FC-51s working great as occupancy detectors.

Mel

My Model Railroad
http://melvineperry.blogspot.com/

Bakersfield, California

I’m beginning to realize that aging is not for wimps.

Interesting Mel. I’ll give that a shot. I have sheets of those type stickers, although colored, from other projects. I’ll get some white ones to try. Previously I had turned the sensitivity down but still kept running into erratic behavior from other highly reflective colors that would come into view of the FC-51 and as always the beam scattering problem. Thanks.

-Geoff

It also worked with an orange ½” but white allowed me to turn the sensitivity lower.

Mel

My Model Railroad
http://melvineperry.blogspot.com/

Bakersfield, California

I’m beginning to realize that aging is not for wimps.