Author Topic: PWM or change resistors for a "led blinky" project.  (Read 372 times)

0 Members and 1 Guest are viewing this topic.

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2196
  • Country: nz
PWM or change resistors for a "led blinky" project.
« on: October 10, 2018, 11:32:14 pm »
I'm working on a battery-powered LED blinky trinket, controlled by an ESP32 module and a 150mAhr LIPO - the runtime needs only be a couple of hours at most, while a conference talk is in progress.

It is just 10 LEDs that need independent blinking, each LED will be on it's own I/O pin. I have no plans of using the WiFi or BlueTooth at the moment. The hardware will be given away, so the new owner can run MicroPython on it. Because of this changing of module isn't really in scope.

This is most likely a trivial question, but is there any merit (in regard to battery life) in increasing the LED's current limiting resistor, allowing the PWM duty cycle to be increased for the same brightness?

I am pretty sure that it will make little (if any) difference in battery life if I run an LED at 2.5mA @ 50% duty cycle, vs 5mA @ 25% duty cycle... but wondering if anybody has actually done the legwork?

The only merit I can see would be if no PWM was needed, so the ESP32's processor could be put to sleep, saving 40 or 50mA. Must read the docs - maybe there is a slow clock or partial sleep mode that would still allow for PWM.

I'll be building 5 blinkies, so I there is any merit I will be able to test the theory by loading different ones with different resistors & firmware and actually testing.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.

Offline gcewing

  • Contributor
  • Posts: 22
  • Country: nz
Re: PWM or change resistors for a "led blinky" project.
« Reply #1 on: October 11, 2018, 10:37:55 am »
From what I've heard, in theory the LEDs should be slightly more efficient if you run them near their maximum rated current and use pulse width to control the brightness, but it won't be a big difference. Like you say, you might gain more by being able to shut down the processor if the pattern isn't changing.

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo