I know Ohms Law, i know leds need resitors.

My scenario is this: I need to make a little circuit that controls 2 RGB leds with a 9 Volt battery. This gives an avergare o 5 hours of light before the battery is gone. I would like to avoid to throw all that energy away into heat. Is there an alternative, safe way to turn those leds on without wasting all that energy?

there are a few requirements tough:

  • The circuit has to be simple because it has to fit in a 7x4cm slot. so no 100 components.. :)
  • the RGB pwm will be generated by a small 12f683 microcontroller.
  • there will be an additional LM7805 in the circuit for the microcontroller, it can eventually be used if needed.


  • \$\begingroup\$ You could use PWM or you could try buying higher voltage and current RGB LEDs. \$\endgroup\$ Commented Aug 27, 2015 at 7:31
  • \$\begingroup\$ Use a step down converter to bring the voltage as close as possible to the LED voltage. This way you have only a small lose over the resistors. \$\endgroup\$
    – Botnic
    Commented Aug 27, 2015 at 7:39
  • \$\begingroup\$ I have used the LTC3622 for such purposes. Or you buy a module like this: miniinthebox.com/… \$\endgroup\$
    – Botnic
    Commented Aug 27, 2015 at 7:55

3 Answers 3


First off, LEDs don't need resistors, they need a constant current.

If you don't want to waste energy to heat, you have to use a switch mode power supply to bring the voltage down efficiently. The LM7805 is a linear regulator, it can be seen as an advanced resistor, you won't gain any energy benefits.

Based on the comment you want to connect them in parallel, basically they shall have the same colour. In this case you only need a 3 channel design and could connect them in series, so that the current will go through both LEDs. And you use standard 5 mm 20 mA per LED RGB LEDs. Good to know.

There are switch mode constant current drivers around, but they have a rather large quiescent current (roughly 1 mA per channel) so that would come to 3 mA quiescent current. They can be quite efficient (depending on the output current) and most of them allow PWM dimming. Let's throw in some ballpark numbers:

Per channel:

The current sense resistor drops 100 mV. The diode takes another 0.4 V (probably less). Because of the low current of 20 mA, the inductor needs a high inductance so the resistance is going to be a bit higher than usual, let's say 1.5 \$\Omega\$ because you want it to be small. So that accumulates to roughly 10 mW of power losses plus the IC, we end up at 17 mW of power loss. The output power is dependent on the LED voltage so assume 2.2 V for a red one and 3.2 V for the blue one, as you connect them in series the voltages will double. The output power would be between 88 mW and 128 mW. Efficiency would be between 83% and 88%.

A simple resistor with a 9 V battery would give you 24% to 35% or in a series connection 48% to 71%. So it's not that easy to decide, it will be more efficient and you will have a longer battery life, but it's debatable if you really want to go through all the trouble.

And there is a big BUT: The 9 V block will drop in voltage down to 4.8 V if you want to salvage all the energy. That makes a series connection only usable if you have a buck-boost type of switch mode supply, they are less efficient, so probably not worth the trouble again. I can't tell if a buck mode down to 6.4 V will last longer than a simple resistor down to 4.8 V. I think my second suggestion would be a better approach. Another thing to realize is that with dropping voltage the current and brightness will decrease quite noticeably for a simple resistor.

Using SMD components a 3 channel design should be doable on a 4 x 7 cm² board. I could fit a single channel in a 11 x 25 mm² area. I've used a AL8805, which worked reasonably fine.

Another suggestion would be to use a small lithium ion pack. There are plenty around for the RC hobby market. I have a pack at my desk which is just a bit bigger than 9 V block battery but has 2 times the capacity of a standard 9 V block. And as an added benefit it's voltage is 7.4 V so you will waste less energy. With that approach I would definitely go with a series connection of the LEDs and just resistors. The lithium ion pack will also hold it's voltage much better so the current won't vary much over the lifetime of your battery, which is a problem in case of the 9 V battery approach and just resistors.

  • \$\begingroup\$ thanks for the answer. I will be using 2 RGB 5 mm leds, with a maxium of 20 ma/channel. the two leds will be connected in parallel and share the same output from the pic. \$\endgroup\$ Commented Aug 27, 2015 at 11:40
  • \$\begingroup\$ @sharkyenergy I've updated my answer and added a second suggestion which I would choose over the 9 V block. \$\endgroup\$
    – Arsenal
    Commented Aug 27, 2015 at 12:20

This is an old problem that had been solved

There are many kind of LED drivers that do exactly what you want. It's actually a constant current source that switches (PWM) the input voltage (9V in your case) to directly drive LEDs without resistors. It actually adjusts the duty cycle so that the output voltage is exactly what the LEDs need.

There are many kinds of LED drivers. Check this Application note if you need to understand more about the principle of operation and some products available: http://www.infineon.com/dgdl/LED+Driving+Concepts+and+Infineon+Basic+LED+Drivers_V1.1.pdf?fileId=db3a30432f91014f012f96084ec339a3


Why do you use a 9V battery with an 7805 regulator? That 9V is much higher than you need for the PIC or the LEDs, hence you must either waste voltage*current=energy in resistors and the 7805 regulator, or you must use a (more complicated) switching step-down circuit.

A 12f683 can run on as low as 2V if you limit the frequency to 8 MHz (the LED will be a problem though).

enter image description here

You could use 2 or 3 AA or AAA batteries, or one AA LiSOCL2 battery. With these lower voltages (3, 4.5, or 3.6 Volt) the series resistor will drop far less voltage and hence less energy, and those batteries contain much more energy than a 9V battery in a compareable volume. And you can throw the 7805 out.

If you want to get fancy you could try this circuit (warning: I have never tested it, and you will need to do some calculations for the right value of the coil, depending on the frequency and duty cycle):


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ I am using a 9 Volt battery because its small as this circuit needs to be hidden in a costume. \$\endgroup\$ Commented Aug 27, 2015 at 11:42
  • \$\begingroup\$ Two AAA batteries are similar in size. \$\endgroup\$ Commented Aug 27, 2015 at 11:46
  • \$\begingroup\$ but the leds require at least 3.3V. \$\endgroup\$ Commented Aug 27, 2015 at 12:10
  • \$\begingroup\$ Three AAA batteries are a little wider than a 9V but much lower, and have ~ twice the current capacity. \$\endgroup\$ Commented Aug 27, 2015 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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