Appropriate sensor for wooden train set

Hey, I am thinking about doing making a project which requires the sensing the passing of a train on a wooden train set. I have this wooden turntable and my project is to automate the spinning of it to meet any incoming train. I have done a bit of googling of sensors and came up with some proximity sensors that might work, but I really have no experience with sensors of this type.

The sensor needs to be able to sense a plastic/electronic engine that’s powered by a battery and a human pushed wooden train. It also needs to be compatible with an Arduino.

There is probably a dozen different sensor types that will work, but I want one that’s not that expensive, easy to set up and will work consistently. Does anyone have a good suggestion of a sensor that can sensor an incoming train?

There are examples that do precisely this. The trick is to provide a piece of scenery that incorporates the sensors, and the ones I have seen are a type of gantry placed across the tracks, such as used in railways to support overhead signals. There is a light source in one leg of the gantry and a detector in the other. When the light is interrupted a signal is generated, so it works for any kind of train, or even a wave of the hand if manual operation is required.

This is an example of the type of sensor that could be mounted in a structure like that which uses a LED as the light source. It should be housed in a tube aligned with the LED so that it doesn’t react to ambient light.
Photo Transistor Light Sensor | Adafruit ADA2831 | Core Electronics Australia (core-electronics.com.au)
LED - Super Bright White | Sparkfun COM-00531 | Core Electronics Australia (core-electronics.com.au)

This pair operates at infrared, so is not sensitive to ambient light.
Infrared Emitter | Sparkfun SEN-18772 | Core Electronics Australia (core-electronics.com.au)
Infrared Detector | Sparkfun SEN-19018 | Core Electronics Australia (core-electronics.com.au)

You can combine the detector and emitter in one unit if you place a small mirror at the other side:
Reflective IR Sensor with 470 and 10K Resistors | Adafruit ADA2349 | Core Electronics Australia (core-electronics.com.au)

Hey Oliver,
Welcome to the forums!

Running off what Jeff has said, a light based sensor would be perfect for your use case. I think a simpler version of this for you would be a IR Break line sensor, as it is all inclusive and relatively cost efficient.

One of these sensors combined with a basic microcontroller would be perfect for operating any actions on the train line that may have previously been set up. The choice you would have to make is regarding the read distance, as there is a 25cm and 50cm gap version dependant on how far apart you are looking to space them.

Cheers,
Blayden

For sensing the passing of a train on a wooden train set, you can use IR sensor. TCRT5000 or something similar will be good enough.