External Power problem

02 Apr 2012

I have using an mbed with a gyro and 6 servo's for a robotics project. I am using a 6v power source (4 AA batteries) for the servo's. When I take the mbed off the USB and put it onto the 6v power source the power light just blinks on and off and the servo's sort of stutter. The mbed should run on 4.5-14v on the VIN, so I am not really sure why it would be doing this. It seems like the mbed is sucking power, with the mbed out of the circuit it will read at 6.03v solid, with it in the loop it drops down to about 5.7-5.8...

Any ideas?

02 Apr 2012

You sure you got the 6V connected to Vin (pin2) and Gnd (pin1). Is anything connected to Vu? Note that this output only has 5V when you have the mbed powered by USB.

Maybe your batteries are almost dead and the voltage drops quickly below 4V when you put a load on them and comes up again when the mbed switches off. Are you measuring the 5.7 Volts on the mbed pin2 with a 'slow' multimeter that cant keep up with fast changes and shows an average. Try disconnecting one or more servos to test this. Could also be some noise feedback from the servos. Try some capacitor filtering on the 6V.

02 Apr 2012

Vin is connected to power in parallel with the servos, while the gyro is running off pin40(vout). All the servos and the mbed share ground. Nothing is attached to VU, although I measured the power coming off it when the mbed is powered on from the battery and it would read less then 1v.

I just put in a fresh set of batteries. That helps a little, but if I have more then 3 servo's in the parallel circuit it starts to get twitchy if a couple of them are moving simultaneously. My multimeter probably is 'slow' as you put it, it is your garden variety Craftsman, nothing too fancy. Unplugging 1 servo brings it up to 5.94, while unplugging a second will bring it back up to 6v. I'm not really sure what you mean by capacitor filtering...

03 Apr 2012

Maybe the servos cause noise on the power supply resulting in mbed resets. Try using separate 6v battery supply for the servos and the mbed Vin to test that. When that removes the problem you can try decoupling the shared powersupply by installing a 220 uF elco and a 100 nF capacitor close to Vin. Capacitors in parallel, between Vin and ground. You would need an oscilloscope to really check the Vin for noise.

03 Apr 2012

The external battery does appear to clean up the problem. Unfortunately I do not have an oscilloscope, nor do I have access to one, but since the seperate power supply clears up the problem I think your idea is pretty solid. Just to make sure I fully understand you I drew up a fast diagram(forgive the sloppiness I am working from a tablet).


These look like they would do the trick: http://www.radioshack.com/product/index.jsp?productId=2103623&filterName=Brand&filterValue=RadioShack http://www.radioshack.com/product/index.jsp?productId=2102510&filterName=Brand&filterValue=RadioShack

03 Apr 2012

Wim suggested 100nF (0.1uF) which is good for high frequency decoupling.

03 Apr 2012

Damn, I misread the post. Thanks for catching that before I ran out and grabbed the wrong one. I already have a 0.1uf, saves me a few bucks.

03 Apr 2012

I'm investigating analog noise on my mbed. I have 4x NiMH cells powering the module with 22uF tant bead and 100nF ceramic smd close to pins 1 and 2, but still have noise on my DAC outputs. The DAC noise and supply noise are similar with spikes at 1mS and bigger burst at 10mS, so some kind of couter noise? Noise is low at 5mV, but still significant.

03 Apr 2012

Noise problems from servos/(high current) motors/relays can be real nasty. The shielding on mbed is not optimal. See other problems with ADC and DAC, some issues with nReset picking up noise. There are also some reports that the magic chip and/or ethernet chip inject noise. You may try to power them down when you dont need them. Part of those problems are due to the fact that you have only one GND pin on mbed and no separate supply for digital and analog.

Anyhow, hope the caps help to fix it. Could still run into issues that require more brutal filtering: beads in power and gnd lines to servos, separate caps. Separate power and gnd lines from the battery to mbed vin/gnd and to the servo supply and gnd (so power and gnd lines are only connected at battery and not looped from batt to mbed to servo).

03 Apr 2012

One thing most people forget is that thin wires cause their own problems,

The resistance goes up significantly with current.

Also poor cable loom design can be an issue.

If you daisy chain every thing, then you are asking for trouble.

If high current, then use 'STAR' connections.

Eg, 6 pairs of wire from capacitors access battery,

And capacitors across micro, sensors etc.

Hope that helps


04 Apr 2012

Tried powering down magic chip and ethernet chip with no results.

