Uncategorized

QRD1114 Circuit How-to Tutorial (or “Where did I put my brain?”)

My line following/maze-solving robot has been bust for too damn long. I just spent two weeks staring at this circuit, unable to figure out why it doesn’t work. Can you see it?

QRD1114 fail

Neither could I, at first. I thought maybe the QRD1114s had been assembled backwards, but that couldn’t be right, could it? It wasn’t until I took a break and restarted from square 1 that I spotted the error, which – I’m sorry – is not in this photo. I the + and – lines connected to the breadboard were reversed, I was running power the wrong way through the circuit. When I looked at the board I saw what you see in that picture. The wires were right there in my peripheral and I missed them completely.

There’s a lesson in every mistake. What is the lesson here? Double check everything? I thought I had. Reconfirm your assumptions? That’s improbable going on impossible. I wonder how many times I will have to wire things backwards before I learn to check it every time. How many times do you have to experience a lesson before you learn and pass the class?

Below is how to wire the correct circuit. I’m using 1k resistors for the sensor and 220Ohm resistors for the IR LEDs. The dot on the top of the sensor is next to pin 1. pin 1 and pin 3 are 0.050″ longer so you know they’re the positive legs.

QRD1114 array

Here’s a single sensor in the array, isolated for simplicity.

QRD1114 single

Here’s the sample code I ran on the Arduino.

[code lang=”c”]void setup() {
Serial.begin(57600);
Serial.println(F("Hello, World!"));
}

void loop() {
Serial.print(F("0=")); Serial.print(analogRead(0)); Serial.print(‘\t’);
Serial.print(F("2=")); Serial.print(analogRead(2)); Serial.print(‘\t’);
Serial.print(F("4=")); Serial.print(analogRead(4)); Serial.print(‘\n’);
delay(100);
}[/code]

Here it is working in a robot.