Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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?

Please help!!!

share|improve this question
1  
A schematic would be helpful. – Kellenjb Jan 19 '12 at 21:33
The common thing between the 9V battery and the 5V regulator could be some noise added to the voltage, that in the battery may be caused by the voltage regulator (that you are obviously using, right? :D) that could be switching...i'm just arguing, tell us more – clabacchio Jan 19 '12 at 21:39
Yes I am using a voltage regulator. I do not have a schematic at the moment - I will try to create one tonight I was just wondering if there was any inside into what may be causing the problem. Should I just use a software like frizzing to make the schematic? – keisi Jan 19 '12 at 21:45
1  
For schematics see electronics.stackexchange.com/questions/1024/… – Kellenjb Jan 19 '12 at 21:51

1 Answer

From the description of your problem, it sounds like the servo is causing a lot of problems with the regulation of the supply to the micro.

What I think is happening is that the servo when moving is causing either a lot of ripple/electrical noise on the supply to the micro or tripping the current limit on your regulator causing the supply to drop out (if only for microseconds - which would not be visible on a multimeter - you would need a oscilloscope to see this) - either of these can cause the micro to be very unpredictable.

I would suggest using 4 AA batteries to power the servo, and a separate supply to the micro to prove this (you only need a common ground or negative for it to work)

Just a simple question what are you using for your 5v supply - what is it's maximum current ? - servos can take a very high current (over 0.2 amps to 2-3 amps depending on rating of servo and how much effort it need to move)

share|improve this answer
I tried 3 different power supplies one was USB through the arduino which works great. The second was a 9v battery on the breadboard through a regulator which has problems, and the third is this wall wart (sparkfun.com/products/8269) also on the breadboard through a regulator which causes problems. – keisi Jan 19 '12 at 22:32
Sounds like your regulator is the common thread of failure and matching up with what wonko is talking about. – Kellenjb Jan 19 '12 at 22:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.