Strange as it may be, my lightning detector goes off every few minutes… but without the thunder and blinding flash of light. It did not take long to tract the problem down to several things:
- My furnace kicking on and off in the adjacent room
- Florescent lights turning on and off (mostly with electronic ballasts)
- Any sudden draw of current like 5 60W light bulbs coming on at once
- Other non specific sources.
So how to differentiate lightning from household sparks?
Well I waited many long weeks before a real lightning storm came through the area. And when it did, I had my answer. Real lightning is not at all like my piezo sparker. The sparker is a short two or three pulse event. A lightning strike is hundreds/thousands of events over up to 100 milliseconds.
So after some thought, I came up with a simple way to capitalize on this signal feature. I simply integrate (sum up) each ADC count as it becomes available. If the time since the last sample is more than 500 milliseconds, I reset the sum back to zero. The last stage is to threshold this value to claim a lightning strike.
Now the strike data I also integrate and over one threshold claim a storm in the distance and over a second claim a danger and start computer shutdown procedures. To prevent this integration from accumulating over a long time, I subtract a small value from the sum every minute. This has the effect of driving the sum towards zero as the lightning strike drives it up.
So far in the few storms that have passed, the system has worked fairly well. I still have not allowed it to shutdown the computers on its own. I want a little more test data first.
Areas to work on:
- Move the algorithms into the MSP430 micro and out of the Linux Python code.
- Add a small buzzer to the MSP430 and a silence button for audio alerts
- Commit the project to either and hand wired board or to a custom PCB
- Put the whole thing into an enclosure.