Deciding batteries for my circuit

  • Thread starter Thread starter bremenfallturm
  • Start date Start date
  • Tags Tags
    Circuit Leds
AI Thread Summary
The discussion focuses on using Charlieplexing to control 12 LEDs with an Attiny85 microcontroller, aiming for efficient power consumption in a battery-powered application. The original concern was about the feasibility of using a CR2032 battery, given the estimated current draw of 48mA if all LEDs were on simultaneously. Participants clarified that only one LED is lit at a time, leading to a duty cycle of 1/12, which significantly reduces average current consumption to 2mA. This adjustment implies that the battery life could extend to approximately 55 hours, rather than the initially calculated 4.5 hours, making the design more viable for long-term use.
bremenfallturm
Messages
81
Reaction score
13
TL;DR Summary
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.
 
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...

Similar threads

Back
Top