user24285: 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?

user32573: 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.

24285: <p>I bought an Arduino Uno a few days ago.</p>

<p>I programmed an ATtiny45 using an Arduino Uno following "How-To: Shrinkify Your Arduino Projects" video on YouTube.</p>

<p>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).</p>

<p>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.</p>

<p>But if I use 4 AA batteries instead of the power from the Arduino I only get a blinking on ATtiny pin2.</p>

<p>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.</p>

<p>So why does it work if I use power and ground from the Arduino but not from the batteries?</p>
 32573: <p>If you take a look at Attiny45 <a href="http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf" rel="nofollow noreferrer">datasheet</a>, you will find at the very first page:</p>
<blockquote>
<p>Operating Voltage</p>
<ul>
<li><p>1.8 - 5.5V for ATtiny25V/45V/85V</p>
</li>
<li><p>2.7 - 5.5V for ATtiny25/45/85</p>
</li>
</ul>
</blockquote>
<p>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.</p>
