Best way to power Arduino?

Hi. What is the best way to power a Arduino if you hook it up to a Raspberry Pi? I am using a couple of sensors and dont want to kill the Pi's power. I have been using a 12v 2amp power supply on the Arduino. All worked 100% for about a week. I wanted to reset the Arduino so I unplugged it from usb and power supply. Then I plugged it in again. All of a sudden I saw smoke and saw the voltage regulator glow red.

So the Arduino got fried. Why would this happen? Is there a spedific sequence to plug in power and usb? What is the best way to power a setup like this?

Kind regards.

What sensors? Not had a problem with this and just using USB (which is obviously simplest). Note that the Pi 5V is not stable enough for accurate analog readings.

The Arduino should auto select power between USB and the barrel jack. If your sensors need a lot of power you would be better off feeding 7.5V into the Arduino, not 12V.

The damage is a bit of a mystery - I could imagine the regulator shutting down with over temperature in normal running, but exploding like that rather suggests your 12V supply isn't 12V but a lot more? (ie it might be unregulated).

Hi MarkT. Thanks for the reply. I am using 2 temp and 2 himidity / temp probres. I am driving 4 relays as well and a servo all at once. Mark I dont understand what happened. All worked fine for about 1 week. I made some code changes and just wanted to reset all. Then the Arduino blew up. So if the power supply is not regulated should it not blow up from the start?

Ok so you recommendation would br to step down the power. Should I power the sensors with the extarnal power and the Arduino with USB power. It seemed to work with usb only power. I just dont want to overload the Pis power in the long run. I fisrt used a Yun and that is able to drive everything from its power with no problems at all. The reason I am going to the Pi is I need external wifi and more procssing power and memory. So now I am using the Pi with Arduino. All is working acept for this blow up of the Arduino.

Thank you for the help.

There is nothing you have described which would account for what happened.

Therefore something happened which you are not describing. What this was is impossible to tell because you do not know the situation you actually had. Without a detailed diagram of exactly what was connected and how we can't tell either. All we can do is guess. One guess is that you got some latch up, that is where an un-powered chip like the Arduino processor had powered signals feeding into it. There are lots of other guesses but that is all they are, guesses.

Thanks for the reply Grumpy_Mike. So lets say I did short somthing out while I unplugged the Arduino, like you say we dont know, its all on a breadboard still so it could have been that. Is the way I am powering the setup the correct and best way?

Is the way I am powering the setup the correct

Yes.

and best way?

No. You would be better using an external voltage of about 7.5V to minimise the heat generated in the regulator.

Ok great. Thanks a lot.

One thing that may explain what happened with the power - you say you unplugged the power to the Arduino, but from the initial description, it was connected to the RPi - if lines from the Pi were pulling lines up on the Arduino chip when you powered it back up that might explain it. Some chips do bad things if you force their inputs above their supply voltage (which you did if the Pi was feeding something to the Arduino when you powered it down). Some of those MOS chips act like an SCR and crowbar (turn into a dead short). Not sure in your case, but that is one possibility that comes to mind.

The only likely reason for the regulator to go up in flames is that the power supply polarity was reversed.

Of course, that cannot happen via the "barrel jack", but if power was applied via the Vcc terminal ...

Some chips do bad things if you force their inputs above their supply voltage (which you did if the Pi was feeding something to the Arduino when you powered it down).

Great answer for reply #7, pity this is what I said in reply #3.

Grumpy_Mike: Great answer for reply #7, pity this is what I said in reply #3.

Yep - I missed that part of your reply! My bad (or great minds?) :)

gpsmikey: One thing that may explain what happened with the power - you say you unplugged the power to the Arduino, but from the initial description, it was connected to the RPi - if lines from the Pi were pulling lines up on the Arduino chip when you powered it back up that might explain it. Some chips do bad things if you force their inputs above their supply voltage (which you did if the Pi was feeding something to the Arduino when you powered it down). Some of those MOS chips act like an SCR and crowbar (turn into a dead short). Not sure in your case, but that is one possibility that comes to mind.

Solets say I want to reset the Arduino in future. Should I unplug the usb and then the power. The plug the power back and then the usb. That way it will alwys take power from the power plug and not the usb. Is that correct ?

No not correct. It also will not reset the Arduino if it still has power. There is a reset button on the Arduino you can press.

I understand that. Let me write it another way. Let say I need to remove it from the Pi to reflash the sketch. What should the steps be? step 1 remove usb. Step 2 remove power. Step 3 plug in usb of pc and flash new sketch. Step 4 remove pc usb. Step 5 plug in power. Step 6 plug in Pi.

The bottom line is you want to make sure your board has correct power before applying any power to any of the other pins on the chips. If you look at the designs for boards that are designed to be "hot swapped" or "hot plugged" you will find there is a fair amount of work to make sure that happens. Typically, the ground pin is longer than the others so ground is established first, then power is switched on the card when it is correct and all inputs/outputs are protected (or switched). You either need to power everything down before connecting things or work the problem of "hot swapping" to be safe.

Hi gpsmikey. I am not doing anything funny on the power side. Not using any pins. I use a nomal power supply that plugs into the barrel jack. My question is there a certain way to power up and power down the setup I explained. If I could switch off the usb power on the Pi then I would do that. I just down want to burn another Arduino becuase I did not follow the correct way to power up the UNO

It isn't so much a case of "doing something funny" as recognizing the fact that most chips (especially in the MOS type logic world) do not like it if there is power on any other pins before the chip supply is powered up. If you look at the data sheets for the chips, they will give you a range of power for Vcc and then list the input voltages for all the other pins - you will notice that is always referenced to Vcc (the power to the chip). Taking inputs above the current supply voltage for the chip (which is zero if not powered) can cause bad things to happen.

Well, I have said my piece already.

jfourie:
I understand that. Let me write it another way. Let say I need to remove it from the Pi to reflash the sketch. What should the steps be? step 1 remove usb. Step 2 remove power. Step 3 plug in usb of pc and flash new sketch. Step 4 remove pc usb. Step 5 plug in power. Step 6 plug in Pi.

If you just want to reflash, you can do it on having external power on.
Remove usb link with PI and attach it to your programming device.
Another way I prefer in my project, I always leave programming port open and use Serial1/2/3 for communication with other devices. This gives you flexibility to program your Arduino at any time, without disturbing your circuit.
How do you have setup your whole things? Have you used any PCB? or all the boards and sensors are just hooked up with wires.

At this stage it is all still on a breadboard while I am developing. I used to use the Yun. Now I am using a Pi with Arduino as I need more resources on the processor side and I use a touch screen as I need a local interface for when we do not have wifi or if the wifi fails. I think I will test the dedicated serial and leave the usb out. Can you still flash the Arduino from the Pi using the pins and not the usb. I assume so. Thanks for the helpl.