What's my best option for a sensor in this situation?

Greetings all, I posted another thread and got some great advice about a prototype I'm working on for a model railroad project I'm working on with my dad. Essentially we'll be using an Arduino to do certain things when it detects a train in a certain spot on the track. But what I'm looking for is advice on the best "sensor" option I have.

I do a lot of work with pinball machines so my first thought was to use an IR transmitter and receiver and shoot the beam across the track. Pinball Life (the lowest cost pinball parts supplier) sells sets of them for $7 ( http://www.pinballlife.com/index.php?p=product&id=167 ). I even did some reading and made a simple Arduino sketch to test the opto setup and it works [LED turns on when the beam is present and goes out when the beam is broken--I'd use this to trigger an event] ( Model Railroading: 001: Opto Switch Test #1 - YouTube ). The problem is that the optos aren't exactly small or nondescript so they would be hard to disguise on either side of the track. So I'm looking for some expert advice on if there's a better way to do this? Perhaps some kind of sensor under the track or something that shoots up through a hole in the track?

My concern is that something like a light sensor (while probably very inexpensive and easy to wire, which are both big pluses) would get tripped if we ran the trains in a "night scene" or if anyone turned out the lights!

Thoughts? Thanks!

Sounds like you've done some good work, congrats!

What about something like this? Infrared emitter and detector in one package. This is just one example, I'm sure there are dozens of similar devices. It may be necessary to put some reflective tape or something on the bottom of the train if that is permissible. Or maybe it would work without it. At any rate, some experimentation would be needed.

PS: Mouser stocks over 100 "optical switches" the one I linked above has a range of only a few mm which may not be enough. So some research is needed. Luckily, Mouser's parametric search includes sensing distance.

You may also be interested in this thread...
http://forum.arduino.cc/index.php?topic=228312.msg1683408#msg1683408

research proximity sensors, some of them com in really small packages.

+1 on the reflective tape or just kitchen foil.

You can blink the IR emitter and watch the change in value from the IR detector. If your detector is seeing ambient light then there will be a marginal change in reading between when the IR emitter is on or off, and if there is something reflecting the IR light then the change in reading will be much more pronounced.