So I added the capacitors on the VIN/GND, unfortunately that did not solve the problem. With a second power source working fine, I am thinking the easiest course for me may be to pick up a small lightweight(ish) battery such as a 9v and use that as a power source for the mbed. Board space on this project is a primary issue, so a secondary power source may be my best bet, and I imagine a 9v would be able to power the mbed for a substantial amount of time.

Adding extra capacitors for each servo I would imagine would work, but like I said the board must fit into a very small container, which undoubtedly would not fit with the extra hardware. I'll be picking up the leads for the battery tomorrow and update on how that goes...

04 Apr 2012

The hint about powering down magic and ethernet chip was intended for Kevin Hobbs. I did not expect that to fix your problem. Have you also checked the wiring instructions as suggested by Ceri and me. The capacitors for each servo would have to be only small value like 100 nF. These are physically small too. You could also try adding a small series Resistor in the powerline to mbed that forms an RC filter with the capacitors. A value of 10 ohm or so should still keep the voltage on Vin above 4V. Some ferrite beads in the powerline and gnd line would also help to reduce hf noise.

04 Apr 2012

The servo's have no wiring instructions that I could find aside from voltage specification (5-6v) and wire color meaning. I could be wrong...but I thought that the mbed wants at least 4.5v on VIN, just taking a quick look at a spec card, if it dropped below that I would think it would cause problems?

I am going to be out to a hobby store tomorrow so I will pick up those capacitors along with a secondary power supply, I'll get to the bottom of this one way or another ha. Hopefully the small capacitors will do the trick, but if not an extra 2 ounces or so I would gain by a 9v would have little impact except that it would raise up the center of mass slightly, which would actually be useful.

04 Apr 2012

Wiring instructions refers to using separate wires from each servo directly to the battery and also separate wires from the batt directly to mbed. So no daisy chain running from one to the next. The wires should not be too thin. The value of the R depends on the mbed current. Should probably not drop voltage below 4.5V. You need to measure that and experiment a bit.

04 Apr 2012

Ok, I've never heard that term before, I am a little new to most of the electronics work. If they all lead directly to the battery isn't it effectively just a parallel circuit, just squished close together? That is what I have going on right now, I have a power rail that everything attaches into, no one component is getting its power from the ground of another (that is my understanding of the term daisy chaining).

I would never have thought of my wires being a problem, that was a good thing to check, but after a quick look I realized all the wires I am using are actually a slightly heavier gauge then those that come on the servo's or those that came as the battery leads. Making me think they would probably not be a cause of any problems.

I just tried throwing a 10ohm resistor on there this morning, without having any 0.1uf capacitors on hand to put on the servos, and it would seem that is not effective to filter just VIN/GND, with the resistor on VIN, a 0.1uf and a 220uf capacitor between VIN and GND. Still getting some serious stuttering, and blinking of the power light on the mbed.

I'll be picking up the supplies today, both a secondary power supply and the needed capacitors. If those don't work I will just go forward with the secondary power, I am on a very tight schedule so losing a couple days to this already has me nervous.

04 Apr 2012

This is what i meant,


Appologies for quality,

Mbed on left. Battery in center,

Servos on right.

also 10 Ohm resistor next to MBED,

NO Caps. on drawing, but you still need them.

Hope this makes things clearer.


04 Apr 2012

Could this not be a simple brownout problem? A servo can draw up to 1A when it starts moving, and it'll usually jitter about when you reset the micro, so six of them are unlikely to leave enough left for the mbed from a 4AA battery pack.

I suppose a large enough filtering capacitor on the mbed side of that 10 ohm resistor would keep it going through the current surges. My beermat maths tells me 220uF would give you ~ 3ms before the mbed browned out.

Cheers Tom

04 Apr 2012

How "big" are your servos? Depends on their resistance and the inner resistance of your batteries. You have 4 batteries in series, so Ri is 4x larger than of a single battery. Assume an inner resistance of 100mOhm per battery means 400mOhm. If now your servo also has 400mOhm, your batteries will deliver only half of their assumed voltage.

04 Apr 2012


