ElEscalador
Posts: 839
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Let's Play "What Killed My Pi?"...Static? Mains Motor Noise?

Mon Dec 19, 2016 3:23 am

I've had a Zero stuck to the side of my garage door opener for months. Not covered - just stuck with a magnet that is foam sticky-taped to the back of the zero. On the front of the Zero is a Sainsmart 2 channel relay module. I also have a door switch connected to the gpio, and a lb-link wifi adapter. I'd SSH'd into the Pi just this morning and wrote a new program that just checks the end switch for me...The opener(via my Android SSH app) had worked all day until I was fixing the snowblower. It's starter plugs into the garage mains - same circuit that my pi and the garage opener motor are on. I am using a Samsung cel phone charger that came with a cel phone to power the Pi.

Although exposed - there is almost zero chance the Pi was physically touched - no one goes in the garage but me. There was plenty of cranking the snowblower starter - I bet that was noisy as it gets, but when I was done and used my app to run my door-closing program, the pi still worked and the door started to close. Then the dog walked in front of the beam and my pi returned an error as programmed (The program checks the door switch and triggers the door if needed. After 2 tries it tells me to go check the door). Well, instead of checking the door I told that pi to reboot (part of it's startup script is that it runs the "close door" program). It shut down and never came back. Went to check on it and no lights on the pi but light are on the relay board - must be a dead pi. Wondering if:

A: Freezing cold, dry Michigan air could build up static...somewhere. The 10 meter long gpio door switch wires? The body of the door opener?I dunno...

B: All that cranking the snowblower starter somehow was a deadly amount of electrical noise even through a cel phone charger...- the buck converter and circuitry couldn't clean up that much crap in the signal? But if so why did it function for another 2 minutes? Maybe door opener motor noise was the culprit (they are plugged into the same receptacle) - although I'd gotten away with it for months.

C: Luck? I really have no idea - I have another zero so no big deal, I'd just like advice to minimize chances of it happening again.
Last edited by ElEscalador on Mon Dec 19, 2016 5:58 am, edited 3 times in total.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

User avatar
TimG
Posts: 298
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: Elescalador

Mon Dec 19, 2016 4:21 am

In dry air you can build up quite a charge. Could the Pi have been zapped when you touched it or the door-switch? It would be worth putting some protection across the GPIOs (a discharge resistor and some clamping diodes at least). The Sainsmart modules appear to be opto-isolated in addition to the isolation provided by the relay, so I doubt that's the problem. Is the Pi definitely dead? Even when removed and given a freshly written SD card?

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Mon Dec 19, 2016 8:46 am

ElEscalador wrote: ...
After 2 tries it tells me to go check the door). Well, instead of checking the door I told that pi to reboot (part of it's startup script is that it runs the "close door" program). It shut down and never came back. Went to check on it and no lights on the pi but light are on the relay board - must be a dead pi. Wondering if:
...
C: Luck? I really have no idea - I have another zero so no big deal, I'd just like advice to minimize chances of it happening again.
If it failed on reboot I might suspect some file system corruption on the SD card meaning it can't boot properly. Any such corruption might have been there for a while.

peterlite
Posts: 720
Joined: Sun Apr 17, 2016 4:00 am

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Mon Dec 19, 2016 9:55 am

The dog breathed on it. The device is cold. Something created moisture. Ice formed on the Pi. You have frozen Raspberry Pi. Microwave it and pour warm chocolate over the top. :D

Starting any electric device can zap electronics through the mains. On one project, the cause was a welder in the building next door. One of the uses for an AC > DC > AC > DC UPS setup is to provide the protection of two transformers with lots of capacitors. I would look at good isolation around mains power tools of any type.

Cockroaches are another cause of failures. A case is a good idea. You do not have to worry about anything with a good case. For a workshop/garage, I suggest looking at:
viewtopic.php?f=40&t=167548

Heater
Posts: 15811
Joined: Tue Jul 17, 2012 3:02 pm

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Mon Dec 19, 2016 11:37 am

ElEscalador,
...must be a dead pi...
Have you checked? Have you pulled it out of there, inspected and tested it? Have you tried it with a new SD card? How can we know what is wrong with it without some information?

10 meter long wires connected to the GPIO pins sounds like a recipe for disaster.

No putting it in a case also sounds like asking for trouble.
Memory in C++ is a leaky abstraction .

ElEscalador
Posts: 839
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Mon Dec 19, 2016 1:37 pm

I did try it in place with a newly imaged card. Maybe that image didn't write correctly for some reason. I Then pulled it out and will test it on the bench today. I did just read something I read I think before I ever got a zero so I forgot about it - the zero doesn't have a power LED - only an activity LED. I thought because it had zero lights it must be dead, but maybe that was premature after all.

No one was in there to touch it or the door switch/wires after it was last operational. A case can't be a bad idea, but it is in a place where the risk of it being hit/touches by a person is almost zero. The case would be to protect it from filth...and maybe to shield it from electrical noise, static, etc.

Will try a tested SD card and go from there.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

User avatar
Burngate
Posts: 6285
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Mon Dec 19, 2016 5:51 pm

ElEscalador wrote:... the risk of it being hit/touches by a person is almost zero.
ElEscalador wrote: ... Then the dog walked in front of the beam ...
It's obvious.

As the door began to close, a pigeon took the opportunity to establish a safe roost for the night.
The dog walking past scared the pigeon.

Pigeon poo is known to be lethal to electronic gubbinses (actually, it's not their poo, it's their urine, but we won't go too deeply into that)

User avatar
CarlRJ
Posts: 598
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Mon Dec 19, 2016 7:25 pm

I lived in a house once that had a garage door opener that regularly killed the light bulb it was supposed to light up upon opening - I always figured it was from the opener's motor jostling the electric power pretty hard when it started up. Pi's really don't like power that isn't clean. I'd vote for inadequate power supply (or at least, inadequate for the scenario/location).

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Mon Dec 19, 2016 7:41 pm

You have a large garage door, so you have large temperature swings. And if this garage is attached to a house, you have a good source of humid air. You will (did?) have moisture problems. A case would help out a lot.

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

levelcrow
Posts: 47
Joined: Tue Aug 12, 2014 5:04 pm

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Tue Dec 20, 2016 6:28 pm

Have you ever heard of flyback voltage?

When current flows across an inductive load such as a motor or an electromagnetic relay, energy is placed in a magnetic field. Likewise, when a magnetic field collapses it produces current.

When a circuit with an inductive load is disconnected, the inductive load must have a path for current to flow. Oftentimes, this is a diode connected in parallel with the inductive load directed opposite to the original supply current. This diode is called a flyback diode. If the flyback diode isn't there, the magnetic field energy will still manifest as a current - often at huge voltages. In fact, this is the principle behind the spark plugs we use in our automobiles and how they produce 12,000V-25,000V from the 12V of a car battery.

Long wires also have some inductance, though much less than an electromagnetic relay or a motor.

Maybe your circuit didn't have proper flyback precautions somewhere and when the garage door closing suddenly stopped, a huge flyback voltage zapped through your GPIO pins and destroyed your Pi.

EDIT: Oh yeah, and if it were the case your Pi was destroyed by a flyback voltage, the way to prevent it would be to place flyback diodes appropriately to prevent the buildup of massive voltages. I'd also use an optoisolator to truly isolate the Pi, but that's just me.

Reading:
https://en.wikipedia.org/wiki/Flyback_diode
https://en.wikipedia.org/wiki/Opto-isolator

User avatar
mikronauts
Posts: 2774
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Tue Dec 20, 2016 7:18 pm

Umm.. the KISS principle suggests that there was an unscheduled shutdown (ie power loss) and the SD card got corrupted.

If a different new SD card works with your zero, it was almost certainly power loss.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

ElEscalador
Posts: 839
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Elescalador

Wed Dec 21, 2016 12:35 am

Ok, so the new SD card worked. My bad for not remembering that the zero does not light up if it can't read. I don't recall us having any power outages, but it now sends me a text when it boots up so I'll know from now on if power goes out and back on.
I am casing it, the garage is not attached so no air/humidity in/out, and my gpio are indeed optoisolated on the relay board.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

User avatar
CarlRJ
Posts: 598
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Elescalador

Wed Dec 21, 2016 6:25 am

ElEscalador wrote:I don't recall us having any power outages, but it now sends me a text when it boots up so I'll know from now on if power goes out and back on.
You'll know if power goes out and back on and it boots back up successfully. If the power cycles and card gets corrupted again, you won't get a text. ;)

Rabbit_Pi
Posts: 23
Joined: Fri Sep 23, 2016 3:03 am

Re: Let's Play "What Killed My Pi?"...Static? Mains Motor No

Wed Dec 21, 2016 7:47 am

Any kind of magnitisum can kill any electrical component in a heartbeat. It sounds to me though it was a combination of all the variables.

On your Next Build, run down to the home Depot or Lowe's, and ask for some Radiant Barrier(or shield). It's Aluminum and Milar that is used in all sorts of applications (great for insulation, i installed miles of it). It does wonders on all sorts of radiant waves from heat, cell signals, blocks rfid, and will help protect your board from static and magnetic build up as well as help protect it from the cold environment. (its the same stuff John Glenn's space suit was made out of, the R rating is the same as 6 inches of fiberglass insulation) Its not very expensive, a 500 sqfoot role runs between $50-70, and 1 sqfoot would be more than what you would need and would be only 4 or 5 bucks lol.

My Skilled Trade is Electrical. Although we have used it for quite some time, Electricity is still only a Theory, and even when we run our circuits by the book, doesn't necessarily mean that it will do what we want. I have seen some crazy things as a electrician. I do offer this advice that will also help protect your whole home.

For around $60-150(depending on what brand you get, stay away from GE, go for square D) you can get a GFCI back surge protector that goes in your Panel box. The older models were a box that mounted on the side of the Main and hooked into the system, but today's models look and install just like a Breaker without the breaker disconnect. This will give your household protection from any kind or surge or back feed in your System, rather its a brownout, a ground or arc fault short, and backfeed of Lighting strikes. I live in Florida (and Ga) and I've had to install many of these units (not to mention having to go back and replace lights, switches breakers, receptacles, rewire new ac units from Lightning damage). I do recommend calling your local Residential contractor for a service call. Shouldn't be more than $300 for a Service electrician to come out and install one and normally takes about 5 to 10 minutes to install. in the long run that $300 will save you thousands of appliance and house damage, and greatly reduces the risk of a electrical fire.

ElEscalador
Posts: 839
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Elescalador

Wed Dec 21, 2016 1:24 pm

CarlRJ wrote:
ElEscalador wrote:I don't recall us having any power outages, but it now sends me a text when it boots up so I'll know from now on if power goes out and back on.
You'll know if power goes out and back on and it boots back up successfully. If the power cycles and card gets corrupted again, you won't get a text. ;)
Indeed.

Code: Select all

If (textRecieved ==1 || unitNoWorkie == 1){
       cout << "Either Power Went Out or You Screwed Up Something Else Again" << endl;
       return 0;
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

Return to “General discussion”