I'm new to Raspberry PI.

I have to develop a system that records the lap times of slot car races on eight lane tracks, so I was thinking to use a Raspberry PI and a sensor for each lane installed on finish line.
Do you have any suggestions for what sensor it's more appropriate for this purpose?

I found some sensors which can be good:
This sensor applied under each lane can detect the passage of the wheels?
Or maybe this installed over each lane?
Any more ideas or suggestions?

  • 1
    I think there are various forms of simple mechanical switch which could be used here; this is an example.
    – goldilocks
    Jan 18 '16 at 14:07

You can repeat this schematic, assigning a GPIO port for each lane.

The HAL sensor will require a magnet on the car, however, on my testing the magnetic field from the engine was enough to trigger the circuit, as a bonus, you will have a visual feedback.

The OH090U have an internal circuitry to avoid false and multiple switching when the magnetic field is moving.

The sensor run on 5V and with a couple of common resistors we feed the GPIO with a voltage within the margin rate.

The cost is less than US $5 per track. Hard to beat.


simulate this circuit – Schematic created using CircuitLab

  • Thank you for this suggestion! The cars can't be modified, so I'll test if their magnetic field is enough to trigger that type of sensor. Jan 18 '16 at 17:00

I notice Adafruit do a fairly cheap analog light sensor: https://www.adafruit.com/products/2748 . I'd be tempted to investigate switching to an Arduino, installing light sensors in each lane, and monitoring each sensor for the dip in voltage that occurs as each car passes over it.

Alternatively, you could use an external ADC to monitor the sensors using a Pi. Adafruit have a decent tutorial on achieving this using an MCP3008 ADC and Python: https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi

There are currently some photos of an apparently working infrared LED setup for Scalextric track here: http://www.slotforum.com/forums/index.php?showtopic=33961 . I note from the comments there that it's apparently less finicky to mount a light source above the track rather than embedded beneath it.

  • I choosed Raspberry PI because I have to send the time datas to a server. (Has Arduino connectivity solutions?) Thank you to for your suggestions! Jan 19 '16 at 11:48
  • There are both wired and wireless network shields available for Arduino, but they tend to be relatively expensive. The MCP3008/Python approach I've linked to in my answer is probably going to be more useful for your application.
    – goobering
    Jan 19 '16 at 12:38

This is theoretical but perhaps you could modify a short (quarter ?) length track as the finishing line by carefully cutting a centimetre section of track there (two cuts, in one side) and linking the outer segments to restore the ability of electrical current to flow from one end of the segment to the other. You then wrap enough turns of fine insulated wire around a reed-switch to make a current sensitive switch with one end of the wire connected to the outer segments and the other to the isolated centimetre middle sector. The effect of this is that when a car is drawing current from the slot and it enters that isolated sector the current will flow through the coil around the reed-switch (which has now become a reed-relay) activating it which can be used as a volt free pair of contacts (i.e. a proper switch with no built in voltage or biasing issues that can be used anyway you like within reasons).

Of course having the start/finish line like this means that a master switch/relay could isolate all eight of the coils and guarantee an equal start.

If you do not want to mangle a track segment so much you could isolate a whole piece of track in the same way with some isolating material (nail varnish?) on the slot tabs at either end of the segment - hopefully you can still make a connection to a piece of the relevant metal on the underside for one side of the slot.

Note: I have rather assumed that you are using a track made from repeated sections of moulded plastic with metal inserts that provide the conducting rails that the individual cars pick up electricity from.

I have discounted using the magnet from the car's motor to directly activate a reed switch glued to the underside of the track in the vicinity of the start/finish line but it might operate and is in effect a mechanical equivalent to FCML's answer but nothing like as sensitive - and probably too insensitive to work...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.