You may want to try replacing the 10 ohm resistor with a diode. That will cost you about 0.7 volts to Vin, but it will allow the 220 uF capacitor to 'ride through' any battery voltage drops during (brief) high servo current spikes. You also may need a larger capacitor at Vin, say around 1,000 uF (to insure a long enough ride-through time, based in the mbed's current draw and the minimum required Vin). If the mbed draws 200 mA, a 10 ohm resistor would produce a 2.0 V drop from the (average) battery voltage to Vin, vs. the diode's 0.7 volt drop from the battery's peak voltage plus 200 mV per mS of ride-through (at 1,000 uF vs 200 mA). So, the diode would be better than a 10 ohm resistor for up to almost 7 mS of ride-through. With the diode, the reduced current draw from turning off the ethernet and magic chip would extend the ride-through also.

06 Jul 2013

Same problem here. I have servo that draws 200mA from supply voltage (Vin is 5V, 2A). I have read about solution with diode and capacitor, but what I am worried about is that voltage drop from osciloscope image attached - last cca. 100ms. Would 1uF capacitor be enough? What diode should I take?

/media/uploads/zhivko/img_4782.jpg /media/uploads/zhivko/img_4784.jpg

06 Jul 2013

any shotky power diode rated at above half amp. 1N4001.. 4are quit good.

but 100uF or more should be used,

on both sides of diode. especially MBED side. a 100nF would-be good as well.

hope this helps.


07 Jul 2013

Ok I used shottky diode and 3 times1000uF in front of mbed but with no difference.... problem remains.

when I removed moisture sensor (http://www.dfrobot.com/index.php?route=product/product&filter_name=SEN0114&product_id=599#.Udl_4fn0Guk) analog input from p20, servo works without problem :) - I mean when it works it doesn't disconnects mbed.

If I just connect p20 to wire to it, mbed led starts glowing? isn't that weird?

So it must be something with analog input on p20. How should I connect it? Should I put some resistor 10k to GND?

Also if I test with two power sources (USB from computer to mbed) and separate 5V 2A to Vin of mbed, there is no problem with power supply.

07 Jul 2013

zhivko me wrote:

when I removed moisture sensor (http://www.dfrobot.com/index.php?route=product/product&filter_name=SEN0114&product_id=599#.Udl_4fn0Guk) analog input from p20, servo works without problem :) - I mean when it works it doesn't disconnects mbed. If I just connect p20 to wire to it, mbed led starts glowing? isn't that weird? So it must be something with analog input on p20. How should I connect it? Should I put some resistor 10k to GND?

Beware that mbed analog inputs are NOT 5 V tolerant. The input voltage must be between 0V and 3V3. The picture above seems to suggest that you provide a 5V powersupply to the moisture sensor. The analog input voltage could go beyond 3V3.

Note that the mbed is powered from the highest voltage source: either USB from the PC or your external Vin. The spikes from the servo are probably better suppressed by a small capacitor and/or by a separate lowpass filter between Vin and the servo power in pin.

07 Jul 2013

You are right regarding 5V supply to analog sensor - I changed it to 3.3V on MBED now. The averaging analog input seems that quite fixed the spikes from servo but still it's not 100%.

How should I connect capacitor to servo?? Simple sketch would be most appreciated.

Here is my latest design :)


07 Jul 2013

Not sure where you have placed the capacitors and diode. Doesnt look like you are separating the mbed and servo supply as suggested by Ceri. Try the schematic below.


Note that 1000uF close to mbed is maybe a bit high. Could reduce that to 220uF. You could also add some low pass filter to the servo supply, say 10ohms serial resistor between the 5V external input and the 1000u capacitor. In that case you should also connect the anode of the diode directly to your 5V external supply.

08 Jul 2013

Sory, i am not from electronics world... I see capacitors marked with 1000u, but what is 100N (thinking should it be 100ohm) and simbol =? From school days I thought both should be capacitors?? Maybe picture is too small to see units correctly... Sory to bother you but seems to be I just can't read picture correctly....

This is my last shot - with that configuration - same problem remains and there is another anomaly - the analog input is drifting down... the capacitors are both 1000uF (just have such big ones by the hand). /media/uploads/zhivko/img_20130708_010640.jpg

08 Jul 2013

100N (should have been written as 100n) is "100 nano Farad". This smaller capacitor will filter some of the spikes caused by the sudden current increases from the servo. However, servos are like any other inductive load and they cause lots of nasty spikes on supplylines. You may need additional filtering to get rid of that.

Not sure about the analog input drifting. Could be caused by the load of your measurement probe, by thermal effects (sensor is heating up when power is supplied and higher temp changes its outputvalue) or by software issues.

25 Jul 2013

OK found what was it. It was bad quality power supply - I used Chinese power supply (came along with the mk808 android device) that was rated with 2A output current. Adding diode and capacitor didn't help. When I used Manson switching mode power supply hcs3302 - it turned out that 500mA is enough for both - servo and mbed. The same was true if I connected board to PC Usb (turning servo have not power out mbed).

Does somebody know is it possible to lower Brown-out detection voltage on NXP LPC1768? I think - out of the box it is set to 3.5V.