Shop OBEX P1 Docs P2 Docs Learn Events
IR LED selection and configuration — Parallax Forums

IR LED selection and configuration

morris4019morris4019 Posts: 145
edited 2009-04-13 23:16 in Accessories
I am having a little trouble using IR LEDs (most all found inside tv remote controls and IR remote control toys). I am connecting 2 together neg (-) to neg (-) to a switch and pos(+) leads to pin 2 and pin 3 on an LM386 audio amplifier. I have used many many IR LEDs to see if the problem persists, but to no avail. I always seem to get very good reaction from one of the LEDs (I can put my hand over it and the reaction of the motor is very aparent), but the other is always a very slight change (most of the time I can't even tell unless I hold the respective motor to my ear). This last set of IR LEDs I got out of a single remote control. I know that it doesn't matter much if they are even made one after another, but taking them out of the same remote, I know that they are the same brand/make of IR LED.

Any tips on improving performance using IR LED's to sense light differences would be very appretiated. Dizzy as i call him has slowed down, gained a reverse and turn function, but still tends to go strong in one direction.

-Mike

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
======

······ I'll try everything once [noparse]:)[/noparse]

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-09 04:14
    I can't quite picture how you have the LEDs and the LM386 connected. Could you provide more information?

    Keep in mind that LEDs are not manufactured or tested for use as photodiodes. There could be a lot of variation from diode to diode.
  • morris4019morris4019 Posts: 145
    edited 2009-04-09 16:18
    That is kind of what i thought. I am actually following instructions from the book Junkbots, Bugbots, and Bots on Wheels. I couldn't find an old mouse to take apart but I had lots of old remotes, so I thought I would give it at try.

    It seemed to work great when I breadboarded it, unfortunately I have it already put together, but today I have the whole day to desolder and breadboard again. Once it is breadboarded I will take a picture of it. But I can explain how it is put together.

    Batt is 9v. Batt(+) is hooked directly to one end of a switch, and Neg to the metal frame of the robot. Middle pin of switch is used to connect power to the LM386 (pin 6). As well on Pin 6 is a lead to reverse switch and a lead to a 12v 5amp DPDT relay. (I was suppose to use a 5v or 9v relay, as shown in book, but could not find one. I found that if i used a 1000 ohm resister and a 220 uf cap I could effectively use a 12v relay.) Neg (-) of motors are run off the reverse relay. (which seems to work flawlessly) L386 (pin 5) supplys power to left and right motor pos (+). LM386 Pins 1 and 8 are soldered together. LM386 Pin 7 is not used. LM386 Pin 4 is soldered directly to metal frame of robot for ground (-). The IR emitters (used from the same remote control) are soldered together neg(-) to neg(-) which connects to the power switch middle pin for power. The pos (+) sides go to LM386 (pins 2 and 3 respectively).... whew that was a mouthfull.

    I will have it pulled apart and breadboarded today some time so if that was not enough info you will have a picture.

    -Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ======

    ······ I'll try everything once [noparse]:)[/noparse]
  • ZootZoot Posts: 2,227
    edited 2009-04-09 18:12
    IR leds are sometimes used in junkbots, because when REVERSE BIASED they act as (somewhat erratic) visible light detectors.

    I'll presume you are using a circuit much like one attached below (this is a published *corrected* version -- many editions of the book have an error in the printed schematic).

    I've built a number of light sensitive junkbots using salvaged IR leds for detectors -- as the book describes, they are nowhere near as effective as photoDIODES. I will say that you can't use them without a balancing pot so that they can be "tuned" -- this will at least help get the 'bot running somewhat straight when the light is even. See the book and there a few examples of putting a 50k pot or so between the LEDs (which acts a voltage divider so that the output of each can be matched).

    Also, I would take care that they are aligned the same, i.e., that one IR led is mounted so the cathode pin is up top, make the other exactly the same orientation.

    Additionally, the "power" LED (the green regular LED in schematic below) is necessary (IMHO) to dampen things out and improve visible light response (I believe this is mentioned as an alternative circuit in the book, but I'm not looking at my copy right now).

    Personally, in spite of some remarks in the book, I have found that photodiodes work best, cds photo resistors work second best (like those that can be had at Radio Shack for about 75 cents a piece) and IR leds work if nothing else is available (since they are so easily salvaged, though, they do get used a lot).

    Also below is an example of one of my own bots -- note that the IR leds are oriented the same -- in this case with anodes up top.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php


    Post Edited (Zoot) : 4/9/2009 6:17:28 PM GMT
    1185 x 731 - 236K
    700 x 312 - 56K
  • ZootZoot Posts: 2,227
    edited 2009-04-09 18:18
    P.S. -- I just caught that you are using LEDs from old remotes -- no reason not to, except that as Mike mentioned, the chance of a matched pair is probably about zero. One of the advantages of using an old mouse is that there are usually 2-3 matched IR leds inside, sometimes more depending on design.

    That said, some infrared toy remotes often have 2-5 IR leds instead of just one, so that the beam is widely dispersed (and powerful) for running the toy -- these might be a good source for salvage as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • morris4019morris4019 Posts: 145
    edited 2009-04-09 19:00
    Attached i have the breadboarded circuit.

    Thanks for letting me know about the LED and resistor, as you said it was an optional addative in the book so i figured i would build it first without it. It makes sense that you would need it, and I will be modifying this design to incorporate it. Also, I have found a few trimpots in my vastly growing collection of salvaged parts, so I should probably implement that as well.

    One more quick question about this circuit. I tested the motors I am now using, they are different sizes but run very close to the same speed. I originally used motors from an upgradable rc car (standard motors) that stated right on the outside that they ran at 30K rpm. Imagine how fast this little thing was going, thats why i switched. Anyway, is there an effective way to limit power to one motor to make it tunable to match the other? Would this be another trimpot?

    Thanks everyone for the help, I've been scratching a hole through my scalp trying to get this one tuned right.
    -Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ======

    ······ I'll try everything once [noparse]:)[/noparse]
    640 x 480 - 279K
  • ZootZoot Posts: 2,227
    edited 2009-04-09 19:36
    Balancing the sensors lets you match speed (for any reason, really, it doesn't have to be because the sensors are mis-matched).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-09 19:41
    You did ask for an "effective way" and the answer for that is no. There are a variety of ways to limit the power to a motor to slow it down, but the ones that work well are not simple. If you just use a resistor, you may get two motors to go the same speed at one speed, but if you change the speed or the load on the motor, that setting won't work anymore. You could use PWM (pulse width modulation), but that requires some transistors (an H-bridge), maybe a 555 timer and some other parts ... per motor.

    Trimpots are not designed to handle the current needed by the motor.
  • morris4019morris4019 Posts: 145
    edited 2009-04-09 19:50
    Ok thanks, just wondering if there was a way. I will have to just invest in some good gear motors for future use. I just didn't like the outcome of the 30K rpm (grease lightning... lol). Anyway, sorry, but i have yet another problem.

    I am implementing the 1k resistor and LED in to the mix. I've attached a picture (sorry for the poor quality, still unpacking from the move, and can't find the camea charger, so I had to use my phone.) of the changes to the breadboard. To sum it up, I originally had a jumper connecting the neg (-) leads of the IR LEDs to pos(+) power. It was on the top right of the original picture. I switched sides, so jumper from pos(+) power is now on top left, connecting to a 1000 ohm resistor. This continues on to connect to the IR LEDs as well as a standard LED. The whole setup then connects to neg(-) power back on the left side right above where it connects to pin 4 of the LM386.

    This setup gives me no power to the motors or anything. The only way I can get it to work for some reason is if I connect the final lead back to a pos(+) power source. This abviously negates the LED and resistor, but makes the motors finally turn. Any ideas?

    -Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ======

    ······ I'll try everything once [noparse]:)[/noparse]
    640 x 480 - 230K
  • ZootZoot Posts: 2,227
    edited 2009-04-09 19:59
    To sum it up, I originally had a jumper connecting the neg (-) leads of the IR LEDs to pos(+) power


    YOU MUST DO THE ABOVE OR IT WON'T WORK. I didn't see a mention of a balancing pot?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • morris4019morris4019 Posts: 145
    edited 2009-04-09 21:02
    Ok, so if i'm understanding this correctly I need to put a trimpot between IRLEDs pos(+) leads and the LM386? Or do they need to be hooked up on the neg(-) side (LED - trimpot - LED)?

    Also, when you said above that it won't work unless i have the trimpot, does this mean than with the 1k resistor and LED in the circuit that I HAVE to have a trimpot or else the entire circuit will not work? Because this circuit is listed in the book (Junkbots, Bugbots, and bots on wheels), but the trimpot is not included in the circut, just the 1k resistor and the LED.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ======

    ······ I'll try everything once [noparse]:)[/noparse]
  • ZootZoot Posts: 2,227
    edited 2009-04-09 21:17
    In my copy of the book, you will see in Figure 9-4 -- the schematic -- a variation with a 50k trim pot with the wiper going to the connection between the two IR LED cathodes (the same connection between the two leds that goes to +9v). The outer pins of the pot go to the anodes of the IR leds. Remember these are REVERSED BIASED.

    This is IN ADDITION to the 1k resistor and regular LED as shown in Wilf Rigter's mods in Figure 9-33. That is the mod shown in the schematic I posted above.

    If your figure numbers are different, I think you will still be able to find these in the book.


    Something I just thought about -- if you forward biased the leds (i.e. hooked up the cathode to GND and the anode to +9v, it is highly likely the IR leds were burnt-out (at that point, you "lit" them up with way more voltage and current than they could handle). Reverse biasing them doesn't light them up and they won't breakdown from the reverse voltage -- mostly smile.gif. You might want to try with a fresh pair. I usually hook up the IR LEDs "correctly" -- i.e. anode to +V and cathode to GND, but through a 1k resistor or so. Then I view the LED with a video camera that has a "nightshot" infrared mode. If the IR LED is lit up, then I know it's good. Never hurts to check it if you salvaged it -- sometimes a part can become damaged during removal, or didn't work to begin with, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • morris4019morris4019 Posts: 145
    edited 2009-04-10 05:19
    Ok, it took me a while to figure out that on the schematics you posted and the ones in the book, to get the std LED to light up (as if a power indicator) I had to connect an extra lead to the neg (-) terminal. This did not effect the sensativity much, but I can definitely tell that both IR LEDs are working, yet the LM386 is giving about 4.5v to one motor and only about 3.2v to the other, as tested with a volt meter... weird.

    As for the trimpot. I was testing and testing with a 50k trimpot (salvaged from an old vcr with inscription 503... thats 50k right?) and i broke it.. haha. So i could not find another at this late hour so I salvaged a 100k from the same vcr. Anyway, I have tried many configurations, but the middle lead of the trimpot is connecting in between the to IR LEDs neg(-) (which is actually getting power through the std LED), and the outside leads are connected to the pos(+) sides of each IR LED right next to the LM386. When the trimpot is included in the circuit I get NO response at all from the IR LEDs, it's like they aren't even there. BUT, an interesting thing, the std LED (power indicator) changes brightness with adjustment of the trimpot.

    Oh and I also see what you were talking about, zoot. The trimpot I guess acts like the neg(-) connection (as I stated above). So if trimpot is not connected I MUST use a neg(-) connection to the std LED, but if I am using the trimpot I DO NOT need a neg(-) connection.

    -Michael

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ======

    ······ I'll try everything once [noparse]:)[/noparse]
  • ZootZoot Posts: 2,227
    edited 2009-04-10 05:46
    Umm... that's not how I wired my phototropic junkbots. In any case, the reason for the trimpot is to pulldown one anode more than the other to balance the IR output to the differential inputs on the 386.

    Given what you're describing, you may want to try just using the trimpot and removing the 1k resistor and regular LED. The actual value of the pot isn't so critical, but it should be higher rather than lower (if in doubt), though as it gets bigger the adjustment will be way more tricky, as a very slight turn of the trimpot changes the resistance on either side quite a bit. But you could also try a 20k pot or so which will let you pull down one IR or the other by a much greater amount. A lot of junkbotting is experimenting to get the right mix of values in a sensitive analog circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • morris4019morris4019 Posts: 145
    edited 2009-04-10 15:59
    I guess that may be where I am getting confused. When I look at the circuits you have shown me and the circuits in the book they are connecting the wiper of the trimpot to the 9v source (+), and eirther side of the trimpot to either side of the pos(+) IR LED connections that are going to the LM386. I have also taken out the neg(-) connection I was talking about earlier as it is NOT needed I see now. But for some reason I get no responses from the IR LEDs with light changes, but when I take out the trimpot the IR LEDs sense light again. Is that suppose to happen?

    Sorry for all the questions, I seem to be having problems alot... lol. I am pretty new to building these robots, this is my third so far. But I am going down to the local radio shack today to stock up on a few items. (trimpots, photoDIODES YAY!)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ======

    ······ I'll try everything once [noparse]:)[/noparse]
  • morris4019morris4019 Posts: 145
    edited 2009-04-13 23:01
    Thank you everyone for your help. I ended up investing in some CdS Cells and some 47k Resistors. These work much better! Below is a picture of the finished project. I can't wait to start another one, I'm going to try and make is smaller with tracks in stead of wheels, a rechargable 3-5 v battery pack, and 2 tactile sensors instead of 1. Oh, and·i'm going to try and use less wiring with the next one (as you can see·from the photo below, there is no shortage of wiring everywhere! lol)·Thanks again everyone!

    -Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ======

    ······ I'll try everything once [noparse]:)[/noparse]
    480 x 640 - 48K
    14.jpg 48.2K
  • ZootZoot Posts: 2,227
    edited 2009-04-13 23:16
    Glad you got it working.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
Sign In or Register to comment.