Can I power attiny85 directly from usb charger or lipo battery?

I've built a small circuit with an attiny85 microcontroller. Two leds are connected to pin 0 and 1 so 4 in total. Each two leds are connected in parallell with their own 100 ohm resistors. I'm powering it all with a single cr2032 battery but it drains the battery pretty quickly. My question is can I power it with 5v from an old usb charger? I'm also thinking about a 3,7V lipo battery, can I connect it directly or should I use some kind of protection circuit?

Yes you can. You should always use protection circuit with lipo batteries.

When using a higher voltage, you would want to increase the value of the current limiting resistors proportionally.

Hi! Welcome to the Forum.

The datasheet for the Attiny 85 says it can operate from 2.7 to 5.5V. So, it'll work either with the 5V wall wart or the 3.7V LiPo.

Other tips have already been given in the previous posts.

That sounds like too little. The Arduino port should no be forced to deliver more than 10 mA.

You need to provide LED details to calculate size of current limit resistor.

I changed the resistors to 330 ohm and connected an old usb power adapter and it seem to work fine, the problem is now that the attiny85 becomes very hot after a short while. Should i connect a resistor between the adapter and the power input?

With no schematic to go by, anything would be mere speculation.

Have you even measured the voltage coming out of the adapter?

That would not happen if the power adapter was genuinely 5V and your ATtiny was not already damaged by some previous abuse.

No. A resistor is not a voltage regulator.

Like @PaulRB wrote above either your 85 is damaged or your supply voltage is above 5V (or both). If bare chip heats up a lot, there's something seriously wrong.

I'm not accusing you of some subterfuge. We've all damaged components before because of ignorance or carelessness. Mistakes are the harshest but often the most effective teachers. We can help you avoid our mistakes!

Thanks for all the replies, I removed the attiny from the circuit board and built a temporary circuit on a bread board with new leds andnow it's not warm so I guess there was a short circuit on my old circuit that I had soldered.

I wouldn't use that chip anymore for anything that has to work reliably.