The ultrasonic-sensor can be used with the Joy-Car for the detection of objects and obstacles in a range between 2 and 300 cm. Therefore, it can avoid obstacles with a bigger distance or even can ride towards the objects.
The ultrasonic-sensor is capable of measuring distances precisely, as it sends out highly frequent acoustic pulses. When the pulse hits an object, the sound is reflected. The reflected echo is detected by the sensor. The distance to the object can be calculated by the time span between sending and receiving the ultrasonic pulse.
The obstacle-sensor, the linetracking-sensor and the speed-sensor all work with the same principle: infrared. The sensors use an infrared LED and an infrared receiver to detect the LED light.
The obstacle sensor can detect objects near the Joy-Car. For this purpose, the LED infrared light is radiated to the front. If an object / obstacle enters this light beam, the light is reflected and can be detected by the infrared receiver. The range of this sensor can be adjusted with the potentiometers. However, this sensor can only detect the distance preset by the potentiometers and not actively measure the distance to the nearest object, like the ultrasonic-sensor.
The line tracking sensor emits the infrared light downwards. If there is a light surface under the line-tracking sensor, the light is reflected and detected by the infrared receiver. However, if the infrared light is radiated at a black, non-reflecting surface, there is no infrared light reflected that the infrared receiver could detect. To follow a line, at least 2 sensors, but better 3 sensors, are needed. With the help of 3 sensors, you are then able to determine where the black line is and in which direction you have to steer to follow it.
With the speed sensor, the infrared receiver and infrared LED are placed directly opposite to each other. Between receiver and LED is a perforated disc, which is mounted on the shaft of the motor. If the motor shaft rotates, the perforated disc also rotates. This repeatedly interrupts the infrared light of the LED. If you count the number of holes in the perforated disc (in this case 20), you know that the wheel has turned 1/20 per interruption. With this information, it is possible to determine the distance traveled and if you take the past time from interruption to interruption, you can determine the speed.
SENSITIVITY (LINETRACKER- & OBSTACLE-SENSORS)
The sensitivity of the sensors can be adjusted if they do not operate reliably. The line tracking sensors and the obstacle sensors are equipped with potentiometers that can be adjusted with a screwdriver to set the sensitivity. Each sensor has an additional LED that only lights up when the sensor is detecting something. It helps you to check the function of your sensor and to adjust it as well as possible.
Take a white sheet of paper and stick a strip of black adhesive tape on it. Now place your Joy-Car alternatingly on the sheet of paper and on the black tape. Your sensors are correctly adjusted when the LED on each sensor lights up, when the Joy-Car is on the sheet of paper and when the LEDs turn out again when you put the Joy-Car on the tape.
First, remove the chassis from the base so that you can reach the potentiometers of the obstacle-Sensors more easily. The obstacle sensors, unlike the linetracking-sensors, have two potentiometers each. Here you can adjust both the strength of the infrared LED and the sensitivity of the sensor. Hold an object in front of the sensors. The LED should light up and go out again when you remove the object.
ADVICE: You can increase the sensitivity by turning the potentiometer clockwise. Turning it counterclockwise reduces the sensitivity.