Line Sensor Breakout - QRE1113 (Analog)
-
RM7.00
- Product Code: QRE-1113
- Availability: In Stock
Description:
This version of the QRE1113 breakout board features a digital output, using a capacitor discharge circuit to measure the amount of reflection. This tiny board is perfect for line sensing when only digital I/O is available, and can be used in both 3.3V and 5V systems.
The board’s QRE1113 IR reflectance sensor is comprised of two parts - an IR emitting LED and an IR sensitive phototransistor. When you apply power to the VCC and GND pins the IR LED inside the sensor will illuminate. A 100Ω resistor is on-board and placed in series with the LED to limit current. The output of the phototransistor is tied to a 10nF capacitor. The faster that capacitor discharges, the more reflective the surface is.
These sensors are widely used in line following robots. White surfaces reflect more light than black, so, when directed towards a white surface, the capacitor will discharge faster than it would when pointed towards a black surface.
The power input and output pins are brought out to a 3-pin, 0.1" pitch header. The board also has a single mounting hole if you want to screw it onto something.
Specifications:
5VDC operating voltage
25mA supply current
Digital I/O compatible
No ADC required
Optimal sensing distance: 0.125" (3mm)
0.3x0.55"
Package include:
1 x sensor module
1x pin
Document:
Connections:
Code:
//Code for the QRE1113 Digital board //Outputs via the serial terminal - Lower numbers mean more reflected //3000 or more means nothing was reflected. int QRE1113_Pin = 2; //connected to digital 2 void setup(){ Serial.begin(9600); } void loop(){ int QRE_Value = readQD(); Serial.println(QRE_Value); } int readQD(){ //Returns value from the QRE1113 //Lower numbers mean more refleacive //More than 3000 means nothing was reflected. pinMode( QRE1113_Pin, OUTPUT ); digitalWrite( QRE1113_Pin, HIGH ); delayMicroseconds(10); pinMode( QRE1113_Pin, INPUT ); long time = micros(); //time how long the input is HIGH, but quit after 3ms as nothing happens after that while (digitalRead(QRE1113_Pin) == HIGH && micros() - time < 3000); int diff = micros() - time; return diff; }