Difference between revisions of "Line Follower Module(5 channel)"

From Wiki
Jump to: navigation, search
(How to Use on Raspberry Pi)
Line 1: Line 1:
 
=Introduction=
 
=Introduction=
 +
This 5-Channel Line Follower module is an infrared tracking sensor that uses 5 TRT5000 sensors. The blue LED of the TRT5000 is the emission tube and after electrified it emits infrared light invisible to human eye. The black part of the sensor is for receiving; the resistance of the resistor inside changes with the infrared light received.<br>
 
[[File:5 channel line follower.png]]<br>
 
[[File:5 channel line follower.png]]<br>
 
[[File:5 channel line follower back.png]]<br>
 
[[File:5 channel line follower back.png]]<br>
Line 5: Line 6:
 
In other words, the different conduction levels of the phototransistor when it passes over black and white lines can generate different output voltages. Therefore, all we need to do is to collect data by the AD converter on the Atmega328 and then send the data to the master control board via I2C communication.<br>
 
In other words, the different conduction levels of the phototransistor when it passes over black and white lines can generate different output voltages. Therefore, all we need to do is to collect data by the AD converter on the Atmega328 and then send the data to the master control board via I2C communication.<br>
 
This module is an infrared tracking sensor one that uses 5 TRT5000 sensors. The blue LED of TRT5000 is the emission tube and after electrified it emits infrared light invisible to human eye. The black part of the sensor is for receiving; the resistance of the resistor inside changes with the infrared light received.<br>
 
This module is an infrared tracking sensor one that uses 5 TRT5000 sensors. The blue LED of TRT5000 is the emission tube and after electrified it emits infrared light invisible to human eye. The black part of the sensor is for receiving; the resistance of the resistor inside changes with the infrared light received.<br>
 +
=Features=
 +
1) Uses the MCU STM8S105C4 as the controller, and the TCRT5000 infrared photoelectric sensor on each of the 8 line-follower modules.
 +
2) Adopts I2C ports which only occupies 4 pins of the MCU.
 +
3) The sensor TRT5000 is highly sensitive with reliable performance.
 +
4) With a RESET button on the board for resetting, and positioning holes on the board for easy assembly.
 +
5) Supply Voltage: 5V.
 +
6) A potentiometer is added to adjust sensitivity if the signal of the black lines is too weak to detect. Normally you don't need to adjust.
 +
 
==How to Use on Raspberry Pi==
 
==How to Use on Raspberry Pi==
  

Revision as of 01:24, 25 September 2017

Introduction

This 5-Channel Line Follower module is an infrared tracking sensor that uses 5 TRT5000 sensors. The blue LED of the TRT5000 is the emission tube and after electrified it emits infrared light invisible to human eye. The black part of the sensor is for receiving; the resistance of the resistor inside changes with the infrared light received.
5 channel line follower.png
5 channel line follower back.png
The TCRT5000 infrared photoelectric switch adopts a high transmit power infrared photodiode and a highly sensitive phototransistor. It works by applying the principle of objects' reflecting IR light – the light is emitted, then reflected, and sensed by the synchronous circuit. Then it determines whether there exists an object or not by the light intensity. It can easily identify black and white lines. In other words, the different conduction levels of the phototransistor when it passes over black and white lines can generate different output voltages. Therefore, all we need to do is to collect data by the AD converter on the Atmega328 and then send the data to the master control board via I2C communication.
This module is an infrared tracking sensor one that uses 5 TRT5000 sensors. The blue LED of TRT5000 is the emission tube and after electrified it emits infrared light invisible to human eye. The black part of the sensor is for receiving; the resistance of the resistor inside changes with the infrared light received.

Features

1) Uses the MCU STM8S105C4 as the controller, and the TCRT5000 infrared photoelectric sensor on each of the 8 line-follower modules. 2) Adopts I2C ports which only occupies 4 pins of the MCU. 3) The sensor TRT5000 is highly sensitive with reliable performance. 4) With a RESET button on the board for resetting, and positioning holes on the board for easy assembly. 5) Supply Voltage: 5V. 6) A potentiometer is added to adjust sensitivity if the signal of the black lines is too weak to detect. Normally you don't need to adjust.

How to Use on Raspberry Pi

Raspberry Pi line-following module
GND GND
5V VCC
SDA(GPIO2) SDA
SCL(GPIO3) SCL

After the circuit is energized, the power indicator LED D0 will brighten.

How to Use on Arduino

Wiring

line-following module SunFounder uno Board
GND GND
VCC 5V
SDA A4
SCL A5

After the circuit is energized, the power indicator LED D0 will brighten.

Code

#include <Wire.h>
int count = 0;
int raw_result[10];
int analog_result[5];
int high_byte;
int low_byte;
void setup() {
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
  Serial.println("Ready");
  delay(1000);
}
void loop() {
  Wire.requestFrom(0x11, 10);    // request 6 bytes from slave device #8
  while (Wire.available()) { // slave may send less than requested
    int c = Wire.read(); // receive a byte as character
    Serial.print(c, HEX);        // print the character
    Serial.print("  ");
    raw_result[count] = c;
    count += 1;
  }
  Serial.println(' ');
  count = 0;
  for (int i = 0; i < 5; i++) {
    high_byte = raw_result[i * 2] << 8;
    low_byte = raw_result[i * 2 + 1];
    analog_result[i] = high_byte + low_byte;
    Serial.print(analog_result[i]);
    Serial.print("  ");
  }
  Serial.println(' ');
  delay(500);
}

Configuration