Pages: [1] 2   Go Down
Author Topic: Serial communication failure when using power supply  (Read 2658 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm working on a project that requires the arduino uno r3 to be powered by a separate power supply AND have the usb cable connected to a PC for serial communication. When using a separate power supply, the board will reset sporadically and serial communication will fail after a few minutes. To isolate any cause I have disconnected all wiring from the arduino pins, and am just running a bare board. It still resets randomly and has serial communication failure when using the separate power supply. Any ideas where I can start troubleshooting this? The tx/rx lights still activate when it has failed, but my terminal receives nothing. Thought it might be a grounding issue but I measure 0V from USB ground to the barrel -.

My search terms for this problem brought up nothing, but I think I remember reading something about people frying their uno r3 serial chips by using a separate power supply while having it plugged into USB.

EDIT: Power supply is 12V 1.5A regulated. Reads 12.3V on a dmm. under arduino load, 12.27v. I will attempt using a different supply but suspect the problem will remain.
« Last Edit: February 28, 2013, 11:38:27 pm by MrGarak » Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I remember reading something about people frying their uno r3 serial chips by using a separate power supply while having it plugged into USB.

I read them as well, but if your board works as expected when powered by USB only this shouldn't be the issue. Actually the reset may be caused by the failure on serial communication, i.e. whenever you open a serial communication (e.g., the serial monitor) the Uno resets (this is normal). So it may be an issue related to your PC - maybe you are using a baud rate that causes some instability, the PC resets the COM port and this in turn resets the Arduino. I don't know however how to investigate this. Maybe some message in the system logs?
« Last Edit: February 28, 2013, 11:45:03 pm by spatula » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm working on a project that requires the arduino uno r3 to be powered by a separate power supply AND have the usb cable connected to a PC for serial communication. When using a separate power supply, the board will reset sporadically and serial communication will fail after a few minutes. To isolate any cause I have disconnected all wiring from the arduino pins, and am just running a bare board. It still resets randomly and has serial communication failure when using the separate power supply. Any ideas where I can start troubleshooting this? The tx/rx lights still activate when it has failed, but my terminal receives nothing. Thought it might be a grounding issue but I measure 0V from USB ground to the barrel -.

My search terms for this problem brought up nothing, but I think I remember reading something about people frying their uno r3 serial chips by using a separate power supply while having it plugged into USB.

EDIT: Power supply is 12V 1.5A regulated. Reads 12.3V on a dmm. under arduino load, 12.27v. I will attempt using a different supply but suspect the problem will remain.

Might look into seeing if any application running on the PC might be scanning (blue-tooth driver?) for active/inactive serial comm ports as this can sometime cause a closing/opening of the serial port and cause a DTR initiated auto reset condition being sent to the attached arduino board.

 I can't do a good job of explaining the specific cause or the cure, but the symptom sure sounds like a auto-reset problem. One way to test for this is to defeat auto reset by temporarily installing a 150 ohm resistor between the reset pin and the 5V pin. If the symptoms disappear you will know it's a PC caused thing.

Lefty
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will try the capacitor trick for the reset, i heard the resister doesn't work on uno r3. Could very well be a reset problem. I am now testing an unregulated 7.4v supply (puts out 10.3v under arduino load), and so far no resets, but it hasn't been a long time yet. I don't think it's my machine since I've had the terminal open for hours normally without any issues.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That´s strange, check current values out of power source.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like it was the power supply. I've tried using two others, and no reset or serial failures now. Really odd.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Unfortunately, I seem to have spoken too soon. The problem is back, and it doesn't matter what power supply I use. As long as I use any power supply, be it switching or unregulated, serial communication fails after a period of between 20 minutes and 4 hours.

The failure happens either with the arduino's response not being received and its tx/rx lights staying solid for that duration, or, the com port in windows simply refuses to work anymore "A device attached to the system is not functioning." The only fix is unplugging and replugging the USB cable, and all is well again. Note, the uno does not need to be power cycled. I even put in an uptime seconds counter in my code to verify it wasn't being reset, and it isn't. So, it's a really strange problem. It only happens when using any power supply in the barrel jack. If I leave it on the usb connection for hours, there's no serial communication failure. I verified my circuit isn't causing the problem by running the trials without any connection to pins and a power supply directly into the barrel jack. At this point I am wondering if my board is somehow damaged. The 16u2 chip has rev 0001 on it, is that rev known for failures like this in windows?

It really seems like a waste to have to get an ethernet shield or some other way to communicate with the uno when there's an existing way already built in. It should work without failing like this, and requiring physical disconnection and reconnection of the USB cable to (only temporarily until it happens again) resolve.

Addendum: My code is flashed onto the 328p through the ICSP so there shouldn't be any reset problem being caused by DTR. As mentioned, I've verified via an uptime counter that the board is not being reset.
« Last Edit: March 10, 2013, 11:14:22 pm by MrGarak » Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I wasn't sure if it was the board that was bad so I just tried swapping it with a mega 2560, and the same exact problem occurs. This is really weird. I would say "it's my computer" but for the fact that the problem never happens when the arduino is being powered solely from the usb connection.

I guess my next step is seeing if the problem occurs on a different machine. I have a vista and a linux machine to test. Should be informative at least.
Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just thinking out loud... are you using interrupts in your sketch? Apparently (not sure whether this info is still current) there is a BADISR routine that handles interrupts having no handlers of their own. When this routine is invoked it resets the Arduino. If you wish to check whether this is your case you can define an ISR(BADISR_vect) routine and make it do some logging.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope, no interrupts, the sketch is pretty straightforward and simple. And I've verified it's not being reset through use of an uptime counter. I still have to test the other machines though, but the weird thing is, it's very much power supply related, since I've ran it for over 12 hours without it crashing the serial port when there's no external power supply being used. Also verified on a separate mega r3 that the problem doesn't happen. Makes me want to try the older arduinos with FTDI based serial chips, but I don't have any of those unfortunately. When I'm able to test the other machines that should be insightful.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm currently testing on a linux machine. Uptime is about 30 minutes so far, no serial port crash yet. I tested earlier with a 12V SLA battery in place of the power supply. This also crashed the serial port after about 3 hours on the win7 machine. Hopefully the linux test is informative.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Progress. The linux test had no problems with the serial port not working, it ran for about 24 hours and was just fine with the 12v DC power supply. I am now suspecting EMI issues, so I will be making changes to cable routing, as well as putting the uno in a metal box enclosure, and retesting on the win7 machine.
« Last Edit: March 13, 2013, 04:44:44 pm by MrGarak » Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem "appears" to be gone now after a change of USB cable and 24 hour run on the win7 machine. Not sure if I've run it long enough to get a conclusive result yet. The odd thing is I tried changing the USB cable before and it didn't help, so I'm not yet ready to say it's truly fixed.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, so it's now at 40 hours uptime, and still no serial port crashes. I think the problem is truly fixed. Still not exactly sure what the cause was, however the fix came via a combination of enclosing the uno in a metal box attached to ground (EMI suppression) and changing the USB cable. I noted the old USB cable had an issue with its ground, the resistance was unstable. It varied from ~70ohms to over 300ohms. That could definitely cause problems. Swapping with a normal USB cable (0.2 ohm resistance in ground) seems to have fixed the problem. However, one of the first steps I tried before was swapping that cable, which didn't fix the problem at the time. So, I believe there were also some EMI issues which the metal box seems to have resolved nicely now. Hopefully this information is helpful for anyone else who runs into a similar situation.
Logged

Delaware, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello. I am seeing a very similar problem. I'm running an Arduino Duemilanove that is talking to a "Processing" app on my Windows 7 machine. I have run the combined application for DAYS without any comm problems. However, if I STOP the Processing app, the Arduino resets itself (over and over). If I restart the Processing app, all is well again. This happens regardless of where the power comes from.

With the app running normally, if I simply disconnect the USB cable, the Arduino is happy and does not scram. This tells me the problem is coming from the PC, but I don't know how to prevent the resets on the Arduino side.

I see this as a big problem in my particular application. I hope a solution comes soon.
Logged

Pages: [1] 2   Go Up
Jump to: