To detect wheel rotations in model vehicles, we would need to install some kind of sensors on the wheels to be monitored.

There are many different ways to achieve this. One could use a Hall effect sensor or some other kind of rotary encoders. One of the easiest way to achieve this though is to use a reflective optical sensor.

The following circuit shows one such design. It consist a transmitter (the infrared diode on the left) and a receiver. The receiver utilizes a PNP transistor as the output stage. The benefit of this design is that the output can achieve the TTL required logic level easily and the on-off transition is very sharp. When no infrared signal is received, the circuit output 0V and when a strong signal is received the circuit outputs 5V. Depending on the IR diode and the IR photo transistor used, this circuit can detect object with reflective surface up to several inches.

Simple Optical Encoder
Simple Optical Encoder

Here is the completed circuit board. A divider between the IR diode and the IR photo-transistor may be needed to reduce the interference.

Simple Optical Encoder
Simple Optical Encoder

The following picture shows the circuit board mounted on the underside of a toy car. I used a narrow strip of mirror as reflector to work with the optical detector.

Encoder Mounted on a Model Vehicle
Encoder Mounted on a Model Vehicle

Since I only used one mirror, this configuration can only send out one pulse per rotation. To improve the output resolution, you can construct a more sophisticated reflector pattern.

The Arduino code for this optical encoder is very simple as well. Every time a signal is received, the interrupt function wheelEncoderISR is called.

void setup() {
  attachInterrupt(0, wheelEncoderISR, FALLING);
}

void wheelEncoderISR() {
...
}
Be Sociable, Share!