Deciding batteries for my circuit

  • Thread starter Thread starter bremenfallturm
  • Start date Start date
  • Tags Tags
    Circuit Leds
Click For Summary

Discussion Overview

The discussion revolves around the design of a circuit using Charlieplexing to control 12 LEDs with a limited number of microcontroller pins. Participants explore power consumption calculations related to using a CR2032 battery for a battery-powered application, specifically focusing on the implications of duty cycle on current draw and battery life.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant outlines their approach to using Charlieplexing with an Attiny85 microcontroller and expresses concern about the power consumption of their design using a CR2032 battery.
  • The initial power consumption calculation assumes all LEDs are on simultaneously, leading to a pessimistic estimate of battery life.
  • Another participant challenges the assumption that all LEDs can be on at the same time and questions the lack of consideration for the duty cycle in the calculations.
  • A later reply suggests that the duty cycle could be approximately 1/12, given the cycling through the LEDs, and discusses how this affects the average current draw.
  • Further clarification is sought on how to apply the duty cycle to the overall current draw and battery life estimation.
  • Another participant provides an estimate of average current draw based on the duty cycle and suggests that this can be used to better estimate battery life.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the initial power consumption calculations, with some arguing that the duty cycle must be considered while others clarify how to apply it. The discussion remains unresolved regarding the best approach to accurately estimate battery life based on the duty cycle.

Contextual Notes

Participants express uncertainty regarding the application of duty cycle in the calculations and the implications for battery life. There is also a lack of clarity on how to balance LED brightness with the number of LEDs turned off during operation.

bremenfallturm
Messages
81
Reaction score
13
TL;DR
My question is basically if someone can confirm that my pessimistic power consumption calculations are done correctly (I have rudimentary electronics knowledge), so I can realize that I should reconsider my design :)
Hi!

I am trying to create a circuit which can individually turn on and control 12 LEDs from 4 pins, since I am trying to adapt it to a tiny microcontroller (the Attiny85, which does not have enough pins to drive the LEDs)

For this, I am using a method called Charlieplexing. You can for example read about how it works on Wikipedia, which has a better explanation than what I can come up with. I have posted about this project in another thread, see here: https://www.physicsforums.com/threads/charlieplexing-leds-have-different-brightness.1078255

The schematics I am using can be found below, where JP1-4 are GPIOs on the microcontroller I will be using:

1739295386682.png

My plan is to use Charlieplexing to (in the worst case), light up all of the 12 LEDs, with the last one blinking, like this:
1739295548883.gif

To make the LEDs appear to be all on at the same time, I'll basically have to pulse through 12 different microcontroller pin states to light each of the individual LEDs very quickly.

I originally wanted to drive my microcontroller from a CR2032 battery, but I realize that it might not be enough to power it for a long time... (this is going to be part of a battery-powered bar-chart timer which I'd probably be using for 13 hours a day, so...)

My question is basically if someone can confirm that my pessimistic power consumption calculations are done correctly (I have rudimentary electronics knowledge), so I can realize that I should reconsider my design :)
Each LED is when lit, basically equivalent to this circuit
1739296023944.png


(note that 300Ohm equivalent resistance was an accident from my side - when prototyping I used 150Ohm resistors instead of my intended 75Ohms. But the LEDs are as bright as I want...)

I measured my new CR2032 battery to about 3.2 volts. My LED is rated ##V_f=2V## typical.

##V_R=3.2-2=1.2V##
If ##R=300\Omega## I am feeding through ##I=\frac{1.2}{300}=4\text{mA}## over each of the LEDs.

Making the pessimistic assumption that all LEDs are on simultaneously, the LEDs draw the total current ##4\cdot 12=48mA##. My CR2032 is rated at 220mAh.

The capacity over the current:
$$
\frac{220\text{mAh}}{48\text{mA}}\approx 4\text{ hours }34\text{ minutes}
$$

If I make the pessimistic assumption that all LEDs are on simultaneously, are my calculations correct? (If so I shall look for another alternative...)
 
Engineering news on Phys.org
bremenfallturm said:
If I make the pessimistic assumption that all LEDs are on simultaneously, are my calculations correct?
The "all LEDs on" assumption is impossible. Where in your calculations do you allow for the duty cycle of the LEDs?

bremenfallturm said:
To make the LEDs appear to be all on at the same time, I'll basically have to pulse through 12 different microcontroller pin states to light each of the individual LEDs very quickly.
Why do you multiply the LED current by 12, if only one is on at the time?

I would expect to find some way to increase the duty cycle to about 1/6 by considering some combination of on times, but I see no way to make it 1/1.

The "thermometer display" uses more power with LEDs, because many LEDs must be operated sometimes.
 
Baluncore said:
The "all LEDs on" assumption is impossible. Where in your calculations do you allow for the duty cycle of the LEDs?
Alright, I see your point. Am I correctly understanding that my duty cycle would be ##\frac 1 {12}##? What I currently do is that I cycle between all 12 pin states with a delay of 1ms between each of them. This would mean that one LED is on for ##\frac{1 \text{ms (each LED's individual ontime)}}{12\text{ ms (full cycle)}}=\frac 1 {12}##, right?

______
I am unsure where to continue from this, but to be more specific, let me tell you where I am stuck.

If I got my duty cycle correct, I'm not sure where to apply it. If I only consider one LED at a time (i.e. not multiplying the final result by 12), I don't see where to apply the duty cycle. One LED could always be considered to be on at each moment in time, right?

So that would mean that I'd simply not multiply by 12 for the total current draw; the total current draw at each point in time be ##4\text{mA}## and I'd instead have ##\frac{220\text{ mAh}}{4\text{ mA}}## which would give 55 hours of running time.

Or where does the duty cycle come in?
 
You would "... simply not multiply by 12 for the total current draw ... ".

The peak current at any time, (during the 12 ms scan), would be only one LED current. 4 mA.

Since, on average, 6 of the 12 LEDs would be turned on during the cycle, the average current while operating would be ( 6 / 12 ) * 4 mA = 2 mA. That can be used to estimate battery life.

In your code, you would allocate 1 ms for each LED, if it was on you would turn it on, if it was off, you would not turn it on. The result would be that LED brightness would be consistent, independent of the number of off LEDs, since the cycle would repeat every 12 ms.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 26 ·
Replies
26
Views
4K
Replies
26
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 7 ·
Replies
7
Views
19K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
10
Views
2K