Tutorial
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Assembly and Precautions
- 5 Controlling Robot via WEB App
- 6 Common Problems and Solutions(Q&A)
- 7 Set The Program to Start Automatically
- 8 Remote Operation of Raspberry Pi Via MobaXterm
- 9 How to Control WS2812 RGB LED
- 10 How to Control The Servo
- 11 How to Control DC Motor
- 12 Ultrasonic Module
- 13 Line Tracking
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Automatic Obstacle Avoidance
- 17 Why OpenCV Uses Multi-threading to Process Vide
- 18 OpenCV Learn to Use OpenCV
- 19 Using OpenCV to Realize Color Recognition and T
- 20 Machine Line Tracking Based on OpenCV
- 21 Create A WiFi Hotspot on The Raspberry Pi
- 22 Install GUI Dependent Item under Window
- 23 How to Use GUI
- 24 Control The WS2812 LED via GUI
- 25 Real-time Video Transmission Based on OpenCV
- 26 Use OpenCV to Process Video Frames on The PC
- 27 Enable UART
- 28 Control Your AWR with An Android Device
- Conclusion
72
13 Line Tracking
● Some of our robot products are equipped with a three-channel infrared line patrol module. The line
patrol module is converted to the robot's line patrol function design. The three-channel infrared line patrol
module contains 3 groups of sensors, where each group of sensors consists of an infrared emitting LED and an
infrared sensor photoelectric Transistor composition, the robot determines whether there is a line detected by
detecting the infrared light intensity detected by the infrared sensor phototransistor. It can detect the white line
(reflected infrared light) on a black background (non-reflected infrared light), and can also detect a white
background The black line on (reflects infrared light) (does not reflect infrared light).
● Since the Raspberry Pi can only read digital signals, the three-channel infrared tracking module is
equipped with a potentiometer. You can use a cross screwdriver to adjust the potentiometer on the infrared
tracking module to adjust the sensitivity of the infrared sensor phototransistor.
● Our program defaults to finding black lines on a white background (reflecting infrared light) (not
reflecting infrared light).
● Before using the three-channel infrared line patrol module, you need to connect it to the Tracking
interface on Motor HAT using a 5-pin cable.
●The three-way infrared line patrol module has an arrow pattern on the back of the sensor. The direction
of the arrow is the direction of the robot.
●The codes of the three-channel infrared line patrol module are as follows:
import RPi.GPIO as GPIO
import time
# Hunt module output pin
line_pin_right = 19
line_pin_middle = 16
line_pin_left = 20
'''
Initialize your GPIO port related to the line patrol module
'''
def setup():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(line_pin_right,GPIO.IN)