About Me Line Follower (for mBot)

1280X1280__94_.PNG

Overview

Me Line Follower is designed for line following robots. There are two sensors, each with an IR transmitting LED and an IR static induction phototransistor. mBot can move along a black line on a white background or a white line on a black background. It features fast detection and simple circuits. The blue tag on the interface of this module indicates that it is a dual digital interface and that it should be connected to a port with the blue tag on the main control board.

 

Specifications

● Operating voltage: 5 V DC
● Operating temperature: 0–70℃
● Detection range: 1–2 cm
● Detection angle: <120°
● Control mode: Dual digital interface
● Dimensions (L x W x H): 51 mm x 24 mm x 22 mm

 

Features

● The white zone on the module is for connection with metal beams.
● The two LED indicators report the line following status.
● Reverse connection of power does no harm to the IC.
● It is susceptible to natural light, so it may not perform well in places where the ambient light varies greatly.
● It supports programming in Arduino IDE, and simplifies the programming process with a runtime library.
● It supports block-based coding on mBlock 5 and mBlock 3, which is suitable for all ages.
● The connection is easy with RJ25 connectors.
● It features modular installation, compatible with LEGO parts.
● It has pins S1, S2, VCC, and GND, which support most Arduino main control boards.

 

Pin definition

The connector of the line follower module has 4 pins. The features of the pins are shown in the following table.
SN Pin Feature
1 GND Connect the ground electrode
2 VCC Connect the power cord
3 S1 Output the data of sensor 1
4 S2

Output the data of sensor 2

 

Wiring mode

● RJ25 cable
The tag color on the interface of the line follower sensor is blue. When you use an RJ25 connector, you need to connect it to a port with the blue tag on the main control board. Take Makeblock Orion as an example. You can connect it to port 3, port 4, port 5, or port 6 as shown in the following figure.
1280X1280__95_.PNG
● Dupont cable
When you use a Dupont cable to connect to Arduino Uno, pin S1 and pin S2 of the module should be connected to digital interfaces as shown in the following figure.

Programming guide

● Program with mBlock 5
The line follower module supports programming with mBlock 5. The following is a brief description of a block on this module:
Block Features
output__15_.png

Select a port

Read the status value of the line follower sensor

● Program with mBlock 3
The line follower module supports programming with mBlock 3. The following is a brief description of a block on this module:
Block Features
output__16_.png

Select a port

Read the status value of the line follower sensor

This program can make the panda identify and say the operating status of Me Line Follower.
28420887-1689-487b-80fb-2edf7eb4c43a.png
● Program in Arduino
If you program in Arduino, you need to use Makeblock-Library-master to control the line follower module.
11cc1fb4-0168-492f-a8ea-33f835b8b5bf.png
MeLineFollower(uint8_t port) defines the port to be connected:
Function Feature
MeLineFollower(uint8_t port) Define the port to be connected
uint8_t readSensors() Read the status values of the sensors
The function of the code segment is to read the results detected by Me Line Follower continuously and output the results to the serial monitor in Arduino IDE every 200ms. Upload the code segment to mCore and click the Arduino serial monitor, and you will see the running results as follows:
fb5281ab-0569-46ea-a328-2d8945213469.png
Result from the serial monitor

 

Working principle

The line follower module is a robotic part developed according to the principle of a reflective photoelectric sensor. Since IR has different reflection strengths on objects with different colors, infrared light can be continuously emitted to the floor when mBot is moving. When infrared light is emitted to a white paper floor, diffuse reflection occurs, and the reflected light is absorbed by the absorption tube installed on mBot. When infrared light meets a black line, it is absorbed, and no reflected light is absorbed by the absorption tube installed on mBot. The position of the black line and the moving path of the mBot is determined by whether there is reflected light absorbed by the absorption tube. The output value of the line follower sensor is 0 when a black line is detected, and the output value is 1 when a white line is detected.

 

Schematic

af8b6654-6237-4074-8a3b-8ab0e405180e.png

Line following program on mBlock 5

The following figure shows a line following program on mBlock 5, achieving the line following effect through the detection by infrared probes. The output value is 0 when the line follower sensor detects a black line, and the output value is 1 when it detects a white line.
00b20821-0e8a-48fb-9187-4f4fffa67891.jpg

 

Was this article helpful?
7 out of 22 found this helpful

Comments

1 comment
  • this is like 5 years old. if you want to be helpful, how about you update this to the latest version of the makeblock app, its not that hard.

    0

Please sign in to leave a comment.