※本產品原廠代理從國外進口,有些交期較長,下訂前請詢問!
![](http://twarm.com/commerce/images/seeed/Seeed Studio/SEN21177P/d.jpg)
![](http://twarm.com/commerce/images/seeed/Seeed Studio/SEN21177P/a.jpg)
Grove - Line Finder v1.1 循跡模組5V (101020009/新101020172)
Description
Most of automated robotic projects start from a line-following robot, Grove - Line finder v1.1 is designed to achieve this task easily and quickly. Those eye-like sensors on the board are actually IR emitting LED and sensitive phototransistor. When the phototransistor detects the reflected infrared light from the IR emitting LED, it will output a digital signal, which changes from HIGH to LOW.
Features
- Easy to use
- Integrated indicator LED
- Digital output
- Adjustable detecting range.
Specifications
- Power supply: 5V DC
- Digital output mode: TTL (High when black is detected, Low when white is detected)
- Connector: 4 pin Buckled Grove interface
- Dimension: 20mm*20mm
- Comparator: LMV358
- Photo reflective diode: RS-06WD
資料:http://wiki.seeedstudio.com/Grove-Line_Finder/
![](http://twarm.com/commerce/images/seeed/Seeed Studio/SEN21177P/b.jpg)
![](http://twarm.com/commerce/images/seeed/Seeed Studio/SEN21177P/c.jpg)
![](http://cimg.pcstore.com.tw/cprd/C1173863881/2.gif?pimg=static&P=1521104012)
![](http://cimg.pcstore.com.tw/cprd/C1173863881/2.gif?pimg=static&P=1521104012)
Arduinoino | Raspberry Pi | BeagleBone | WIO | LinkIt ONE |
![](https://raw.githubusercontent.com/SeeedDocument/wiki_english/master/docs/images/arduino_logo.jpg) | ![](https://raw.githubusercontent.com/SeeedDocument/wiki_english/master/docs/images/raspberry_pi_logo.jpg) | ![](https://raw.githubusercontent.com/SeeedDocument/wiki_english/master/docs/images/bbg_logo_n.jpg) | ![](https://raw.githubusercontent.com/SeeedDocument/wiki_english/master/docs/images/wio_logo_n.jpg) | ![](https://raw.githubusercontent.com/SeeedDocument/wiki_english/master/docs/images/linkit_logo_n.jpg) |
入門
第1步。準備下面的東西(Prepare the below stuffs):
Seeeduino V4.2 | Base Shield | Grove - Button |
![在這裡輸入圖像描述](https://github.com/SeeedDocument/wiki_english/raw/master/docs/images/seeeduino_v4.2.jpg) | ![在這裡輸入圖像描述](https://github.com/SeeedDocument/wiki_english/raw/master/docs/images/base_shield.jpg) | ![在這裡輸入圖像描述](https://github.com/SeeedDocument/Grove_Line_Finder/raw/master/img/line_finder_s.jpg) |
第2步。Connect Grove-line finder to port D3 of Grove-Base Shield。
第3步。Plug Grove - Base Shield into Seeeduino。
第4步。Connect Seeeduino to PC through a USB cable。
![](https://github.com/SeeedDocument/Grove_Line_Finder/raw/master/img/seeeduino_line_finder.jpg)
注意 如果我們沒有Grove Base Shield,我們也可以直接將Grove-Line發現者連接到Seeeduino,如下所示。
Seeeduino | Grove-Line finder |
5V | Red |
GND | Black |
Not Conencted | White |
D3 | Yellow |
Software Step 1. Copy the code into Arduino IDE and upload. |
//------------------------------------------------------------ //Name: Line finder digital mode //Function: detect black line or white line //Parameter: When digital signal is HIGH, black line // When digital signal is LOW, white line //------------------------------------------------------------- int signalPin = 3; // connected to digital pin 3 void setup() { pinMode(signalPin, INPUT); // initialize the digital pin as an output: Serial.begin(9600); // initialize serial communications at 9600 bps: } // the loop() method runs over and over again, // as long as the Arduino has power void loop() { if(HIGH == digitalRead(signalPin)) Serial.println("black"); else Serial.println("white"); // display the color delay(1000); // wait for a second } |
Step 2. Open the serial port and we will see "black" when put the sensor on top of black lines and "white" when on white area. |
white
white
white
black
black
black
black
black |
![](http://cimg.pcstore.com.tw/cprd/C1173863881/2.gif?pimg=static&P=1521104012)
![](http://cimg.pcstore.com.tw/cprd/C1173863881/2.gif?pimg=static&P=1521104012)
Play With Raspberry Pi 樹莓派
第1步。準備下面的東西(Prepare the below stuffs):
Raspberry pi | GrovePi_Plus | Grove - Button |
![enter image description here](https://github.com/SeeedDocument/wiki_english/raw/master/docs/images/rasp.jpg) | ![enter image description here](https://github.com/SeeedDocument/wiki_english/raw/master/docs/images/Grovepi%2B.jpg) | ![在這裡輸入圖像描述](https://github.com/SeeedDocument/Grove_Line_Finder/raw/master/img/line_finder_s.jpg) |
第2步。Plug the GrovePi_Plus into Raspberry。
第3步。Connect Grove-Line Finder to D7 port of GrovePi_Plus。
第4步。Connect the Raspberry to PC through USB cable。
![](https://github.com/SeeedDocument/Grove_Line_Finder/raw/master/img/rasp_line_finder.jpg)
Software Step 1. Follow Setting Software to configure the development environment |
Step 2. Git clone the Github repository. |
cd ~ git clone https://github.com/DexterInd/GrovePi.git |
Step 3. Excute below commands. |
cd ~/GrovePi/Software/Python python grove_line_finder.py |
Here is the grove_line_finder.py code. |
import time import grovepi
# Connect the Grove Line Finder to digital port D7
# SIG,NC,VCC,GND
line_finder = 7
grovepi.pinMode(line_finder,"INPUT") while True:
try:
# Return HIGH when black line is detected, and LOW when white line is detected if grovepi.digitalRead(line_finder) == 1: print ("black line detected") else: print ("white line detected")
time.sleep(.5) except IOError: print ("Error") |
Step 4. We will see black line detected when the sensor is on top of black line. |
pi@raspberrypi:~/GrovePi/Software/Python $ python grove_line_finder.py black line detected black line detected white line detected white line detected |
Resources |