I am looking to power 9 IR LEDs 850 nm with a forward voltage of 1.7 V and current of 100mA. i want to make a circuit where i can use a small power supply or could I use the raspberry pi to power it? Can i use the GPIO pins directly without causing harm to my Pi. If not, which other power supply option do you think I could use? I want to make the setup small and portable. I need to turn the LEDs ON for a short duration like 5 seconds. I would be happy to receive suggestions. I am new to electronics, please help me out!!!!!

Update: I would also like to know if it would be possible to control the brightness of the LEDs to 3 different levels, such that one is just dim, one is bright and the other is in between the two brightness levels. I was wondering if i should use a PWM pin of the raspberry pi to achieve that but i am not sure how.


The power needed will be 1.7 V * 0.1 A = 0.17 W

GPIO pins cannot be used directly, because for most MCU the absolute max rating is between 10 and 40 mA.

For the power supply you have lots of options. You can e.g. use a 5 V adapter.

For the 4 times 2 LEDs in series you need the following resistors:

V = I * R <=> (5 - 2 * 1.7) = 0.1 * R <=> R = 1.6 / 0.1 = 16 ohm

And for the power through the resistor:

P = I^2 * R = 0.1^2 * 16 = 0.16 -> So a 1/4 W resistor will do

For the leftover LED:

V = I * R <=> (5 - 1.7) = 0.1 * R <=> R = 3.3 / 0.1 = 33 ohm

P = I^2 * R = 0.1^2 * 33 = 0.33 -> So a 1/2 W resistor will do (or 2 66 ohm resistors in parallel)

The power rating for the adapter will be 0.17 W (and probably you also will power the Raspberry from it).

  • \$\begingroup\$ Thank you for your reply. Can i use a combination of batteries or a power bank? \$\endgroup\$ – Rajat Apr 16 at 8:43
  • \$\begingroup\$ Yes, as long as you have at least 1.7 V... although you also can use a step up/down converter... Make sure you have a little bit of headroom (so at least 2.0 V or so for your power source). \$\endgroup\$ – Michel Keijzers Apr 16 at 9:01
  • \$\begingroup\$ So as i checked there are these CR2032 batteries, so can i connect 1 CR2032 battery with the combination as you mentioned above, right? Thanks for bearing with me:) \$\endgroup\$ – Rajat Apr 16 at 9:09
  • \$\begingroup\$ Yes, but note that if the batteries are not new, the voltage will down gradually, resulting in less voltage. 2.25V seems better, 2V is maybe not so useful \$\endgroup\$ – Michel Keijzers Apr 16 at 9:11
  • \$\begingroup\$ Okay i understand:) Thanks \$\endgroup\$ – Rajat Apr 16 at 9:13

No, your controller will not be able to source 100mA through a GPIO.

Instead consider doing something like below, where you drive a transistor to enable your IRLEDs. In this case the current to drive the LED comes directly from the power rail.

With multiple large current sinking LEDs connected to the power rail also consider some large reservoir capacitor to avoid your supply drooping.

Make sure to size the resistors appropriately to limit the current through the LED and also to limit the current drawn from your controller.

Also I would not drive the LEDs to their full rated current, you should limit the current to about half that to prolong the life of your LEDs. If you need them to be brighter you might find you can drive them up to 0.5A or even 1A by pulsing them. Read the data sheet for your LED to find out.

Does the Rpi have a DAC ? I am not familiar with it. If it does have one, that is an easy way to control brightness. If you go the PWM route you just alter the duty cycle to control brightness.

enter image description here

  • \$\begingroup\$ Thank you for your suggestions. Pi does not have DAC:( \$\endgroup\$ – Rajat Apr 17 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.