Site Tools


Sidebar

Content

pub:line_finder

This is an old revision of the document!


Line_finder

Line Finder Module:
The Line Finder Module applies the principle that infrared rays reflect differently on surfaces of different colors. After electrified, the infrared diode on the module sends out infrared rays constantly. When they encounter a white surface, the diffused reflection happens and the reflected rays are received by the receiver on the module. On the other hand, when they come across a black one, the receiver cannot get any infrared. Thus, the processor can tell whether it is a white or black detected surface by receiving the reflected infrared rays or not. Based on this, the module is usually used in line finding on a smart car.

S Digital output
+ 3.3V
- GND

As can be seen on the picture, the line finder module is divided into anode, cathode and a signal wire. The signal wire needs to be adjusted by a potentiometer when it is connected to a digital port.



Microbit

1 * microbit
1 * microbit expansion board
1 * USB cable
1 * line finder module
1 * white paper stick with black tape.
- Several Jumper wires

Code:
Makecode:

MU Python:

 

Click “flash” and download the code onto the micro:bit.
Now you can see the data read from the infrared line finder module on the serial port.
Effect Picture:

添加图片


Arduino

Components
- 1 * Adeept Arduino UNO R3 Board
- 1 * Line Finder Module
- 1 * USB Cable
- 1 * 3-Pin Wires

Build the circuit

图片

Adeept UNO R3 Board Line Finder Module
D8 S
5V +
GND -

Code:

 

Compile and download the sketch to the UNO R3 board.

图片 图片

Open the Serial Monitor in Arduino IDE. Place the sensor module over a piece of white paper and another of black and you will see the data detected on the window. You can adjust the blue potentiometer on the module to change the sensitivity.

图片


Raspberry pi

Components
- 1 * Raspberry Pi
- 1 * GPIO Extension Board
- 1 * 40-Pin GPIO Cable
- 1 * Breadboard
- 1 * Line Finder Module
- 1 * 3-Pin Wires

Build the circuit

图片

For C language users:

Step 2: Edit and save the code with vim or nano.

(code path: /home/Adeept_Sensor_Kit_for_RPi_C_Code/18_tracking/tracking.c)

Step 3: Compile$ sudo gcc tracking.c -o tracking -lwiringPi

Step 4: Run

$ sudo ./tracking

For Python users:

Step 2: Edit and save the code with vim or nano.

(code path: /home/Adeept_Sensor_Kit_for_RPi_Python_Code/18_ tracking.py)

Step 3: Run

$ sudo python 18_tracking.py

Place the sensor module over a piece of white paper and another of black and you will see the data detected on the terminal. You can adjust the blue potentiometer on the module to change the sensitivity.

pub/line_finder.1546933352.txt.gz · Last modified: 2019/01/08 15:42 by Adeept