[SOLVED] Is it safe to use a common ground when it makes the Uno turn on?

Hi all. I'm building my own quadcopter, and using an Arduino Uno as the flight controller. I'm writing the flight controller software entirely from scratch. I'm using the 3DR Radio Telemetry kit (and I tell you what, finding information on this awesome piece of hardware is really hard!).

It was all working fine when I didn't have a common ground (radio powered by lipo battery via 5V power regulator, only connected to Arduino by the two serial wires - Arduino is powered by USB) until I tried to transmit any data. It just refused to do anything, and I had no idea why until I accidentally bumped the heatsink on the power regulator with my finger and the radio's transmit light flashed. I then held my finger on the heatsink and the radio transmitted perfectly. After a couple of minutes of utter confusion, I realised I didn't have a common ground and facepalmed.

I connected the ground of the battery to one of the ground pins on the Arduino, and the radio started working perfectly again. However, when I unplugged the Arduino from the USB, I noticed that the "On" led and the pin-13 led were dimly lit. I panicked slightly and immediately unplugged the ground lead of the lipo from the Arduino.

My question is this: Is what I did safe, and why did the leds light up when I did that? I was under the impression that connecting grounds together could never break anything.

Here's some wiring diagrams in case you couldn't understand my descriptions (I forgot to say in the pictures, the blue wire is RX on the Arduino end and the green wire is TX on the Arduino end):

EDIT: Throughout this message, you can assume the radio remained powered and connected via serial to the Arduino.

You're back-powering the Arduino through the serial lines - this is a very bad idea since it can lead to CMOS latch-up on the ATmega microcontroller, potentially destroying it.

Basically you must not power a device via its signal pins, so that if there is a chance of signals being at 5V while the Arduino is powered down you need to add series resistors (try 4k7) to limit the current that flows through the Arduino pin protection diodes to a level that won't cause them damage or risk latch-up.

Ways round this are to limit with series resistors, use open-collector drive and pull-up resistor, or opto-isolation. Better still make sure the Arduino and RC receiver are powered up together.

you need to add series resistors (try 4k7) to limit the current that flows through the Arduino pin protection diodes to a level that won't cause them damage or risk latch-up.

Well I can do that easily enough...

use open-collector drive and pull-up resistor, or opto-isolation.

...but I have no idea what any of that means.

Better still make sure the Arduino and RC receiver are powered up together.

So it's safe to have the common ground as long as the Arduino is being powered normally? Hmm. Well maybe I'll add the resistors just in case I forget.

Is there an ideal resistance for the resistors? That is, you said "try" 4k7. How would I know if they're doing their job?

Oh, and just to clarify: You mean I should put the 4k7 resistors on the serial lines, right?

...but I have no idea what any of that means.

Better report that Google is broken where you live.

http://en.wikipedia.org/wiki/Open_collector http://en.wikipedia.org/wiki/Opto-isolator http://en.wikipedia.org/wiki/Pull-up_resistor

Better report that Google is broken where you live.

I honestly don't know why people link to Wikipedia for explanations. It's terrible at explaining things.

In my defence, it's a quarter to 1 in the morning right now and I'm totally not up to searching for information on new concepts. Maybe tomorrow... or rather today, when I wake up...

EDIT: Oops, this post sounds offensive; please don't be offended, I'm just too tired to write good sentences... bed time me thinks.

I think you confuse a reference work with a "xyz for dummies" style :)

I think you confuse a reference work with a "xyz for dummies" style

That's my point. I'm saying when someone doesn't know what something is (an open collector, for example), you don't point them towards Wikipedia. That won't teach them anything because it's not designed to teach them anything. You point them towards the "xyz for dummies" stuff.

Since we seem to have gotten a little off-topic (my fault), I'll ask the question again (because it's not rhetorical ;)):

So it's safe to have the common ground as long as the Arduino is being powered normally?

When in flight, how is the arduino going to be powered?

If the battery is going to power the Arduino, then wire the battery to it during production. Looking at documentation, you can have 12V input and the USB at the same time.

How much current does the radio use? Is the 7805 getting hot? I like using these in circuits now. No heat issues.

http://www.adafruit.com/products/1065

If the battery is going to power the Arduino

Yes, it will be.

then wire the battery to it during production.

Oh DUH of course! Brilliant idea! That way, even if I forget to plug in the USB before the turning on the radio, the Arduino will still be powered at the same time :D

How much current does the radio use? Is the 7805 getting hot?

About 300-400mA, I think. That's mostly a guess, though. The regulator gets moderately hot, but it's rated for 1.5A and I've run it for hours at a time without issue, so I'm not worried. Additionally it'll be mounted in the prop wash of the quad when the quad's actually flying for extra cooling.

Also, I have a buck-boost adjustable regulator coming in the mail which may be useful, but it only only handles about half the amperage of the linear regulator at best, so we'll have to see whether it's good for anything.

AND I have a second 7805, so I could power some of the equipment from that one if necessary. Plenty of options.

Thanks for your help! :)

Clonkex: So it's safe to have the common ground as long as the Arduino is being powered normally?

It's not "safe", it's just completely not negotiable.

Clonkex: Is there an ideal resistance for the resistors? That is, you said "try" 4k7. How would I know if they're doing their job?

Well, there's the question - it may be difficult to tell if a given part is not working consistently. The point is - if the devices in each direction are CMOS inputs whose input impedance is many tens of megohms, then the only matter of concern is actually the input capacitance, but 4k7 will be just fine; 47k would likely work fine also.

The regulator is only rated at 1.5A if it has a heatsink - I suspect the boost-buck regulator would be preferable.

If you are writing the flight controller software entirely from scratch, you better have an awful lot of experience already using kits.

The regulator is only rated at 1.5A if it has a heatsink

Yeah, but I’m not drawing anywhere near 1.5A. I’m only drawing at most about 600-700mA.

If you are writing the flight controller software entirely from scratch, you better have an awful lot of experience already using kits.

Nope. No experience with kits whatsoever. I’ve only ever flown a Walkera Ladybird, too :wink: Don’t worry, I’m an experienced programmer and the first flights will be tethered to the ground.