My power circuit for raspberry pi, arduino and loads. Help needed

Hi guys,

I'm new to electronics and here's a circuit I've put together for powering a pi / arduino and related gear.

9.6v battery pack 1 -> 5v BEC -> USB port -> Raspberry pi (via mini-usb) -> Arduino Mega (via usb)

On the arduino mega I have 2 signal pins, 8 and 9, going to two continuous rotation servos. The ground for one of these servos goes to the arduino ground. I then connected the arduino ground via another pin to my breadboard and the second servo is grounded here.

On the breadboard I have a second 9.6v battery pack which is going to the breadboard's power terminal and sharing ground with the arduino. Both servos are powered from this board (the +5v from the second battery pack)

This works and the BEC's are protected against reverse voltage, however when I just connect the battery pack for the pi/arduino I see a light come on on my BEC regulating the servo +5v. The servos will not run until I connect my second battery pack, however I still feel that this is less than ideal and I might do damage to some components long-term.

Is there a safer way to do this circuit? Apologies for not having a diagram but I sort of threw this together as I went and I did try to draw a diagram but I got quite confused with how to draw the grounds

Powering the Mega from the Pi is not what I would call a good idea.

The USB chip on the Pi is incredibly weak, and struggles to power more than a simple keyboard and mouse. Any more than that and you are liable to kill the USB chip (as many people, including myself on my first Pi, have found).

Power the Mega direct from an external power source, and don't use the Pi's power for anything at all - it can barely run itself without asking it to power other things.

It seems to be running fine for the moment, were you using the 1 usb port or 2 for the pi?

If I were to power the arduino directly, how would you suggest I deal with communicating the pi? Additionally would it be possible to power the pi and the arduino from one battery pack? I'm already pushing my weight tolerances with 2 9.6v battery packs

How much current can one battery pack/5V BEC provide?

BEC is rated at 3 Amp max

Looking at the Pi specs it says "The onboard USB ports are designed for USB devices using one "unit load" (100 mA) of current"

From http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1280873480 I was allowing a 35mA draw for the Arduino on its own and guesstimating ~ 20 mA per output port, 2 of which will be on at the same time all the time = 75mA draw, allowing me to add a ping sensor or similar (output and input only, power drawn from second battery) and stay beneath the 100mA for the usb port

It's generally a poor idea to design something that "Only" uses 95% of the available power,, Particularly when the 5% might mean the failure of one or more items in the design. One of my more successful Design Guidelines is... "Murphy was an Optimist"...

Doc

Yes but the guidelines of 100mA take that into account. There is a seriese poly fuse that "goes" at 180mA so you can use it right to the wire of 100mA and still have margin.

Except on the Pi where it's the USB chip that goes not the polyfuse.

Except on the Pi where it's the USB chip that goes not the polyfuse.

No. The current draw from the USB socket has no effect on the chip.

Grumpy_Mike:

Except on the Pi where it's the USB chip that goes not the polyfuse.

No. The current draw from the USB socket has no effect on the chip.

So why have so many people got a Pi with a dead USB/Ethernet chip then? And it's not the poly fuse - the crystal attached to the chip stops oscillating, so the chip isn't working.

Absolutely nothing to do with the USB current draw.

My suspicion would be a bad crystal. Crystals are notorious for being very variable and the Pi team being very new to mass production probably believed the manufacturers when they said the crystal would work. In general the factories in China tell you what they think you want to here not what is the truth.

If you’re only using 2 pins, why bother with a Mega ? a vanilla Uno will draw less power. Hooking a Pi up is going to give you all the computing grunt you’ll need. The Pi is tetchy on power and current draw, I’d give it a mile headroom…

Something occurred to me, in reading all this thread and spouting my usual conservatisn I remembered a Polyfuse data sheet I read once and there was a caution about ambient temperature. It seems that the polyfuse is a temperature sensor of a sort as it's internal temperature and not the current as such that triggers the polyfuse. Rather the effects of the current flow. If the ambient is above about 30C deg the fuse Must be derated. I don't know if this is pertinent to the issue at hand but I think it might be a point of consideration. I also think that this is a major design flaw in the Raspberry Pi in that IF the thing has a USB port it should comply with the Port Standard Definition which apparently the Pi doesn't... Another thought just occurred to me and that is If the board wasn't laid out properly there might an issue with being able to cool the polyfuse properly and that might cause the poly fuse to be damaged or in other words the layout might well have converted the poly fuse to a real fuse... I just traded a new Pi... Still unopened from Newark... for a new 64 Bit PC motherboard. I think I got the better of the deal...

Doc

I also think that this is a major design flaw in the Raspberry Pi in that IF the thing has a USB port it should comply with the Port Standard Definition which apparently the Pi doesn’t

Well it is permitted under USB standards to have a port that only supplies 100mA, it is called a one unit load.

Yes that is right about the poly fuse, I have never been a fan of them, the main use is to prevent fires when idiots wire things up wrong. I used them on access control equipment.

However, all this is well known and well discussed over on the Raspberry Forum. Most problems are blamed on the Poly fuses but in fact most problems are the actual software.

I'm using a Mega since I picked it up for the same price as a Uno and, at the time, I knew absolutely nothing about the microcontrollers so I went for the one with "mega" in the name :)

This is the prototype, eventually I'm hoping to have a few pir bump sensors and a scanning ping sensor for room mapping. This is for my college FYP, I'm going to be using genetic algorithms via the Pi to develop pathfinding and mapping techniques for the robot. My hope is that if I use different layouts of "training rooms" from a fresh start then the robot will develop different path-finding techniques BUT that if I then go on to introduce these initial program runs to the other rooms that the majority of runs will come up with a similar algorithm in the end.

Back to the original reason I posted this question though - is my power circuit, as it is, badly laid out? Leaving aside the Pi powering argument - should there be some kind of cut-off in the common ground or a couple of diodes thrown in somewhere? I'm worried that I may be allowing a possible short-circuit somewhere but I don't have the electronics experience to spot it

I couldn’t spot the circuit, sorry. Did you post it? Or just describe it?

Describing a circuit is like describing code. Not really adequate.

Either sketch it as neatly as you can and scan it in, or use a free program like ExpressSCH.

I did try to draw a diagram but I got quite confused with how to draw the grounds

I’m not sure what that means. Draw them the usual way. With a “ground” symbol. We assume all the grounds are connected together.

I'm just getting quite confused on how to draw a common ground with the arduino and the correct symbols to use for certain components. I'm sure the software will help, will post my best effort in the next hour or so