Serial Errors - Uno + Servo


I’ve posted here (and several other places) before about serial issues with a project I’m working on.
Steadily, with the help of the arduino and coding community, I’ve eliminated problems with my project’s serial connection.

First, I got rid of a generic 9ft USB extension cable and physically mounted the computer closer to the arduino. This greatly improved the reliability of the serial connection.
Then I stopped using an off brand Arduino system (Diavolino) that used an external FTDI converter. I got an Arduino UNO.

The UNO worked well, and didn’t have any serial crashing issues at all… Until yesterday.
Yesterday I noticed that the system would turn the servo to lock the door (locker() function). But when it called the unlocker() function, the servo would feebly twitch and then remain still. The arduino is powered off USB, and the servo is powered from an independent 5V source. Both circuits were grounded to the arduino. I could only get the servo to receive the correct signal from unlocker() by wiring the 5V servo power to the arduino as well. I’m sure that the servo is fine, it is a full-metal high-torque servo, and I can test it on a separate controller without any issues.

I find the whole situation extremely frustrating. I’ve replaced the cable, the arduino, changed methods of connecting to its serial port four times, and the problem doesn’t seem to be fixed. I need a system that can work for weeks without intervention, and I just don’t see how the Arduino platform provides that.

I’ve tried two serial libraries in C++, but am now just using PuTTY to connect to the arduino and send data from a card-reader.

I’d appreciate any ideas, or suggestions to debug the system.


SuiteLock.ino (7.54 KB)

how much current does your servo eat, and how much current can you supply

if your putting supplies in parallel to get things to work, I bet its not enough

You have a high torque servo and a sketchy 5v power supply for it. Possible suspects. If it worked and then stopped, maybe you knocked some wiring lose. The arduinos seem to work reliably for hundreds of other people, so I’d imigine your issues are particular to your setup.

Tomorrow something will work, and the clouds will part, and the sky will be blue .... for about an hour.
Some people are just plain cursed, that's how life is, I'm not alone. Enough philosophy, so

What is the servo being used?
What is the power supply for the servo?
How long are the wires from the servo supply?

I would think things would work worse when using the same power source for both servo and Arduino,
so ???

Running the Arduino off the power in the USB cable may be a problem with servo systems, I rarely do it.

For my part, I "always" use extra electrolytic [eg, 220 uF] and bypass [0.1 uF] caps on the servo power
distribution point, to help filter servo motor noise.

Thank you for the replies!

I'm not sure why I missed including the servo model the first time. It's a 1501MG 6V servo.
I'm taking a 6V 500ma power supply and feeding it through a 7805 with two 22pF caps.
The servo power supply is four feet from a gutted wall-wart to the 7805, and within another foot of wire from there to the servo..

oric_dan, I'm aware that I'll label my thread 'cursed' but it's just me not understanding something here xP You mention not using USB power. How would I accomplish that without losing the serial connection?


I'm taking a 6V 500ma power supply and feeding it through a 7805

That doesn't sound good - your servo wants 6 volts and you're reducing it from 6 via a voltage regulator. I suspect you're not even getting 5V. Your wallwart can provide 500mA, the general rule of thumb I've seen here recommends an amp per servo. In short therefore, your issue is likely power related - see if you can scavenge up a more hefty supply.

I found a 20V 3A laptop PSU lying around, I'll try wiring it in.

Thanks wildbill!


That might be a bit too hefty - if your 7805 survives, it'll need a lot of cooling. Perhaps see what you get if you wire the 6V supply to the servo without the voltage regulator at all. You'll still be underpowered, but somewhat better off.

I think you’re right.
I tested the (19V 3A) setup with a multimeter and got 5.01V, which is encouraging. The 7805 has a small heatsink attached to it, and I can feel that it got pretty warm.

I’m loathe to try the 6V without the 7805 because I don’t think it’s regulated, and I can’t afford to lose the servo (while there are several 7805s lying around).


Well in that case, it looks like a 7806 or three would be a useful addition to your parts box. Since you have spare '05s though, perhaps it's worth trying with the laptop power. I'd be more inclined to find another wallwart - if you're anything like me, you'll have a plethora of them from long defunct devices. Alternatively, do you have any 7812s or similar to do a cooler two stage stepdown?

Ah, I actually do have some 7812s somewhere…

Unfortunately, I moved from my nice basement into what I can best describe as a ‘people kennel’ at my university. So I had to leave behind all of my wonderful odds and ends :frowning:

Would I want to wire the two 7805s in parallel? I heard that’s a bad idea from an earlier thread…


No, I simply meant that if you have spare parts, you could see if one of the 7805s can do the job with the 20V input. If it overheats & fails, at least you have a replacement available & for that one you will know that better cooling and/or lower input voltage is required.

Right, gotcha.
Exactly, I’d much rather burn out a spare 7805 than an Arduino or servo!

I found a 7812. I like the idea of stepping down 20V to 12V, and then taking the 12V down to 5V in two steps. Are there any foreseeable problems with doing that?

I stand corrected. My circuit uses two 10uF capacitors on the 7805.


Are there any foreseeable problems with doing that?


You can add a small diode to the 7805 ground like below to up the 7805 output voltage to ~5.7v for better servo performance.

Osgeld, thanks!
zoomkat, neat, I’ll give that a try!

I tried using a diode (replaced the red wire in image). The voltage went from 5.01V to 4.95V. Would the capacitors have anything to do with that. Also, then I wouldn’t be able to use the 5.7V with the Arudino, right?
The image is just a generalization of how the circuit is laid out.



You probably have something wired wrong. Also, using a 9v transistor battery to power a servo won't work for long. Replace the 9v battery with four ~1.5v batterys supplying ~6v directly to the servo like below. Radio shack has battery holders if needed.

x_x Sorry about that. I have a full 19V PSU for the system, but I couldn't find something like that in Fritzing, so I made two 9Vs to show ~18Vin.

Didn't even think about parallel/serial. Sorry again for the confusion.


I tried using a diode (replaced the red wire in image). The voltage went from 5.01V to 4.95V

the diode will do that, all diodes have a voltage drop across the junction... 0.7volts is a good generic guess, but the exact number depends on the exact diode, temperature, etc. Though the datasheet is usually pretty good about nailing it down.

I thought the idea was that adding a diode would increase the voltage at the 7805 around +0.7V?

You can add a small diode to the 7805 ground like below to up the 7805 output voltage to ~5.7v for better servo performance.