I bought an Arduino Uno a few days ago.
I programmed an ATtiny45 using an Arduino Uno following "How-To: Shrinkify Your Arduino Projects" video on YouTube.
I uploaded the blink example successfully. I altered the sketch in a way so there is also a blinking on pin 4 (which is ATtiny45 pin 3).
Now, if I connect +5V from the Arduino to ATtiny45 pin 8, ground to pin 4 and the LEDs from pin 2 and 3 to ground everything works as expected.
But if I use 4 AA batteries instead of the power from the Arduino I only get a blinking on ATtiny pin2.
What could be the reason for this behavior? Is it because I use 4 AA -> 6 V instead of 5 V? I tested it also with 3 AA batteries and got the same result.
So why does it work if I use power and ground from the Arduino but not from the batteries?
-
1I just used 2 AA batteries and it worked fine.7twenty7– 7twenty72017年04月16日 16:35:16 +00:00Commented Apr 16, 2017 at 16:35
-
6V is no problem for the Uno. It likes 7-9 volts better (to keep the regulator chip cool) but can go from 5-12 volts.SDsolar– SDsolar2017年04月17日 04:46:09 +00:00Commented Apr 17, 2017 at 4:46
-
Welcome to Arduino SE. Be sure to take the tour at arduino.stackexchange.com/TourSDsolar– SDsolar2017年04月17日 04:46:22 +00:00Commented Apr 17, 2017 at 4:46
1 Answer 1
If you take a look at Attiny45 datasheet, you will find at the very first page:
Operating Voltage
1.8 - 5.5V for ATtiny25V/45V/85V
2.7 - 5.5V for ATtiny25/45/85
Your circuit will have unpredictable behavior out of this range. If you want to use four AA cels, you can organize them to have a 3V output or use a step-down voltage regulator.