Usb woes

Hello everyone.

I have run into one of the strangest things I have seen.

I have a project that is controlled by usb. It works great until you switch off the fluorescent shop lights. Once the shop lights are turned off it stops working I will restart the software and it works again.

I can actually watch the device disappear from the device manager in windows when this occurs.

This only happens when the lights are operated. I have tried putting caps on the voltage supplies and watched for ac noise on the circuit. 30mV of ac voltage. It never fluctuates when this happens.

The only thing I can think of is not having any resistors on the d+ and d- from the usb to atmel?

Any ideas? Noise?

fluorescent shop lights.

Yep, noise and probably a spike on Off due to the inductance. I am guessing you could use a line isolation transformer with a ground to the distribution box to sdolve the problem, but these are not cheap. A good 1KVA AC-DC-AC UPS is what u use in my workshop to power the electronic desk and PC.

Ray

Hi, are you using a laptop or desktop computer? If laptop, does it still do it running on batteries? Have you tried using another USB cable? Some of them are pretty dodgy when it comes to shielding. Have you tried changing power wall outlets?

Tom... :)

The only thing I can think of is not having any resistors on the d+ and d- from the usb to atmel?

What ever it is it's not that.

What sort of arduino are you using?

Well, it was a Leonardo.

I was trying to basically copy what I was doing onto a breadboard, then make a pcb for my project.

Seems thou, I don't have some type of caps right or something.

I am running 2 led boards from it and have multiple channels of io. All of the io is opto isolated thou. Pull up resistors on the proper stuff. Everything works really good actually.

Except I lose communication with it if I switch the lights on and off.

I hooked the Leonardo back up, using jumper wires to all of my io and LEDs and it worked great again.

I guess I don't understand what the important filter parts are on the circuit?

:(

jerkykid: Well, it was a Leonardo.

I was trying to basically copy what I was doing onto a breadboard, then make a pcb for my project.

Seems thou, I don't have some type of caps right or something.

I am running 2 led boards from it and have multiple channels of io. All of the io is opto isolated thou. Pull up resistors on the proper stuff. Everything works really good actually.

Except I lose communication with it if I switch the lights on and off.

I hooked the Leonardo back up, using jumper wires to all of my io and LEDs and it worked great again.

I guess I don't understand what the important filter parts are on the circuit?

:(

Probably some smoothing caps and a voltage regulator take care of the spikes on the main line, you could look at a schematic of it's power input circuitry and copy it.

guess I don't understand what the important filter parts are on the circuit?

Supply decoupling is important:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

I was trying to basically copy what I was doing onto a breadboard

Vital information here. So what schematic are you using and have you wired it up right ( photo ).

My vote is RF noise from the lamp fixture. Try a better shielded USB cbl, or try looping through a ferrite bead (dougnut, tube).

My vote is RF noise from the lamp fixture.

... Only if you consider the voltage spike at power off an RF event since everything works for the Op until the lights go out. I guess ungrounded lamp fixtures could have an "antenna" effect, however.

Ray

Hi, just to make it clear, is the trouble you are having with the protoboard version or the PCB version or both? Can you post us a pic of your project and a circuit diagram, CAD or a pic of hand drawn would be fine , that way we can advise on layout and or bypassing. Tom..... :)

Grumpy_Mike:

guess I don't understand what the important filter parts are on the circuit?

Supply decoupling is important:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

I was trying to basically copy what I was doing onto a breadboard

Vital information here. So what schematic are you using and have you wired it up right ( photo ).

@grumpymike

That was very helpful actually. Thank you for that link!

I know that decoupling is important, but sometimes a push to a page like that runs things home.

I didn't understand why there were two different values of caps on some circuits, now I get it!

I will get a rough drawing together and probably a pic.

Yes, this problem only happens with my circuit.

I can build my IO and mosfet driver circuits on the breadboard, run leads from the arduino headers right to the board for all circuits involved and never have a problem. Works flawlessly.

After reading all of the very helpful replies I wonder if my breadboard wires (from the usb header breakout board) to the micro are acting as antennas (at least enough combined with an un-educated guess on decouple cap values) to be causing this? They are at least 4 inches long.

I have made many different circuits on the breadboards, they usually work or good enough to where I didn't notice problems like this.

Are breadboards an acceptable way to experiment with things like usb circuits (if you know what you are doing :~)?

Yes, solderless breadboards are acceptable, but note in my earlier post that I rewired my project desk to eliminate my florescent problems. Keep jumpers short... If using pre-made jumpers, do not use a 12 inch jumper when a 2 inch one will do! Cut jumpers to length from a roll of 22/24 gauge solid tinned copper wire. Bulk and bypass caps are mandatory.

http://forum.arduino.cc/index.php?topic=195003.0

Ray

Well..................

I finally got this working. I did add/correct my filtering caps.

The problem still occurs with the lights and using my main pc.

I have the circuit hooked up to my laptop with the power supply plugged in and the problems are 100% gone.

Of course, I have another question.

When you have this sort of problem, where do you go with it? No matter what I did with my caps, pc or what outlet I used I had this problem. Until I hooked up my laptop. Is the filtering just that much better or is my power supply not up to snuff?

Now I have a few variables, Is it the house? Is it the pc I was using? Is it the lights?

I am not trying to beat a dead horse, but I would really like to attempt to figure out the real source of my problem.

I really appreciate all the help everyone has given me, and well I have already learned a ton from this problem!! :)

Now I have a few variables, Is it the house? Is it the pc I was using? Is it the lights?

My problems were caused by a basement finished by the previous owner. Lights and receptacles were not separated on the breaker panel...at a minimum, separate breakers but preferred separate phases.

The fix in my case was expensive so I elected the AC UPS designed to fully isolate the AC from the output.

Ray