Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC controlled resistance

Status
Not open for further replies.

Dan East

New Member
Hi all. I am sending data from a PIC via IR. I wish to control the intensity of the IR LED via the PIC (for two reasons - to control range, and to conserve battery). Obviously I can't do PWM. What is the simplest (and hopefully that means cheapest) method to control resistance programatically?

Thanks!

Dan East
 
Dan East said:
Hi all. I am sending data from a PIC via IR. I wish to control the intensity of the IR LED via the PIC (for two reasons - to control range, and to conserve battery). Obviously I can't do PWM. What is the simplest (and hopefully that means cheapest) method to control resistance programatically?

How large a range do you wish to control?.

You are wrong in that you can't do PWM, you can, and it's VERY easy - you're modulating the LED at 38KHz or so, all you do is alter the mark/space ratio of the 38KHz :lol: This controls the power nice and simply!.

If you want to change the actual current through the LED it's easily done using seperate I/O pins, driver transistors, and current limiting resistors. For full power you use one I/O pin, transistor, and limiting resistor, for less power you use a different I/O pin, transistor, and limiting resistor. Use as many as you need for the different powers.

This rather clever idea isn't mine! - it's used in the magazine Robot Cybot, one of the issues adds an IR ranging type of board, and it uses the multiple transistor method. Even cleverer it uses then to send a digital data word - with the earlier bits at full power, and the last few at gradually reducing power - so the word you receive is a direct indication of the range (see why I think it's clever!).
 
You might try one of these digital pots. I've used a few before and they're really easy to work with. I think they're about $6 at digi-key

**broken link removed**
 
Nigel Goodwin said:
If you want to change the actual current through the LED it's easily done using seperate I/O pins, driver transistors, and current limiting resistors. For full power you use one I/O pin, transistor, and limiting resistor, for less power you use a different I/O pin, transistor, and limiting resistor. Use as many as you need for the different powers.

Or you could have a 2.2k series resistor for the LED tied to +5v while the LED's cathode is pulled to ground by a transistor or PIC pin. Then additional 2.2k series resistors are tied to PIC pins. Those pins can be set to 1 to increase the current or floated (not zero) to leave them out. Of course the limiting factors are that the LED must be driven with Vdd and the current contributed through each pin should not exceed PIC max. And the reg has to supply all the LED current when Vdd is used for LED power.

Digital pots aren't really called for here, they're too expensive for such a simple task.
 
This rather clever idea isn't mine! - it's used in the magazine Robot Cybot, one of the issues adds an IR ranging type of board, and it uses the multiple transistor method. Even cleverer it uses then to send a digital data word - with the earlier bits at full power, and the last few at gradually reducing power - so the word you receive is a direct indication of the range (see why I think it's clever!).
that's a cool idea :idea: :idea: 8)
 
Nigel Goodwin said:
You are wrong in that you can't do PWM, you can, and it's VERY easy - you're modulating the LED at 38KHz or so, all you do is alter the mark/space ratio of the 38KHz :lol: This controls the power nice and simply!.

I'm using IrDa at 9600 baud at the minimum pulse length to conserve batteries. The amperage is pretty high because the duration is so short. Probably around an amp.

Thanks for the suggestion regarding using transistor switched resistors in parallel. I'll look at that further.

The cost of the digital pots isn't too terribly bad for the precision they offer.

Dan East
 
Dan East said:
The cost of the digital pots isn't too terribly bad for the precision they offer.

No, but you don't require that precision, and you would need extra circuitry to convert the digital pot value to a decent size current for the LED.

BTW, 1A or so is pretty standard for an IR LED - you mention IrDa, so presumably you're only wanting very short range?, as IrDa is generally only used at short range?.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top