A quick tutorial on using the QRB1134 IR LED/Photo transistor with Picaxe

is.jpg

The QRB1134 is primarily used as a line detecting sensor for line following robots. Here's how it works. If the sensor detects a white surface, the IR light gets reflected, if the sensor moves over a dark surface, IR light gets absorbed.

QRB1134 is an analog sensor, so it connects to one of the analog input pins on the Picaxe. Here's how we are going to test this:

Reading through a bunch of numbers can be daunting. So in this setup, if the sensor detects a light surface (white), an led will light up, if not, the led will be unlit. Also, a graph will be plotted based on the input read. If the graph value is low, the led should light up, if the graph value is high the led should remain un-lit.

Let's hook this up! (Picaxe 28X project board)

Connect analog pin 0 to G via a 0.1uF capacitor

Connect the white wire (collector) from the sensor to pin 0, 10K resistor to V

Connect the blue wire(emitter) to G

Connect the green wire(cathode) to G

Connect the orange wire(anode) to V via a 330ohms resistor

Connect ouput pin 2 to an Led via a 330ohms resistor

Connect the batteries, usb/serial cable to the 28X proto board

 

The Code.

Key in this, download it to the Picaxe.

symbol range = b1

main:
readadc 0, b1
range = b1
'debug b1
'debug range
if range > 150 then

low 2
endif
if range < 151 then
high 2

endif

for b2 = 0 to range step 10
sertxd("|")
next b2

sertxd (13, 10)
goto main

 

Run this. Load up the terminal, set the baud rate to 4900. Now bring the sensor close to a white surface, the graph should go low and the led should light up. With a darker surface, the led will switch off and the graph will go high.

This can be hooked up to a servo to build a line following robot.

IMG_0280.jpg

Led off, graph high. Sensor over a dark surface

 

IMG_0281.jpg

Led lit, graph low. Sensor over a light surface.

 

 

Quite nice! Thanks!A) Can

Quite nice! Thanks!

A) Can you make a drawing of what is to be connected to what? Visualts may make it easyer to grasp.

B) I have used these quite a lot, but never used a capasitor? What is it for, do you know?

 

Oh - and FYI; I have also used them a lot for detecting if a small robot was on it’s way to drive over the edge of a table. They work quite nice for that - even a black table returns more signal than black nothing.

And finaly, before we get a postin of “How do I know if my IR is working?”; https://www.robotshop.com/letsmakerobots/node/78

Thanks Zack,I’m not familiar

Thanks Zack,

I’m not familiar with the QRB 1134, but I’ll check into it.

I’ve been thinking about using something like this to add incremental encoders to my robot.

What I have in mind is to put 1/4" wide strips of reflective tape on my wheels, and use 2 optical sensors

for crude speed feedback. I don’t think that I need anything with real high resolution.

With my 2 1/2" diameter wheels, I should be able to put about 15 refective strips per wheel. If I look at leading edge and trailing edge I think that I could get about 30 counts per revolution. Am I on the right track here?

Has anyone here done something similar? Or is there a better way?

Duane S

Wilson, NC USA

Thanks again Zack,I checked

Thanks again Zack,

I checked out the Fairchild QRB1134, and I think that it will do what I want.

So I’ve ordered 10 of them from Digikey. (along with some other things that I needed).

I like that they come with 24" leads, and the price is very good too.

Duane S

Wilson, NC USA

Certainly a QUICK tutorial :slight_smile:

I’m trying to hook up one of these things right now, and I must agree with fritsl: a drawing (however basic) would have been nice. I’ve read the explanation several times and I still haven’t got a clue as to what goes where?..

I also found the following image here:

qrb500.jpg

Only the colors are all wrong: orange - white - green - blue

While mine is: orange - green - blue - white (like the one posted in the topic description)

?

Looks like this will be harder than I thought :|

I am having difficulties to

I am having difficulties to understand how to connect this to the picaxe board.

Especially the second step:

"Connect the white wire (collector) from the sensor to pin 0, 10K resistor to V"

I don’t have the sensor yet, but I want to figure out this before I order. If someone could draw a simple “paint” picture it would be highly appreciated.