Lightning Detector

Commercial weather services that provide lightning detection via API cost a small fortune in subscription costs since lightning detection is a small part of a total weather monitoring package. As a ham radio operator, I needed something simpler and came across several projects that build lightning detection around Adrunio and Raspberry Pi’s using the AS3935 detector…

There are several internet projects such as https://www.blitzortung.org/en/cover_your_area.php but they don’t show recent service updates and the service does not appear to provide an api.

So I found this… https://www.digikey.com/…/sparkfun…/SEN-15441/10314267 although it is designed to work with an Arduino. Its recommended to use with a SPI port due to issues with its I2C implementation.

I then found this… https://www.rs-online.com/…/building-a-pi-powered… This project uses a different lightning detector and an I2C port on a Raspberry Pi, but the Github project associated with these instructions has details on how to also connect it to an SPI port. This Github project was written to provide either I2C or SPI connectivity to any AS3935 based sensor including the Mikroe sensor or the Sparkfun sensor… https://github.com/iron…/lightning-detector-MQTT2HA-Daemon

Finally, the rsonline project above is focused on selling its components, but the actual manufacturing source for the “click boards” and various board “hats” come from this company: https://www.mikroe.com/arduino-uno-click-shield. I went a little crazy and ordered a number of different click boards to have some fun with including stepper motor controllers, gyro sensor, their version of the lightning detector.

So follow this github project https://github.com/iron…/lightning-detector-MQTT2HA-Daemon and you should be able to substitute with any AS3935 sensor with I2C or SPI interface. The Raspberry Pi project outputs events via MQTT which is perfectly suited for some Node-Red automation.

A sample flow could be based on a number of events and decreasing distance, switch a relay which will enable transmit inhibit and 10 second later, switch a relay which will disconnect antenna(s). As in my screenshot, there will be false positives such as lighting the BBQ but its easy to program to ignore an isolated event. 

I plan to package mine in a smaller Pi where it can sit in the corner monitoring and throwing MQTT events when it detects something. Enjoy!

In summary, we have three approaches to lightning detection –

  1. Sparkfun sensor and their Arduino implementation.
  2. Sparkfun sensor and the Ironsheep Raspberry Pi implementation (SPI Port). With MQTT.
  3. Mikroe sensor and the Ironsheep Raspberry Pi implementation (I2C Port). With MQTT.

If you have an interest in Home Assistance, check out the lightning detector card for Home Assistance here: https://github.com/irons…/lovelace-lightning-detector-card

Related Posts
ClubLog Realtime QSO’s
Satellite Tracking using Astronomy Goto Mount