A Type of Sensor Requirement

Hi All,
I'm currently developing a project to track locomotives around a track. It only needs to detect them at specific points, rather than all over - although, all over would be interesting too.
I was going to try an IR sensor, so a locomotive would pass over the IR sensor, cut the beam and therefore you'd know something had passed. This seems to be my best option so far, but I just wondered if there were any other types of sensors out there that I could use that might be a better option, preferably something that I can hide better, that doesn't require me burying under the track maybe?

Any help, greatly appreciated.

I believe the most common approach for this is a reed contact.

...or Hall sensor

Models, I assume? What scale?

I agree, reed switches seem appropriate, you can probably squeeze them between the "sleepers".

s-l300 (3)

It's all OO gauge, similar to HO gauge.
I wondered about reed switches. But surely I'd need a fairly potent magnet on the base of each loco then?

You could try a retroreflective IR sensor, where the emitter & detector are in the same package and the beam reflects from the underside of the locomotive.

Do you want the sensor to detect only the loco or any car the loco is pulling?

I'd like it to literally detect if something is there. Whether it be a loco, coaches or indeed anything else. So it's more of a 'presence' sensor than anything else.

Then as the train moves around, as it passes the next sensor on the route, it would detect it there etc

In that case, reed contacts or hall sensors will be problematic - as they work based on magnetic fields, they will not react to, for example, your fingers.

I'd also like to have many on the layout. Around 20.
So, I'm not sure how to achieve that.

Well, people have done that (and more) on model railways before. There are many specific tutorials for it, although I assume most of them don't include interfacing with an Arduino.

IF you get switches with TWO reeds, and orient a bar magnet parallel to the reeds, then almost any old bar magnet will bring the two reeds together and close the switch.

An Arduino MEGA 2560 R3 has plenty of input pins for 20 or 30 sensors

Those two requirements seem to contradict each other. You want something hidden but not hidden under the track?

But is a very poor approach in general.

A Nano can attach to multiple port expanders to connect 16 inputs each.

The suggestion on another recent post was (modulated) IR emitters and detectors on each side of the track, placed obliquely in order to avoid the gap between carriages. These can be concealed in scenery such as trees (and the oblique placement makes them less conspicuous).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.