Powering ATTiny85: 7.4V battery with diode drop Versus 3.7V with boost to 5V?

Hiya!

I have a question about battery power.
I'm programming an ATTiny85 via a Nano V3.0 to run some LEDs, which is going OK.
My question concerns Battery Powering this little project.
I've read that the '85 can ONLY handle up to 5V input, and it seems (although I can't really tell...) that only 400mA can be input. I'm looking at using rechargeable 18650 Li-Ion batteries as (hopefully) a balance of small size and run-time, with ability to recharge rather than discard.

First, is that 400mA input limit correct?
Second, and this is the main question:
is it preferable to have a 7V battery pack and use diodes to drop the voltage?
or is it better to use a 3.7V battery with a DC-DC Booster to get the 5 volts?

Third, if the booster is preferable, I did see one that puts out 5V and 480mA, so is it OK to just use resistors to bring that down to 400mA?

Apologies if this is a simpleminded question, but I'm trying to learn too much too fast and my brain is turning to mush, LOL! :wink:

Thanks!

just give it 3.7v without boost converter.

The ATtiny85 MCU will run on any voltage between 1.8 and 5V, and 3.7V is convenient. If you have a particular ATtiny module you are planning to use, post a link to it.

1 Like

5V max is correct. But your power supply/battery can have current output rating as high it is. 400mA or 4A or 40000mA, all are good.

The power supply or boost converter cannot force current into the ATTiny. The current the supply sources will be whatever current the ATTiny and any other parts draw from the supply. So you don't have to worry about that so long as the supply is able to provide what might be needed. We don't know what "some LEDs" means, so we can't tell whether a 480mA converter is likely to be big enough.

In general, using a 3.7V lithium and a boost converter to 5V makes charging from a 5V supply simpler. But that may depend on what your project is all about, and whether there are periods during which it doesn't draw much current (no LEDs lit up).

As @jremington says, we need to see what module you're using since it may have a regulator already on board.

Hello @kmin,

Thank you for such a fast reply!
I so far have four working in Wokwiki (I cobbled-together a Sketch to get them flicking and blinking)
Will that be enough to drive 4 to 5 LEDs....?
Nothing else will be included - it's just the micro-controller, the resistors, and the LEDs. Well, and the battery, once I take it from Wokwiki into "Real Life".

I just wanted to be sure before I order the batteries, holders, and charger; if one battery will drive this, that saves me several dollars I can put to more parts, Hooray! :grinning:

Thanks @kmin, I missed the part about current! Ooops.
I haven't seen the current rating for the battery - only that it's rated at 2500mAH and 3.7V.

You don't tell what battery and what kind of Attiny setup. Bare chip, some dev board ..?

Hello @ShermanP, and thank you also for such a quick reply!

I really appreciate that info about the current being pulled out by the components, rather than push by the power supply!!!
To be embarrassingly honest, I've long been confused by that :o

My mini-widget will have 4 blinking/flickering pico-LEDs ((I'm making a fireplace for a 1:100 scale miniature...)) and posssibly one that's constant on, tho' I haven't gotten that to work in Wokwiki yet.
I'm going to try to post a link to the setup so far.

Generally that's not enough info, it could supply anything between max 2A and 30A.
In your case for sure it's enough for Attiny85 and few LEDs. :wink:

1 Like

OH sorry @kmin ...
Just one ATTiny85-20pu, one (since the answers have indicated it's enough :smiley: ) generic "3.7 Volt 18650 Rechargeable Battery" (Amazon), resistors as needed, and so far, 4 single-color pico-LEDs that are flickering; hopefully, I'll be able to add one more that just stays lit, either warm white or yellow, depending.

I also wasn't sure whether the microcontroller acts like a separate power source for each LED individually, or acts like a parallel, or serial, connection for the LEDS, so that was another reason I was confused about how many batteries I'd need.

Anyway, that's the whole kit'n'kaboodle... I know it's stupid-simply, but for my very "right-sided" old brain, starting from Zero with Arduino just a very few weeks ago and getting to at least have the Wokwiki simulator work (also had to learn to use that...) has been a bit like climbing a mountain, LOL! :wink:

I posted a link to my Wokwiki project in another post...

The goal of all this is that it's for a 1:100 scale fireplace inside "Christmas Houses) I'm also designing and building from scratch, so the LEDs are by necessity the "pico" size prewired 0404 size ((I had first gotten un-wired ones and even with my glasses, I can't even see the soldering pads, but the pre-wired things are surprisingly sturdy...)).

I know I can buy individual 0402 LEDs that are already set up to flicker, but I'm obstinate and just got it into my nutty head to make my own :wink:

@kmin - 2A to 30A?!?! Holy cow!!! I absolutely did not know that. I actually never even thought about it until I wanted to power my micro-project and was afraid of frying the ATTiny... So that's great info for me!

And @ShermanP had told me that the battery does not "push" current, but rather, the chip and the LEDs "pull" the current they need - and I never knew that, either :o

I have tried to read/study DC electronics on my own, both online and through purchasing a few books, but they leave out the little, but vital, details like that. So all of this is great AND the people here are incredibly generous to answer my questions :smiley:

Just the ATTiny85-20pu - the one with 4 "legs" along 2 sides (I haven't yet "graduated" to development boards in my "self-directed learning" :wink: ):

Again, generally not enough info... Ok, if they are bare LEDs, for sure your battery is enough. But if you don't have specs for the led, it's difficult to know if they have some "built in" resistor or not. Anyway you need to make sure you limit the current draw with series resistor down to <20mA.

Yep. They can supply a lot of power. And you have to be aware of it. I have a chain saw for gardening powered by 3x 18650 cells.

1 Like

From your Wokwi simulation it looks like you've got things well in hand. So now about the battery charging. Does you battery have "protection" built in? Mainly over-discharge protection so the battery voltage doesn't drop too much, which can damage it. The typical TP4056 charging module comes in two varieties - one provides a protection circuit for use with batteries that don't already have one, and one with just the charger. You need one protection circuit somewhere, but not two.

Also, what will be the source of your charging power? Will it be a 5V USB charger that you plug into the mains socket, or something else?

Look at adding a TP4056: this is a fixed battery charging circuit using standard 5V USB to charge your battery.

p.s. the ATTiny85V is the 1.8V variant. No V only works on 5V.

1 Like

@kmin - OH! OK, I see what you mean now...<blush...>

The Components:
• LEDS: Bare but with wires soldered on - I'll add the resistors:
[1] Two Warm White / DC 3V / IF max=20 mA (each with a 51 Ohm metal-film through-hole resistor)
[2] One Yellow / DC 2V / IF max=20 mA (plus 115 Ohm metal-film through-hole resistor)
[3] One Blue / DC 3V / IF max=20 mA (plus 47 Ohm resistor)
[4] One Orange or Red / DC 2V / IF max=20 mA (plus 115 Ohm resistor)
• One bare ATTiny85-20pu
• One mini "perf board" to support the parts
• One battery holder + "No-Name" 3.7 Volt 18650 Rechargeable 2500mAH
Button-End battery
• 28 gauge wire if needed

@ShermanP - Thank you for taking a look at the Wokwiki file!
I feel absurdly proud that I got it to work, LOL!

  • The battery does not have anything built-in...I didn't know about including over-discharge protection so that's something additional I'll have to look at...

Regarding charging, I started to look into including a charger as part of the circuit, and saw some of the aspects you mentioned ... that's a bit too much for me to digest at this point, especially with the miniatures to still build. So,
I decided it will be best for me at this stage to get these things done, and spend the $5-$7 or so to buy a battery charger for each miniature and send it as a separate unit of the gift, just so that the recipients can recharge if need be. The single-battery chargers are not much bigger than a battery holder, so I should be able to set aside a space in the "basement" of each miniature to store it, even with the parts needed for the rest of the lights in the house. Well, plus the music box movement.

But thank you for the information! I'll tuck it away for future reference as I get a bit better at this.

Meanwhile, at least the purchased charger has a high probability of being safe to use, whether I get the one with a USB-plug, or a "wall wart" version that's very compact.

%Whew%! :wink: :wink:

I recommend Brand-Name (Samsung, LG...) original batteries. They give you what they promise, they are generally more safe and they have much longer charge/discharge cycle life. Better investment even with triple price.

1 Like