Tutorial: How does a Lightning Detector Work?

Tutorial: How does a Lightning Detector Work?

We have recently started a new kickstarter for a Grove connector based Lightning Detector Board based on the AS3935 lightning detection chip.   Since we have now verified the Engineering Prototype boards work with the Arduino, Raspberry Pi and ESP8266, we thought we should talk a bit about how the board actually works.

The Thunder Board Kickstarter
[callout size=”col-12″ title=”Checkout the ThunderBoard Kickstarter” button_title=”Go to Kickstarter” button_link=”https://www.kickstarter.com/projects/sunair/the-thunder-board-iot-lightning-detection-for-make?ref=5i86ii”  button_size=”normal” button_rounded=”true” button_color=”red”]

The Thunder Board Lightning Detector

 

Lightning Detector Thunder Board

How the heck do we detect lightning?  You would think it would be pretty easy, but it turns out it is not.   It’s not just like a giant spark.   Well, it is a giant spark, but there are lots of other things that make electrical noise that can be confused for lightning.  Your computer (even your Raspberry PI and Arduino!), your car, the motor in your refrigerator, your cell phone, your computer monitor, your AM/FM radio and even your TV.  They all make electrical noise that can be confused with Lightning.

The Thunder Board is an I2C device and detects Lightning and provides a distance estimate to the “leading edge” of an incoming storm.

The phrase “leading edge” is a bit misleading, since it suggests that one is in the direct path of the storm. In fact, for the purposes of the Thunder Board, the leading edge is simply the closest edge of the storm, which may never actually arrive if the storm delivers a glancing blow nearby. However, its distance away from you – regardless of where it is heading – is the most relevant information.

Programmable Lightning Detector IC

A lightning strike creates an electromagnetic pulse that can be detected using an external antenna tuned to 500 kHz, with a bandwidth of 33 kHz. An analog front-end (AFE) demodulates and amplifies the antenna signal, and a watchdog circuit alerts the lightning detector once an event crosses its threshold. However, numerous other electromagnetic events create high-energy events. It is important that such non-lightning “disturbers” not be misinterpreted as lightning – and vice versa.

We then decide whether the event has the characteristics of a lightning strike. If not, it is rejected as being the result of a disturber. If it decides that it is lightning, the energy of the event is calculated and stored, and then the storm distance is calculated based on that and prior events.

An interrupt then completes the process so that the Arduino or Raspberry Pi can retrieve the information and take action.

Sounds like magic?  It’s not.   But it is pretty cool that you can find a board like this.

The Thunder Board rejects other electrical noise almost all the time.  There is the real magic.  The Thunder Board is based on the AS3935 Franklin Lightning Sensor.  This chip is manufactured by Austrian Micro Systems (now AMS) over in Europe.   Interestingly enough, we worked with AMS in the early 1990s as a joint venture with American Microsystems Incorporated located in Pocatello, Idaho.   We were transferring analog design expertise to AMS in Austria and we got to work with and to know a number of engineers at AMS.   In some small way, we actually contributed to the design of the AS3935 chip.

The AS3935 has four major features:

  • Detects Lightning within a 40km radius.
  • Distance estimation down to 1km in 14 steps
  • Disturber rejection (external noise – not lightning)
  • Threshold for detection is programmable

When the chip has processed a potential lightning strike (after running through it’s rejection algorithms) it will interrupt the processor saying, with high confidence, that a lightning strike has been detected.   The antenna below is a classic “tank” antenna tuned to 500KHz with a bandwidth of 33KHz.  It has on board tuning that can adjust for slightly off components.   We do this in our drivers overtime the board is initialized.

The device is also affected by the amount of ambient electrical noise; the noisier the environment, the more difficult it is to discriminate a lightning event. The AS3935 samples the ambient noise to determine an overall noise floor. If the noise level rises to an excessive level, then an interrupt is issued and maintained until the noise abates. Lightning detection pauses when the noise is too high, and resumes when the noise drops back to acceptable levels.

We have had a lot of fun with this sensor in our various projects.  We hope you will too!

We launched this project when the MOD1016-G board that we have been using became unavailable.

We fixed three things:

1) Made the antenna better

2) Added an I2C buffer to make it play better with other I2C devices on the bus or bus segment.

3) Made the Grove connectors Thru-Hole so people wouldn’t be popping them off

 

What is a Grove Connector?

The way we have been wiring I2C connections before just didn’t work for building fast and quick IOT projects.  Then we found Grove.

There are hundreds of Grove Devices from multiple manufacturers around the world.     Just for a quick look finds over 100 boards.

You can’t plug it in backwards.   If you put the connector in the wrong plug it just doesn’t work.  No smoke.  No fire. This makes us happy as we look over into our Box Of Death, filled with boards we have ruined.

We quickly found the Grove connectors and their respective cables very useful. With the large selection of Grove I2C devices available, we decided to include a Grove connector on all our future boards and products.

For more information, check out our full Grove Tutorial here.

Coming Next

Next we talk about how to test your Lightning Detector.