Static Electricity + Arduino PWM Output == reset?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
subnoize
 
Posts: 42
Joined: Tue Aug 18, 2015 7:45 am

Static Electricity + Arduino PWM Output == reset?

Post by subnoize »

Hello!

I apologize, I'm a software guy dealing with electronics and probably getting myself into trouble. Let me describe my project and then the problem;

The project is based on an Arduino Mega 2560 and uses 1-wire for sensors and the PWM 5 volt outputs for control signals. I use 10 of the PWM outs and have them arrayed on a custom box using RCA outputs. The 1-wire devices use a 3.5 mm stereo audio jack and then I use "off the shelf" headphone splitters to tie up to 100 of them together (kind of a star topology).

The project works remarkably well. I have had no problems until recently when the unit would restart at odd times. What I didn't realize until now (see below) that it only started when the weather turned cold. I checked all recent code and couldn't find any changes that would be attributable to the instability. I looked for shorts and went over everything with my multimeter looking for problems.

Finally, this weekend I walked up to the until and reached out and touched one of the fans being driven off the PWM (standard PC case fan from Cooler Master with PWM control) and I felt and saw a bright blue spark leap from my finger to the metal grate protecting the fan. The whole unit went dead and the lights flashed and it came back up after a few seconds.

I can repeat the experiment even more reliably by zapping the PWM ports with my finger after scuffing my feet on the floor.

I guess I didn't notice this earlier because being here in the South we have considerable humidity and static electricity is minimal except in the dry winter months (hey! its January and as cold as hell!).

I am a noob so if somebody could be so kind as to give me some URLs or advice on protecting my little Arduino Mega 2560 (made in New York no less!) from the evils of static electricity it would be great!

Thank you!


--jb

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Static Electricity + Arduino PWM Output == reset?

Post by adafruit_support_mike »

subnoize wrote:I can repeat the experiment even more reliably by zapping the PWM ports with my finger after scuffing my feet on the floor.
It's good to know that you can, and it sounds like you've identified the problem, but every spark has a strong chance of killing the microcontroller.

The average visible spark has about 15,000 volts pushing electrons across the gap. That's what ionizes the air to create the flash, and superheats the air to near vacuum producing the audible snap. Sending that into a chip is very much like putting it in a spot welder.

The first line of defense for ESD is grounding. Connect all metal exposed on the outside of the enclosure (and the enclosure itself if that's made of metal) to the power supply's GND line. For battery or DC power, that's the negative rail which is usually called GND. For AC power, that's the green line that doesn't carry any active power and is connected to Earth ground.

That doesn't stop sparks from happening (nothing does), it just routes them away from the chips and through the strongest part of the electrical system.

For exposed signal lines that you can't connect to GND, add a pair of reverse-biased diodes to both supply rails:
esd.jpg
esd.jpg (11.01 KiB) Viewed 260 times
They don't do anything under normal operating conditions, but if any external signal tries to pull the line higher than VCC or lower than GND, the corresponding diode will turn on and limit the voltage swing to about 0.6v past the rails. Sparks happen quickly, so it's best to use high-speed or Schottky diodes so the spark doesn't pass by while the diode is still deciding whether to turn on.

You can also use transient-voltage suppression diodes, but those tend to go between the supply rails near any critical chips. They limit the worst spikes on the supply rails rather than protecting signal lines.

In extreme cases, use optocouplers to isolate "what happens outside the box" from "what happens inside the box". Those provide excellent protection because they can't generate voltage spikes on the inside connections.

Start with grounding though. All the other options are "what to do when grounding isn't good enough".

User avatar
subnoize
 
Posts: 42
Joined: Tue Aug 18, 2015 7:45 am

Re: Static Electricity + Arduino PWM Output == reset?

Post by subnoize »

Thanks for the reply!

I have everything grounded already so I may have to move to the diodes method.

--jb

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”