How to power an ATTINY85 and 2 RGB LEDs (Newbie)

Hello,

First of all, i don't know a lot about electronics... but i'm learning.

For my first arduino project, I wrote a small program controlling 2 RGB LEDs. It basically goes from a continuous green light to a blinking pink one when I press a switch, and back and forth. I then transfered the program to an ATTINY85 and made it work without issue on my breadboard.

My problem is the following :
When i use the 5V from the arduino to power my circuit, it works, but when I try to power it with a battery, the program doesnt seem to run properly. Either the color switch doesnt happen at all, or it happens, but the LEDs doesnt blink.

From what i understand,

  • The RGB LEDs i use come from an arduino kit, have integrated resistors, and are made to run with 5V.

  • My two LEDs, being powered by different pin of the ATTINY85, are in parrallel.

  • The ATTINY85 can run using 2.7V to 5.5V.

  • Since my ATINY is set at 8Mhz, it would theoretically consume 5mA at 5V, if i understood the datasheet correclty.

I tried to power my circuit with a 9V battery and different resistors, but never got the microcontroller to run properly

With wich battery would you power such a circuit ?
Would i need resistors ? or something else ?

12V 55AH car battery with 12-to-5V 4A back converter

Why different resistors? they should be just the same, because the signals from your processor are still the same. How did you connect the battery to the board? It needs to go into the Vin pin, or use a regulator to cut it down.

You should not connect LEDs in parallel, each LED needs it's own resistors.

A 9V battery, the type known as a PP3 is useless for Arduino projects.

Powering the Attiny with 9V battery, may kill it. Check the datasheet and it will tell you 5,5V maximum.
I am not sure if you are putting resistors in series between the 9V battery and the Attiny, but that is not the solution to lower the voltage.

If you take 4 NIMH cells (4,2 V) or 3 alkaline batteries (4,5 V) you can use that to power the Attiny and a few leds.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.