Tuesday, December 4, 2012

IR Photoelectronics Learning

You remember the robot Eye I made earlier, right? This was after figuring out how a photo resistor works- varying the resistance it provides to a circuit, and, if balanced against another resistor going to ground, creates a variable voltage divider, meaning that the point in between the resistors will have varying voltage depending on the light hitting the Eye- making the Eye a simple and direct motor controller to make a "photovore" that chases a flashlight around.

Anyway, there are several other types of light sensing devices, and since I wanted to learn robotics and electronics, light sensors seem to be a very important thing to learn about.

After salvaging some photodiodes from an old mouse (the kind with a track ball in the bottom), and other photoelectronics I could recognize in other various old electronics (old TV remotes were an obvious choice), and buying some from radio shack now and then over the months, I now have a rather full assortment of gizmo's.. which I never really figured out how to work.

I followed instructions in the Junkbots book (the book that let me know where to find free goodies in "broken" stuff lying in closets and garages everywhere), I had made a "headbot" that spins in place following a light around, using some exotic "bicore" method that made the pulses of the motor going left-right-left vary according to the light hitting the two "eyes". Pretty cool, and worked just fine.. but I had no real idea how it worked. Not really.

So, tonight I dumped the photoelectronics drawer of my little tackle box shelves, and got to work... getting them to work. heh. I noticed that most of the parts were IR (infrared), so, obviously I needed an IR LED to trigger the sensors, right? I tried a TV remote, but I guess the pulses were very rapid or something, nothing seemed to work, so the first step was to build my very first IR remote control, to test these things and see how to make them work.

And here it is, in all its scratch built, "still trying to look cool" glory. I read on the data card for the IRLED's that the voltage to put to them was "1.7v MAX", so a single AA would do just fine. A momentary push button meant I now had my very own IR flashlight... that I couldn't see any light coming out of...
 




...but my camera could see it! Turns out that digital cameras use some kind of CCD light sensor to see and record the image, and this CCD was able to see slightly beyond Human visual spectrum... obviously! This rather bright LED was completely dark as I shot this pic.. Pretty neat!
 
So, with that done, I got to making a breadboard thing that I could aim the IRLED at to make it do something. So, I set up the board with a 5v relay, wired to show a red LED when it was off, and a green one when it got turned on. It was going to get turned on by the photo diode I chose getting hit by IR light.
 
It didn't work, all by itself. You can see the faint purple of the IRLED coming from the light, and bouncing off of the detector I was using, but the relay wasn't energizing. THIS was the "problems" I was dealing with previously in ever trying to put these neat little sensors to work. But today, I vowed to dig in and tinker with it!


I tried having the power the photo diode let through when light hit it power the base of an NPN transistor. Still nothing. Then I got my meters out. With the 6 volts coming from the blue power supply, and the .7 or so Voltage drop expected from the diode, there should be enough to energize the 5v relay, yet not enough was "getting through". In this picture, you can see that the power the diode is letting through is 3.5v or so, so its already about as high as it can go, but the transistor wasn't "turning on enough" to let the relay click on.


So I began thinking... maybe the relay is too power hungry for the diode or transistor to energize it? I knew the transistor was strong enough, as it had done it before on previous tests with other things, so I knew it was the photo diode not giving enough "oomph" as it were.
 
If the diode was doing all it could do, then the problem was to make it do what >>I<< wanted it to do, by somehow taking the power it was leaking though, and have it be enough to turn on the relay. So, I got a bit unoriginal, and had the diode enable the first transistor, which would enable a second transistor, hopefully making that small change at the beginning bigger and bigger each time I used the transistor to "amplify" the "signal" (Junkbots book taught me that a little "push" at the base means a BIG push through the transistor:: amplify)
 
So, with it all rewired, with a double chain of transistors, I wired up my meter to the final power output of the last transistor, leading off to the relay, far right. This pic shows, even with the ambient desk light, the feeble push from the photo diode was already resulting in 3v waiting at the relay. With more direct IR light hitting it, it should easily trip the relay on now.
 
 
Same light as before, but now with the IRLED adding to the punch, Success! I will admit to a little giggle of delight seeing that green light come on (and almost blow out with too much voltage going through it!!). Weird thing is, the voltage at the meter probe didn't really change much.. but the relay clicked... hrmm. Current maybe?
So far I have only been using variances in voltage to make transistors do things, and thought that the transistors let out more voltage as well.. but now think there may be more going on in there than that. Oh well, that's some learnin' for another time. Now its time to show off!
It may not look like much, but I love that it is all home made, self taught, and actually working! Not shown, but what I did later was add even more transistors the the amplify chain, to see if it would increase the actual range of the sensor's "sight" beyond the roughly 2 foot range it shows above. YUP! each transistor seems to add about a foot! This particular IR sensor is the best I played around with so far- its "view" being all around, as opposed to the other types that had to be a dead on hit with the light to do anything.
 
So this is another Queue card sketch on my file, and another gizmo I'm going to take off the breadboard and make into a purpose built device: "a wheeled Robot tester"; something I can just stick to the motors of a chassis/toy/home built Frankenstein creation, or whatever, put it on the ground, and use my remote to see if the motors are going the right way, the wheels are straight, if it pulls to the left or not, etc.


No comments:

Post a Comment