How Much Current for Line-Following Sensor QRD1114??

Discussion in 'The Projects Forum' started by richardv2, Jan 29, 2008.

  1. richardv2

    Thread Starter New Member

    Jan 24, 2008
    So I ordered a bunch of QRD1114's for a line-following robot to use as black/white sensors.

    Most schematics I've ever seen put a 270 ohm or 330 ohm current limiting
    resistor in a (regulated) 5-volt setup. So my math would be:

    I = E / R = 5v / 270 ohms = 18.5 ma
    I = E / R = 5v / 330 ohms = 15.1 ma

    ..and the data sheet for the QED1114 says the max current for this device is 50 ma, so it looks like I'm seriously underpowering the LED.

    I = E / R = 5v / 100 = 50 ma
    and I verified that a 100 ohm resistor gives me the full 50 milliamps.

    The problem: I probably don't want to run these LEDs maxed out. Don't want to waste power - might burn out the LED faster, etc. So I want to reduce the power until I do *NOT* loose sensor sensitivity. I plan to run experiments at 50 ma, and down in increments until I see some change or some degradation of my results. I also see a problem that if I get it "just right", I could be low enough to get blown out by higher than expected ambient lighting if my light shielding isn't perfect.

    The question: How would you conduct the experiment I mention above? What am I looking for to tell me I have the right LED current?
  2. SgtWookie


    Jul 17, 2007
    Well, I think you're forgetting the voltage rating of the LED.

    LEDs usually have a couple of voltage ratings, a max and a typical, along with a current rating.

    Take the typical voltage, and subtract it from your supply voltage. The remainder is what you need to drop the rated current across.

    Let's say you had a red LED rated MAX 2.1V, TYP 1.8V @ 20mA, and you want to power it from a 5V supply.
    Vremaining = 5V - 1.8V
    Vremaining = 3.8
    OK, so R = E / I
    R = 3.8 / 0.02
    R = 190
    If I'd tried to figure it out the way you were calculating it, I'd wind up with:
    R = E / I
    R = 5V / 20mA
    R = 250
    which would not be correct.

    After you've calculated a resistor value based upon the LED's typical voltage and current, hook the pair up with an ammeter in series, and see how close you are to the rated current. If you're off by a considerable amount, measure the voltage across the LED, and try again with the new values. Note that the voltage across an LED won't change very much with current, until you start putting a lot through it.

    Diodes will vary slightly as to their breakdown voltage, even the same color, and even in the same batch! For that reason, you should never try to run LEDs in parallel from a single resistor, as one of the LEDs will get most of the current.

    I just read the datasheet for them.
    50mA is the MAXIMUM current for the illuminator of that device!
    The typical is 1.7V @ 20mA.

    If you run them at their maximum rating, they probably won't last very long, particularly if you have a power "glitch".

    OK, time to play with modulation ;)

    Your robot is going to need to be able to figure out the difference between a white line and a dark area, regardless of ambient lighting. You can do that by turning the LED on, take a receiver sample, turn the LED off, take a receiver sample. You'll need to do more planning that way, but it's the way I'd do it. Reading with the LED off will give you a "baseline". You may even find that the white line can be detected just by using ambient lighting.
  3. richardv2

    Thread Starter New Member

    Jan 24, 2008
    Thanks. I wasn't reading the data sheet far enough (didn't think about "working" voltage) and I see the If=20ma and Max. 1.7V, so recomputing, I get...
    Voltava Available = 5v - 1.7v = 3.3v
    R = E / I = 3.3v / 0.02 = 165 ohms
    So I'd say a 180 or 200 ohmer would be great.
  4. richardv2

    Thread Starter New Member

    Jan 24, 2008
    THANKS MORE!! for mentioning your modulation scheme.

    I'd always thought of modulation meaning that I had tu run the LED with a square wave, say 10KHz or whatever and then somehow tune the receiver to accept only that signal.

    It *never* occurred to me to compare "LED On" and "LED Off" readings. This gives me several new ideas.

    1. The comparisons, in a test mode, will give me a feel for how much the ambient lighting is interfering. (I was hoping to put a black cloth skirt around my sensors to minimize this.)

    2. Running the bot with no shielding and the LED off will tell me a lot about how/if ambient lighting works.

    This whole idea seems way better than my thought about a modulated square wave approach.