ElectricImages.co.nz

Digital Car Decoder

Modified: 13 Apr 2010 21:46 by Ian - Categorized as: Scalextric Digital
Edit

Digital Car Decoding

Based upon the Scalextric car LED signal format, the critical time is between the falling edges of detected car signal. Using a microprocessor, it possible to detect and time those edges, and a simple lookup table can provide the appropriate car id. Whilst watching for the next falling edge its a simple matter of deciding when the rising edge occurs, to decode lane change status.

However, there are a number of steps which must occur first to accurately detect, verify and confirm the signal received.

Noise from Ambient Light

The detector circuit will not provide a clean, aka quiet, signal when there isn't a car passing over the detector! Natural light, artificial light (especially incandescent lightbulbs) contain Infra-Red, and as such the detector will also 'see' this. Being random in nature, the detected light noise is just a nuisance, but it must be excluded.

The microprocessor must, therefore, ensure that the signal received is valid and appropriate. The processor must also recognise the transition point where the car LED is only partially detected (which presents like noise), usually as the detector just starts to 'see' the LED and just as the car is moving out of detection zone.

Quiet Zone

As the car's nose first appears over the detector, and the period after the detector until the car body passes over the detector, is a quiet zone. This is because the physical body blocks out all ambient light from the reaching the detector.

The microprocessor therefore uses this quiet zone to assist in detecting that a car is passing, and a valid LED signal will likely be arriving. The quiet zone which follows the LED also confirms that the car has passed, and is used to restart for decoding another car (which may have the same car ID, especially when pace cars are in use)

Transient Errors

As the LED just starts to be detected, and as the LED is disappearing from detection, the output from the LED detection circuit is effectively noise. The microprocessor must ensure that it is correctly interpretting this as transient noise, and not 'lose its place' in the detection process.

Ian Harding, Christchurch, New Zealand
"Love your enemy, it'll scare the hell out of him." - Attributed to Mark Twain