Raspberry Pi : Line Tracker and Obstacle Detector
We are learning about a sensor. We use this sensor to detect a line and an obstacle. The line tracker work by sending out an infrared light and if the infrared light hit anything that isn't black color; the light will reflect back and the receiver on the sensor will absorb the light and return us the value of 0. The black color are good at absorbing light so if the infrared light hit it there won't be any light reflected back and the receiver will return us the value of 1 instead. The obstacle detector also use the infrared light. It send out the infrared light and if some object reflect the light back in the range that it is checking for the obstacle; the light on the sensor will lit up and it will return a value of 0. In contrast, if nothing has reflected the light back, the sensor will return a value of 1. We connect these sensor with the raspberry pi and let it print out simple word when it detect something. In the code, we just use the if else condition to check for the value that the sensor return then print out different string in different case. We can use these knowledge to make a car that follow a line. First, have two line tracker on each side of the car. If none of the line tracker detect a line, then let the car go straight. But, if the line tracker on the left side detect a line, it mean that we are going out of the line to the right side; therefore, we should make the car turn left to make it go back on the line. Same on the right side, if it detect any line on the right then it is going too much to the left then we should turn it to the right. For the obstacle detector, if it detects anything, make the code skip all the movement function then the car will stay still. Other choices are to make it rotate 180 degree so that it will avoid the obstacle and move in opposite way or move it backward and play some alarm sound to notice the people around to move the obstacle out.
ESLOs:
- Strategic Learners
- Innovative Thinker
- Leader of the future