The Alpha Geek – Geeking Out

Project #7: RGB LCD Shield – Line Sensor Breakout – Mk07

Line Sensor Breakout – QRE1113 (Analog)

Description

This version of the QRE1113 breakout board features an easy-to-use analog output, which will vary depending on the amount of IR light reflected back to the sensor. This tiny board is perfect for line sensing applications 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 Ohm resistor is on-board and placed in series with the LED to limit current. A 10k Ohm resistor pulls the output pin high, but when the light from the LED is reflected back onto the phototransistor the output will begin to go lower. The more IR light sensed by the phototransistor, the lower the output voltage of the breakout board.

These sensors are widely used in line following robots – white surfaces reflect much more light than black, so, when directed towards a white surface, the voltage output will be lower than that on a black surface.

The power input and analog 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 the board onto something.

Features

* 5VDC operating voltage
* 25mA supply current
* Optimal sensing distance: 0.125″ (3mm)
* 0.30 x 0.55 “ (7.62 x 13.97 mm)

Common Reflectance Sensor

The QRE1113 is a common reflectance sensor often used in robotic line followers. The sensor works by shining an IR LED down and seeing how much of that light bounces back using a phototransistor. Because dark colors will bounce back less of the light, the sensor can be used to tell the difference between white and black areas. So an array of these can be used to help a robot determine where a dark line is on the ground so it can follow it. But they can also be used to determine proximity under an inch.

The an analog input on your microcontroller but still need an analog reading of how much light was reflected. It does this by allowing you to charge a capacitor on the board, and then timing how long it takes to discharge. The more light that is reflected, the less time it takes to discharge the capacitor. Hooking the QRE1113 to your Arduino is very simple. It just needs power (5V), ground, and an analog pin.

DonLuc1807Mk11

1 x RGB LCD Shield 16×2 Character Display
1 x Arduino UNO – R3
1 x ProtoScrewShield
1 x Line Sensor Breakout – QRE1113 (Analog)
3 x Jumper Wires 6″ M/M
1 x Half-Size Breadboard

Arduino UNO

CRS – Analog 0
GND – GND
VIN – +5V

DonLuc1807Mk11p.ino

// ***** Don Luc *****
// Software Version Information
// Project #7: RGB LCD Shield – Line Sensor Breakout – Mk07
// 7-11
// DonLuc1807Mk10p 7-11
// RGB LCD Shield
// QRE1113 (Analog)

// include the library code:
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>

Adafruit_RGBLCDShield RGBLCDShield = Adafruit_RGBLCDShield();
#define GREEN 0x2

// Seven-Segment Display
int iQRE1113 = A0;       // iQRE1113
int iQRE1113Value = 0;   // iQRE1113Value

void loop() 
{

  // QRE1113 (Analog)
  isCRS();

  delay(2000);
  
  // Clear
  RGBLCDShield.clear();
  
}

getSeven.ino

// Line Sensor Breakout - QRE1113
void isCRS()
{

  // Display
  // Set the cursor to column 0, line 0  
  RGBLCDShield.setCursor(0,0);
  RGBLCDShield.print("QRE1113 (Analog)");       // Line Sensor Breakout - QRE1113

  iQRE1113Value = analogRead(iQRE1113);
  
  // Set the cursor to column 0, line 1
  RGBLCDShield.setCursor(0, 1); 
  RGBLCDShield.print("iQRE1113 = ");            // iQRE1113
  RGBLCDShield.print( iQRE1113Value );          // iQRE1113Value

}

setup.ino

// Setup
void setup() 
{

  // set up the LCD's number of columns and rows: 
  RGBLCDShield.begin(16, 2);
  RGBLCDShield.setBacklight(GREEN);
  
  // Display
  // Set the cursor to column 0, line 0  
  RGBLCDShield.setCursor(0,0);  
  RGBLCDShield.print("Don Luc");           // Don luc
  // Set the cursor to column 0, line 1
  RGBLCDShield.setCursor(0, 1);
  RGBLCDShield.print("QRE1113 (Analog)");  // Seven-Segment Display
  delay(5000);

  // Clear
  RGBLCDShield.clear();
 
}

Don Luc

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories
Archives