Standalone Arduino power supply trouble

I have made a minimal standalone arduino (atmega168) running at 8Mhz. (http://arduino.cc/en/Tutorial/ArduinoToBreadboard)
I'm now trying to run an arduino version of this http://monsterminibow.com/gunsafe on it, but instead of opening a gun-safe I'm opening my dorm room from the inside using a servo. Arduino, servo and the fingerprint scanner all runs of the same power supply.

If I run the standalone with 5v from my duemilanove powered with usb the sketch runs just fine, but if I try to run it off an old 5V router power supply it acts really weird, restarting, hanging or doing nothing whenever the right fingerprint was scanned and the servo is supposed to start turning.

I measured the voltage from the duemilanove to 4,83V with everything connected, and the router power supply to 5,17V. So I thought the voltage difference was the problem. However when I tested with my regulated power supply set to 4,83V the same problems occurred.

I've also tried powering it directly from usb on my computer and with another 5V phone charger, but still only power from the duemilanove makes it run smoothly.

Anybody out there got a clue?

Is the old 5V router power supply regulated? Is it a wall wart? How many milliamps does your project need? How many milliamps can your power supply give. How are you providing power to the fingerprint scanner and the servo?

That circuit doesn't seem to have decoupling capacitors on it. Try putting 0.1 uF between VCC and Gnd (pins 7 and 8) and also AVCC and Gnd (pins 20 and 22). I'm guessing your router power supply is a bit noisy.

mrtaylor:
Is the old 5V router power supply regulated? Is it a wall wart? How many milliamps does your project need? How many milliamps can your power supply give. How are you providing power to the fingerprint scanner and the servo?

Microcontroller, fingerprint scanner and servo all runs of the same power supply and peaks at around 125 milliamps.
I have no idea if the power supplies are regulated or not, are there any easy ways to check? The router supply can provide 2,5 amps and the phone charger 550 milliamps.

[quote author=Nick Gammon link=topic=63094.msg458089#msg458089 date=1307257715]
That circuit doesn't seem to have decoupling capacitors on it. Try putting 0.1 uF between VCC and Gnd (pins 7 and 8) and also AVCC and Gnd (pins 20 and 22). I'm guessing your router power supply is a bit noisy.
[/quote]For the router supply this didn't work. It worked as it should up until the servo was in "door open position" and then the reset happend. However if I used the phone charger with the capacitor it worked as a charm, at least with initial testing.

Only difference between them is that the router one runs effectively at 5,17V and can provide 2,5 amps and the mobile charger runs at 4,95V and can provide 550 milliamps. So why would the phone charger work and not the router one?

Another weirdness is that when I checked the current drawn with my multimeter, using the router supply, everything worked as it should, only slower. Blink was slower and servo rotated slower than usual. Why is that?

Interesting. Read this:

http://www.alternatezone.com/electronics/ucurrent/

Effectively measuring the current changes the voltage.

siggivara:
Only difference between them is that the router one runs effectively at 5,17V and can provide 2,5 amps and the mobile charger runs at 4,95V and can provide 550 milliamps. So why would the phone charger work and not the router one?

Also is it "can provide" or "does provide"? Did you measure it under load?

Really? I had no idea. Thanks. It's a good thing to keep in mind.

I measured the voltage, but the 2,5 amps and 550 milliamps was written on the power supplies. I measured my circuit to draw around 125 milliamps at max load.

Yes but did you measure the voltage when the circuit was operating? Especially when reset occurred. An unregulated supply might drop the voltage under load. If you can't see the word "regulated" on the supply it might be supplying a nominal 5V, which could drop under load (probably would).

I concur with your analysis NIck. This sounds like either the power supply has a lot of ripple (in which case i would recommend a 100uf capacitor in parallel with the 0.1uf power decopling caps) or cant supply enough current. I would strongly recommend the authour of this thread to get a higher voltage supply like a 9v one, and use a linear voltage regulator like the 7805 to get a perfectly regualted supply. Microcontrollers are fickle beasts, they need a precision voltage supply.