Powering a 5V relay resets my arduino (somehow?)

Hey guys ;) Here's an interesting issue I'm currently running into and could need some help with:

I'm driving a 5V single-coil relay via a digital output pin of the Arduino. Switched is an MP3-Player normally running on a 1.5V battery, now connected to GND and a pin of the relay, which in turn connects to the 5V pin of the Arduino when the relay is powered (interestingly it didn't power up using regular batteries anymore, but powering it with 5V seemed to do the trick, even for longer periods..). Now, as soon as I set my output pin to HIGH, ordering the relay to switch the MP3-player on, the Arduino resets - somehow...

Obvious signs of the reset include: - the connected LCD display (a different one than the MP3-player's) resets - the serial connection to my PC is "broken" temporarily, so I don't receive any debug output anymore

However: - the arduino still reacts to my button pushes as usual (LCD lighting up on button push works just fine, just shows no text anymore) - when closing and reopening the Serial Monitor, I can retrieve debug output again due to the arduino resetting again - the relay is still powered after the arduino resets, meaning the MP3-player receives power just fine - if I'm using a 1 amp USB wall wart instead of the PC USB connection though, the arduino keeps resetting (you hear the constant clicking of the relay)

I already checked for short-circuits everywhere, but found nothing.. Also, if it was a short-circuit or the MP3-player would draw too much current, wouldn't the arduino just shut down itself or a fuse would blow (or something more serious)? I'm really quite puzzled as to why exactly this is happening, seeing as I've already built the entire circuit on breadboard before and it was just working fine..

So I hope anyone can give me a hint as to why this happens.. Should I maybe look for short-circuits again or could this have any other cause?

Greets, Philipp

wouldn’t the arduino just shut down itself or a fuse would blow (or something more serious)?

No you would see exactly what you are seeing.

Awesome -.- So that'd mean the whole thing is indeed drawing too much current or there's still a short-circuit somewhere? If so, how much current does the 5V pin actually provide?

Also, to fix this issue, would I be able to connect MP3-player and arduino seperately to a single USB connector (so the MP3-player gets its power from the USB connector, not from the arduino's 5V pin) which in turn plugs into the 1 amp wall wart I mentioned before?

Greets, Philipp

I'm driving a 5V single-coil relay via a digital output pin of the Arduino.

How are you doing this? Are you using a transistor? In general you can't drive a relay directly from an arduino.

Hm, it's interesting that you mention it.. the relay I'm using is the AXICOM FP2 3009 (http://www.pollin.de/shop/downloads/D340426D.PDF), coil plus wired to the digital pin, coil minus wired to GND.

As far as I understand (and as far as my testing went) I had no issues driving said relay directly from the arduino.

I had no issues driving said relay directly from the arduino.

Yes it resets. The realy apperes to take 28mA which is fine for direct connection BUT:-

You NEED a reverse biased diode across the coil to kill the back EMF.

Well, what I meant was, when I had it built on the breadboard, it ran just fine w/o resetting. Now that I've got it soldered onto my PCB, it's not working anymore..

So you say I additionally need to wire a diode to + and - pins of the relay? Not between the digital output pin and the + pin of the relay?

Greets and thanks for the help! Philipp

[EDIT]

Okay, nvm, seems like I indeed have to solder it between + and - of the relay ;)

Okay, I think my head will explode any second now…

Explain this to me:
How can my PCB receive power and work (!!) when there’s not a single (!) wire connected from the PCBs GND to arduino’s GND?? This goes against all I’ve ever learned…
Idk where the hell it would be connected to GND if not on my arduino… the Arduino’s the only power supply in the whole circuit!

Greets,
Philipp

Christoph680: Okay, I think my head will explode any second now..

Explain this to me: How can my PCB receive power and work (!!) when there's not a single (!) wire connected from the PCBs GND to arduino's GND?? This goes against all I've ever learned.. Idk where the hell it would be connected to GND if not on my arduino.. the Arduino's the only power supply in the whole circuit!

Greets, Philipp

Unless you can post a accurate drawing, what you see, we can't see. Schematics are the language of electronic circuits.

Lefty

I'll post one as soon as I get to drawing an accurate one ;) I nailed the "ghost" voltage down to analog pins passing signals to my LCD, but nevertheless, without any connection to GND there shouldn't be any voltage measurable either..

Another thing.. I'm now simply trying to connect the MP3 player's battery pins to 5V and GND on the arduino. Even this makes it crash (e.g. breaks the serial connection to the computer). I am unable to measure any current despite the player and arduino working fine. I uploaded the simple blink Sketch and despite it resetting, it continues to blink even while the MP3-Player draws power.. This appears really strange to me. Why would it reset if it can provide the MP3-Player with sufficient power anyway?

Greets, Philipp

[EDIT]

Again, nvm :D I solved that issue by powering the MP3-Player directly from the Vin pin. Now I'll just need to check if the LCD and all other components still work ;)

Okay, nearly there :D sry to bother you guys so much.. just one last question.

Is it possible that if all circuitry connected to the arduino via the 5V and Vin pins draw too much current (e.g. nearly enough to saturate the USB port) that the 3.5V pin doesn't receive enough power anymore to power components as well?

Greets, Philipp

Yes. Also note you can't take more than 50mA from the 3v5 pin anyway, even if the 5V line is not fully loaded.

That's not an issue ;) I've got a DCF77 receiver connected to the 3.5V port which only draws some uA of current. Okay, so that probably means I'll have to figure out a way to debug the controlling code and the code controlling the MP3-Player seperately :D

Thanks a lot for your kind and helpful answers! (That's why I love this community :D)

Greets, Philipp

Okay, one last quick question :D

I've got it all working now except for - strangely - the LCDs backlight.. (it's been working before)

The backlight's in series with a 50ohm resistor (higher than that and the LED wouldn't light up, so it appears to have a built-in resistor already), plus goes to arduino's pin 13 and minus to GND. Pin 13 is set to OUTPUT.

Now here's the deal: If I set pin 13 to HIGH, I can see on my multimeter that it's outputting around 5V, which is just fine. However, the LED doesn't light up. Though if I hook up the LED directly to the arduino's 5V pin, it lights up perfectly well.. This behavior applies to all other digital and analog pins as well, just in case you were wondering.

Would be glad if someone knew what's going on here ;)

Greets, Philipp

Now here’s the deal: If I set pin 13 to HIGH, I can see on my multimeter that it’s outputting around 5V, which is just fine. However, the LED doesn’t light up.
Though if I hook up the LED directly to the arduino’s 5V pin, it lights up perfectly well… This behavior applies to all other digital and analog pins as well, just in case you were wondering.

Would be glad if someone knew what’s going on here

Your LED backlight is probably drawing too much current from your Arduino I/O pin. If you connect your multimeter while the LED is also connected does it still show an output near 5V?

Don

Yes, it does ;) It turned out to be a code issue ;) Shit happens when you put digitalWrite(ledPin, LOW); everywhere for debugging and forget to remove it ;)

Grumpy_Mike: You NEED a reverse biased diode across the coil to kill the back EMF.

This fixed the same problem for me - check wikipedia flyback diode. Thanks Grump