I was prototyping a project (basically a servo and piezo controlled by a button with some LEDs to indicate the state) everything was going fine. So I decided to take the project off the ardiuno board and test it on a breadboard before soldering up the components.
To do this I followed several tutorials for taking the Atmega328 off the arduino and mapping the pins to the crystal and caps and adding a power regulator. But when I try to power it via a 9v battery or a 5v wall wart it acts really weird. The servo responds, then does not respond - or randomly moves about - so it seems like I have a timing issue or my button state is fluctuating.
The thing is this only happens when powered through the "power regulator" I set up - a 5v regulator and some caps. If I leave the Atmega328 on the breadboard and I plug in my arduino board via USB to my computer and just run a wire from 5v and ground to my power rails everything functions perfectly.
I have checked the voltage on the power rails using a multimeter and it is 4.96 (so it is the correct voltage) - I thought it might be an issue with not converting AC to DC - but the same thing happens with a 9v battery. Does anyone have any idea what is going on?