I have a Carrera GO!!! race track. There's a plastic mechanical lap counter that adjusts every time a car passes it.

What I would like to do is to have some sort of electrical connection that when the car passes through the lap counter, the counter creates a connection between two wires or something. When this happens, I would like to send that signal to a computer/laptop which records it into some sort of database. The time between each connection would be the lap time, and the amount of connections would be the lap count. When this is recorded, I would like to present it on a monitor real time.

There's more, but that would be after I figured out a way to detect a signal to work with...

Have anyone done anything like that? or similar stuff.

I'm aware of that there exists stuff like this on the market. But that would require buying new track set etc. (that would probably be cheaper as well :P, but hey, who doesn't like to have something to do on their spare time ;))

I'm adding a couple of pictures of the counter: a car passes by Beneath the car you can se a whit plastic pin. And right in front of the car, you can see a pin sticking out of the track. This pin is pushed to either side, depending on which direction the car goes, and ajust the counter with one.

The mechanical lap counter Here you can se how the counter works.
(1) the car passes by, and pushes the pin
(2) the pin is then pushing an arm of some sort to turn a gear (3) - which is the counter.

Now, at the very bottom, it looks like there could be placed some sort of metal, or wires, that could send a signal to a computer when they touch.. But it happens very fast.

Hope this helps for clarifications..


4 Answers 4


An IR Diode and IR Transistor pair would work well. Make or break the line of sight, and your microcontroller or other input method can talk to the computer.

Drill a small hole on each side, and adjust it so that when the center plastic gets pushed down, the signal breaks. That's a count.

enter image description here


I reckon that a reed switch positioned in the track groove and a lightweight magnet on the car would work nicely - forget about the current lap counter (although you could still use it).

A magnet on the car is not a big deal and it should be able to cause a reed switch to operate just fine: -

enter image description here

Someone else mentioned using the soundcard input so I'll also hijack that idea. A small battery and 100k resistor feeding the reed switch would be a basic idea for detecting a glitch from the magnet but, you could use a 5V logic supply and virtually any value resistor in series with the reed to do the job. Some form of debounce circuit (or code) will be needed but this is trivial.

You could position the reed switch anywhere on the circuit - in fact you could have several so you can record section times just like F1 - OK I'm ranting now.

Cool idea - think I might apply this to my train set LOL.

EDIT - another idea

Again, this disregards the current track counter and should use some form of overhead gantry with a light emitter that could "spray" light across the track width. Sensors would be positioned in the grooves and normally they would be receiving a signal from the emitter except when the light is "broken" by a car passing.

Depending on the track width, you may actually be able to mount the sensors trackside and still get a decent "break" signal when a car passes - it's all about angles. IR might be less effective than visible light but should also work. The emitter needs to be pulsed in order for the receiver to be "decoupled" from ambient lighting effects. Probably run at 10kHz to 100kHz. This method also gives you the opportunity to measure the "blanking" time (using another counter) to determine car speed as it passes by.

  • 1
    \$\begingroup\$ I guess it would require some trial and error to see if the magnetic field from the motor in the car would be enough to trigger the reed, or even a hall effect sensor. Could be an interesting project! \$\endgroup\$ Oct 10, 2014 at 2:27
  • \$\begingroup\$ That last part sounded interresting - meassuring the speed. This could possibly be done on other part of the track, say in a difficult curve.. \$\endgroup\$
    – ThomasK
    Oct 10, 2014 at 12:28
  • \$\begingroup\$ @thomask lap speed and time are simply a function of distance over time (v = d/t). Any solution here can do both. Every counter toggle starts/stops a timer. The time between counters, I.e. a lap, is the lap time and if you scale the time and the distance the car traveled, you get scaled miles/kilometers per hour. No need for another sensor. \$\endgroup\$
    – Passerby
    Oct 10, 2014 at 14:50
  • \$\begingroup\$ That's correct. By measuring the time between each lap count could give you an idea of the average speed trougout the entire track. But not the actual speed at one specific location - like in a curve. Anyway, although that was a cool idea future, that wasn't the actual case here. So I'm not going to drift off topic here ;) Cause I could for sure :P \$\endgroup\$
    – ThomasK
    Oct 10, 2014 at 19:16

If you can create a mechanical contact, for instance by using the spring of the lap counter, the you can use a pull-up or pull-down circuit to obtain a pulse signal.


simulate this circuit – Schematic created using CircuitLab

Then with an Arduino or any other microcontroller board you can setup the communication with the PC. Another way would also be to record the lap time straight in the microcontroller and then send it to the PC via UART-to-USB.

  • \$\begingroup\$ You can also use the soundcard of the PC as the interface, you doesn't need to use a MCU that way. \$\endgroup\$
    – Biduleohm
    Oct 9, 2014 at 21:36
  • \$\begingroup\$ I added a couple of pictures. Maybe that explains what I'm not able to explain.. \$\endgroup\$
    – ThomasK
    Oct 9, 2014 at 22:00

I'd place very small flat metal contacts like this. Solders wires to those contacts and then connect the soldiered wires as the switch in the linked example below. Make sure you test with a multimeter that it'll break continuity when the car passes through and maintains continuity when in the default resting position.

enter image description here

This is how you would use a MCU (Arduino) to monitor your contact count. Except if you had it connected like the schematic in the link with a +5v at one end of the switch and ground at the other end of the resistors you'd just want to test for low/ground signal. You'll HAVE to debounce the switch and maybe even add a small delay to allow for the open circuit time. The circuit in your case would be high until the car came through and opened up the switch which would cause the circuit to be pulled down to ground.

Depending how robust or lack of it, at this point you could just write the code to compare lap times and send that data to the built in serial terminal and your done. You could view the lap times with just a little bit of comparison math.

  • \$\begingroup\$ So the opposite of what I was thinking. Send a signal when a connection is lost. The car goes pretty fast, but that shouldn't be a problem with a setup like this? \$\endgroup\$
    – ThomasK
    Oct 9, 2014 at 22:29
  • \$\begingroup\$ It doesn't really matter in your case either way. You would just have to change your MCU code to test for whatever condition active low or active high. \$\endgroup\$
    – Nimjox
    Oct 9, 2014 at 22:32
  • \$\begingroup\$ I've read a bit about Arduino. But haven't figured out how the data is saved on the computer. What format etc. Is it a textfile? How I can detect that data an actually use it? like splitting up the different data, and send it to a database... \$\endgroup\$
    – ThomasK
    Oct 11, 2014 at 5:45

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.