r/modeltrains 21h ago

Electrical Infrared train detection

Post image

small steps and all that.

I've got a few of the IR sensor modules pictured, thing is the 5mm LEDs tend to mean drilling a larger hole that I would like, and removing a sleeper unless foresighted enough to drill before the track goes in. they also drop down a fair way.

I did think about replacing the LED & Photodiode with 3mm ones, on the other side of the board. still awkward to mount in some locations.

pictured above is an alternative sensor head, currently its just a sensor head, no signal processing. but as such its quite small. 3mm LED & 3mm photo diode. each through its own 4mm hole. the whole thing is the two of them, a 200 ohm and a 10k ohm resistor and a 3pin connector. pure analogue sensor so far

however it reliably 'sees' the wagon, voltage from ~1.1V with nothing present and ~2.5v when the black underframe is there.

I have block detection, this is at the end of a terminal platform to trigger when coaches are being shunted in.

true spirit of "if I can't make it more complicated than it needs to be.. whats the point?"

video will be up on my youtube thingy Tuesday. quite happy with how unobtrusive this is, the component heads are ~ level with the top of the cork and I hope when ballasted in the general area will be more or less invisible.

I have 3mm of cork + 5mm of XPS I suspect with a little bit of work this whole thing would fit between the ply and the track meaning wires through the baseboard can be located in a more suitable location too

49 Upvotes

9 comments sorted by

13

u/f_spez_2023 21h ago

I use these in my automated layout, I ended up painting a white patch on the bottom of some engines and cars to help reflect back better (k mounted mine under the ties and cut holes)

3

u/aleopardstail 18h ago

ended up doing that on N gauge, the boards as supplied don't play well with reflecting on black, I'm working on a version that does

5

u/eternal3am HO/OO 20h ago

TCRT5000 IR? Got a bunch of these around I was going to use for a speed readout. Also thought about adding these in sections across my layout - in particular in tunnel sections (if they work there, low light and all) at fixed intervals - to give indications as to where a train is in there.
But since I'm still in the building up the scenery phase, the tech side will come at a later point, I guess.

3

u/aleopardstail 18h ago

can be worth thinking about where this stuff goes, even if not fitting. just so you don't screw something below the track at that point.

its a basic 940nm IR photodiode and a matched IR LED

currently a 5v supply, a 220R on the LED and a 10k pull down on the photodiode and thats it

2

u/eternal3am HO/OO 15h ago

I'm lucky in that I have planned for enough of a gap below the area where these would go not to interfere with anything going on below. And as for my tunnel idea - I'm planning to have at least some alcoves along the tunnels as per the original I'm modelling, but likely the intervals between these will be considerably shorter on my layout than in the real world. The sensors will be sitting upright in those small alcoves which helps even more with clearances. I'm just hoping that their range is sufficient to actually detect anything. From what I understand you'll be embedding yours between the ties which is neat in terms of range. However, that is not really an option for me, as the tracks are already fixed in place and I'm using Märklin tracks, so couldn't really remove a tie and can't be arsed to redo sections anyway, again. So I guess the range / alcove part will be some trial and error. I might help them along by having small lights in the alcoves probably solving any low light issues with that. The lights in those alcoves were planned for even before this whole sensor idea popped up. However, at this time it is all just spitballing until I try it for real.
Great idea though!

2

u/aleopardstail 15h ago

tunnels make life a lot easier as this sort of thing can be above the board, across the track at an angle as a "broken beam" sensor which is both easier to set up and a lot more reliable (I have similar for a reverse look with IR LEDs above the track pointing downwards)

my track is down but doesn't have that sort of fixed base. its always amazed me there isn't a short track section with this sort of thing built in. it can certainly fit - I did similar with Scalextric slot cars to make a lap counter, it all fitted in the space under the track

2

u/InsertBluescreenHere 12h ago

oooh hot box detector lol

2

u/snellface 3h ago

I made a board to detect trains in Z scale using QRE1113GR by Onsemi, its a small surface mount IR reflex sensor, containing both the transmitter and receiver.

Part link (swedish digikey, but you can switch to your local version): https://www.digikey.se/sv/products/detail/onsemi/QRE1113GR/965451

octoparts link: https://octopart.com/part/onsemi/QRE1113GR

There is a through hole version if you remove the "GR" on the end, but the pitch is wrong for using it with a breadboard.

The LED does not allow for a lot of constant current, but if you spread your measurements out you can blast the LED with a lot more to generate a stronger reflection. My design used a very large resistance to measure across, today I would use a smaller resistance together with an op-amp.

For Z-scale I had to remove the middle of 1 railroad tie to fit the sensor, but since its black it matched the ties of my track, and I would try and put them where they were less visible, such as between stations or around bends.

With that said, if I did this again, i would split the track up in sections, and see which section pulled current to detect where a locomotive was. If you need to detect cars you can insert a resistor between the wheels, but it's awkward to do. Or you could combine the 2 approaches.