Electronic – Standalone ATmega168, powered by 4xAA batteries

atmegabatteriesbreadboardschematics

I'm making a small animating diorama as a present. There is a switch, two servos, and an LED; all being powered by four AA batteries and all controlled by an ATmega168 chip. I've prototyped the simple stuff on my arduino uno, but now I want to move the ATmega chip and hook up the battery pack, both of which are new to me.

I'm too new to the site to post any inline images, or for some of the links to be completely valid. I apologize in advance.

This is the design I put together in Frizting:

I've used these two articles as reference (remove the spaces):

I would be very surprised if I had it all wired up correctly. I'd be very grateful if anyone could comment on what I've done wrong.

PS. The software polls the state of the toggle switch. If the switch is on, it sets the two servos to specific values, and turns on the LED. If the switch is off, it sets the servos to difference values, and turns off the LED.

Best Answer

I'd say that 4*AA are the problem. You're using 7805 for regulation and your soruce is going to give you at most 6.4 V, but will quickly drop to around 6. You need at least 2 V higher intput voltage to use 7805, so you won't be getting 5 V at the output and AT won't start.

Also, 7805 will waste some power. If you can, try to find another way of getting the needed 5 V.

I'm not sure about the rest of it. There could be other errors too.