กลับไปหน้ารวมไฟล์
slot-car-lap-counter-fdca23-en.md

Yes, another slot car lap counter!

(Arduino code updated 2023/08/17. Now it is complete for six different type of race)

I decided to restore the slot track and create a digital lap counter that worked both by setting the number of laps and otherwise by setting the duration in minutes of the race.

Among the various methods for detecting the passage of cars, i chose the infrared module, making a change: i put the transmitting led and the receiving led facing each other. In this way the receiver is always illuminated and it is the interruption of the illumination that increases the count of laps.

the IR sensor modified and original

Prototype

In addition to the two race modes - timed and lap - it is possible to set three types of track.

The first track is the classic one, with two lanes, two players, and two cars.

The other two tracks are for single player mode: one uses the rally loop - if you don't know it, search the net - the other uses the normal track but with a lane crossing, so to complete a lap you have to go both the lanes. Obviously it is necessary to change the power supply of the track to run in rally mode.

To navigate in the menu you use the IR sensors which are programmed, one to move the cursor and the other to confirm the choice.

Once the type of route and the type of race have been set, the traffic light appears on the display accompanied by beeps. The lights come on in sequence and when they go off the race begins.

The race timer, number of laps and best lap time appear on the display for each player.

Some checks have been set to limit errors:

Debouncing, minimum time for one lap, false start, car stopped under the IR sensor.

Let's talk about IR sensors. The most delicate part is to unsolder the receiving sensor (the dark one), position it on the track and reconnect it with two wires to the base. Please pay attention to the polarity.

I built a wooden trellis on which to mount the transmitting LED perfectly aligned with the LED mounted on the track.

I decided to fix everything permanently to a piece of the track, in order to make everything solid and to prevent shocks or vibrations from changing the alignment of the LEDs.

As container I used an old modem that I removed the contents and that I modified to insert all the components.

I designed and built the trellis with my laser CNC.

EXPANDED TECHNICAL DETAILS

Micro-Timed Event Detection

This lap counter adds digital timing precision to analog slot car tracks.

  • Sensing Hardware: Uses IR Beam-Break sensors or Hall Effect magnets embedded in the track.
  • Interrupt Logic: Because cars pass at very high speeds, the sensors are connected to the Arduino's Hardware Interrupt pins (D2/D3). This ensures that the lap is recorded even if the main code is busy updating the display.

Race Analytics

  • Precision Timing: Uses the millis() or micros() function to calculate laptimes to 3 decimal places.
  • Leaderboard UI: An I2C LCD or OLED shows the current lap time, personal best, and total laps for two separate lanes, professionalizing a hobbyist racing experience.

ข้อมูล Frontmatter ดั้งเดิม

title: "Slot Car Lap Counter"
description: "Another Slot Car Lap Counter, but if I did it anyone can do!"
author: "sierra070"
category: "Gadgets, Games & Toys"
tags:
  - "Cars"
  - "Games"
  - "Toys"
  - "Clocks"
views: 3472
likes: 3
price: 1499
difficulty: "Easy"
components:
  - "1x Arduino Micro"
  - "1x piezo speaker"
  - "1x Soldering kit"
  - "2x 16x2 LCD display with I²C interface"
  - "1x Copper Stripboard"
  - "1x Plastic  container"
  - "2x AZDelivery IR module i2c"
tools: []
apps:
  - "1x Arduino IDE 2.0 (beta)"
downloadableFiles:
  - "https://projects.arduinocontent.cc/cbc2d06a-bef4-4b13-8f05-28876bec9379.ino"
documentationLinks: []
passwordHash: "c253ef5386562c7b5f5fda27c5aa1d235a1b1fb4af02433e3e6a79a390897573"
encryptedPayload: "U2FsdGVkX19/N+NXwD4CUf44HjfGRbV9oM77RQhpTJtlcvYT6WrlJ/GTxlJT2w70wtS5r3MZ1+6r9IULzvR3tgFetfDjh9zlKaFf4jqYVAI="
seoDescription: "Build your own Slot Car Lap Counter with this easy Arduino project. If I can do it, anyone can!"
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/slot-car-lap-counter-fdca23_cover.jpg"
lang: "en"