Let's Make Robots!

Cheap home made IR compound eye

Allows your robot to see and track nearby objects
Mr._General.bas5.15 KB
Compund_eye_instructions.jpg1.24 MB
Mr__General.zip3.24 KB

The purpose of this cheap, easy to make eye is to allow your robot to track movement of nearby objects (within 200mm). After much experimentation and various degrees of success I have finally got a good working design for my IR tracking system which is really a simple 4 element compound eye. Compound eyes are found in Arthropods such as insects. They are of relatively low resolution compared to the human eye but more responsive to movement. Unlike Insect eyes, my design includes it's own light source and is blinded by excess ambiant IR making them better suited to indoor and nocturnal activities.

In my earlier designs I used a transistor to amplify the signal from the phototransistors but this caused some problems with calibration and did not increase the range as much as I had hoped. When I did increase sensitivity to about 500mm I ran into other problems such as a white wall in the background reflecting light better than an object such as my hand causing my robot to look away from my hand instead of towards it.

The eye consist of 4 IR LEDs and 4 pairs of photo transistors. The phototransistor pairs are connected in parallel to increase their sensitivity. The phototransistor pairs are then connected to your analog inputs the same way you would connect an LDR. This circuit is really 4 FritsLDRs but using phototransistors instead of LDRs. The main reason for this is that the lens on the phototransistors makes them more sensitive to light directly in front of them and because LDRs are very slow to respond to changes in light.

The demonstration video is of a new robot being produced by DAGU called Mr. General. He is basically a "Start Here" robot based on my Bot 08M. Click on the schematic for a larger picture.

 As you can see, the eye is very simple to make. Using it to guide two servos in a pan/tilt mechanism is a little more complicated. I have included the sample program used in the demonstration video to try and help. Mr. General is designed to work with any processor but unfortunately I can only provide a sample in picaxe basic at this time.

The program basically compares left and right inputs for pan, up and down inputs for tilt. The bigger the difference, the faster the servo needs to move to follow the object. Another thing the program does is look at the average value of the inputs to gauge distance. The closer the object, the higher the readings. This is used to scale the results and prevent the servo from over correcting.

Having said that, I haven't perfected the scaling yet. at the moment, the program divides the readings to get a scale factor but since the light returning to the sensors is inversly proportional to the distance² I should really use a square root funtion in calculations. As a result of my crude scaling technique the robot seems to have developed a bit of personality. It likes one of our technicians and behaves well for him in the first video but does not like Claudia and shakes it's head at her (due to servo overcorrection) in the second video.

For those who would rather buy than make one, DAGU will soon have these available as a robot accessory.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I have QRB1134 sensors that are usualy used in line following or encoders. Can I just place 4 of those to follow stuff?


This is the specification of the sensor from the official page:

"The QRB1133/1134 consists of a infrared emitting diode and an NPN silicon phototransistor mounted side by side on a converging optical axis in a black plastic housing. The phototransistor responds to radiation from the emitting diode only when a reflective object passes within its field of view. The area of the optimum response approximates a circle of .200 inch in diameter."

The two biggest issues with using the QRB1134 are that:
• Neither the LED or phototransistor have lenses, so they're not very directionally sensitive.
• The LED and phototransistor are angled towards each other, which means that when an object is more than an inch or so away it can't be seen at all.

sure you can - but 0.2 inches is VERY small - 

0.2 inches = 0.508 centimeters

but perhaps it's possible to boost the phototransistor output signal - and the input signal too, if the transmitter LED can cope with it, but it sounds like you won't be improving on matters much.

The thing to gain from using a machined housing like the QRB113 is that (presumably) the alignment of the LED and phototransistor is more accurate than you might otherwise get by fiddling it yourself. keep us/me posted on your progress?

I tried using the QRB1134-s without boosting anything (I don't know how to do that :D), and it works, it could follow my hand when very close (allmost touching it), and a box covered in aluminum foil when on 2-3 cm away, but it wasn't very precise and sometimes it would get false readings and run away from the box or move to fast towards it, passing it...

And i forgot to add, it could see the box when further away (around 10cm) but the following was terrible

Then it seems to me that the only thing that you get from the QRB1134 is a nice spanky housing for the LED and PT - if, as TF mentioned below,  the two are not paralell, then your range is compromised (although not having them with focusing lenses might mitigate that problem a little, at the expense of sensitivity)

I've made quite a few of the compound eyes that are described here,  with slightly varying degrees of success of course, but always with a range greater than about 10-15 cm (about 6 inches).  Bear in mind that the sensitivity of the eyes changes depending on the amount of ambient sunlight - there are pretty spiffy ways around it - such as pulsing the IR LED, and then filtering out all light that doesn't have the pulse frequency; node/18461  but that's a bit spanky to start with, in my opinion.

Odbott's circuit might be a good one to try to make, but I get the impression you're not very certain how it works, and perhaps you would like to try a few experiments to explore the properties of transistors, LEDs and the like, first?

as an example:





shweet :)

i might add an attiny, and have it talk to my mega with i2c, to free up some pins

You need to tell us exactly what detector you are using. Is it an LDR, a photo transistor or sdomething else. What is it's part number? Plus you should read the manuals, particularly manual 3 in this case.
Thank you for trying to help me with this isue but i have got my SFR04 working now so dont need to build an IR range finder if i have a problem building one next time which i shouldnt as i will buy the corect components and such i will be back if i have a problem. Thanks again for the information provided. im working on a new project now in which my SRF04 will track anything closer that 15cm away so ill do a post on that once i have it coded properly or if i hit a bug :).

sorry im using IR there not servos i dont have a clue where who ever got that from,  the scmatic isnt my own i pasted the wrong picture so my cincear apoligies. anyway i was trying to make an IR range finder and failed my problem was not the building of the circuit just that once i had built it the blomming thing just gave me crazy readings or nothing at all at one point i got a reading but its wasnt any thing good i kinda give up on this for anyone else out there ( BUY ONE ) <<< thats only if you dont have a clue i just wanted to better myself. 

thanx anyways guys n girls 

Both your picture and your circuit drawing fail to provide the information necesary to establish why it doesn't work.

I can't tell if that is the GP2D120 IR Sensor or a servo on the bottom right in picture. It's connected to the l293d by the looks of it which means it's a servo I hope. And it looks like you are using discrete ir led and phototransistor. Fritzl's code was written for use with a GP2D120 IR Sensor and analogue input 1 on picaxe. It is not universal code and will only work with that setup.

If you are using something different you must set it up according to it's datasheet. Hopefully you have that.

Correct me if I'm wrong but that is what it appears from your picture and circuit drawing.