AS3935

Detecting Lightning Strikes in a 40 km Radius via 500 kHz RF Impulses

The AS3935 is one of the few available chips specialized in detecting the typical 500 kHz RF pulses emitted by lightning. It employs sophisticated algorithms to reject man-made disturbances and estimates the distance to a thunderstorm head down to 1 km in 14 steps within a 40 km radius.

Overview

The AS3935 operates within a wide voltage range of 2.4–5.5V and can be controlled via I²C or SPI. It is available as a ready-to-use breakout board from several vendors, including SparkFun and CJMCU.

Programming the AS3935 is possible using C++ libraries like SparkFun Lightning Detector (source code). Additionally, ESPHome provides built-in support through the AMS AS3935 Franklin Lightning Detector Component.

Boards with AS3935 are fairly expensive. They cost in the range of €15-30.

Caveats

Working with the AS3935 can be challenging. While it supports both I²C and SPI, the I²C implementation can be unreliable, making SPI the recommended choice.

The main challenge in operating the AS3935 lies in a conflict of interest: the sensor must be extremely sensitive to detect weak electromagnetic impulses from lightning, yet it is often placed near high electronic noise sources.

One of the most significant noise sources can be the power supply. Switching power supplies, such as cheap USB adapters, introduce substantial electrical noise that can interfere with detection and trigger frequent warning messages.

Recommendations

To minimize noise and improve performance, consider the following:

1. Use the SPI Interface

Avoid the I²C interface due to its known instability.

2. Choose a Clean Power Supply

Preferably use batteries or a linear power supply. Avoid regular USB adapters or any switching power supplies, as they introduce excessive noise.

3. Use 5V

Operate the board with 5V instead of 3.3V if you run into problems.

4. Optimize Sensor Placement

If possible, install the sensor outdoors and transmit its data wirelessly. This reduces exposure to the high-density electromagnetic interference (EMI) typically found indoors.

5. Set AFE to “Outdoors”

When configuring the board, always set AFE (gain) to OUTDOORS, even if the sensor is used indoors.

  • The INDOORS setting increases gain to compensate for signal loss due to building materials.
  • However, this backfires because the increased gain amplifies indoor electronic noise, leading to frequent Disturber detected messages.

6. Use a Lightning Generator for Testing

To reliably test the board, consider building a lightning generator.
This acts as a test instrument to trigger the sensor without relying on actual thunderstorms. The AS3935 is sophisticated enough to ignore electric lighters and simple spark generators, making controlled testing useful.

Final Thoughts

When properly set up, the AS3935 performs well. While it may not detect every lightning strike and distance estimation can be imprecise—since lightning does not always emit RF pulses with consistent strength—it can be the icing on the cake for many ambitioned weather stations, despite the relatively high sensor cost.

However, if you simply want real-time lightning strike locations, consider using free, open-source triangulation networks like Blitzortung.org, where volunteers share live lightning detection data.

Materials

Datasheet

Slow Website?

This website is very fast, and pages should appear instantly. If this site is slow for you, then your routing may be messed up, and this issue does not only affect done.land, but potentially a few other websites and downloads as well. Here are simple steps to speed up your Internet experience and fix issues with slow websites and downloads..

Comments

Please do leave comments below. I am using utteran.ce, an open-source and ad-free light-weight commenting system.

Here is how your comments are stored

Whenever you leave a comment, a new github issue is created on your behalf.

  • All comments become trackable issues in the Github Issues section, and I (and you) can follow up on them.

  • There is no third-party provider, no disrupting ads, and everything remains transparent inside github.

Github Users Yes, Spammers No

To keep spammers out and comments attributable, all you do is log in using your (free) github account and grant utteranc.es the permission to submit issues on your behalf.

If you don’t have a github account yet, go get yourself one - it’s free and simple.

If for any reason you do not feel comfortable with letting the commenting system submit issues for you, then visit Github Issues directly, i.e. by clicking the red button Submit Issue at the bottom of each page, and submit your issue manually. You control everything.

Discussions

For chit-chat and quick questions, feel free to visit and participate in Discussions. They work much like classic forums or bulletin boards. Just keep in mind: your valued input isn’t equally well trackable there.

  Show on Github    Submit Issue

(content created Mar 09, 2025)