Friday, November 22, 2024

Building Thunder Distance Detection Device

ashwiniPredict the thundering and lightning…here is the method.

Thunderstorms are a significant weather phenomenon, and in severe conditions with high lightning, they can cause problems and destruction. Additionally, thunder can disrupt air transport and communication. These storms can bring heavy rain, lightning strikes, strong winds, and even hail, all of which pose a risk to people’s safety and can cause damage to property.

The sound of thunder can serve as a warning sign that a storm is approaching, and people should take appropriate measures to prepare or seek shelter. Therefore, predicting the speed, distance, and approaching of thunder and lightning is crucial in weather forecasting and mapping.

- Advertisement -

To address this need, we are designing a thunder-distance detection device that can detect thunderstorms and determine their distance. This device can help predict if a storm is approaching and allow people to take significant steps to prepare for it, particularly in air transport, shipment, and communication.

DIY Thunder Detection using ESP32
Thunder Detector Device

Note: this is a very basic and the first version of the detection device; later we continue with mesh network-based mapping of thunderstorms so that one can predict the thundering and map the amount of thundering and its travel among the different reasons using a mesh network.

- Advertisement -

Bill of Materials 

The materials needed in the project are listed below 

Thunder Distance Detector Parts
Bill of Material

Thunder Distance Detection – Coding 

First, we need to install the ESP board to Arduino and then install the grove AS3938 thunder sensor library in Arduino using the library manager.

We are now prepared to begin coding. To start, initialize the wire library. If your sensor uses I2C or SPI, then use the corresponding library (Wire/SPI and 3935 libraries in this case).

Next, create the setup function and establish serial communication with the desired baud rate to receive the sensor readings on the serial terminal.

Thunder Distance Detection Code
Code snippet

Next, create the loop function, check the sensor data and get the data updated on the serial port. here we will check the data like thunder strike event, its distance, thunder approaching, and energy of thunder.

Thunder Distance Detection – Circuit Diagram

Thunder Sensor with ESP32 Circuit Connection
Thunder Sensor with ESP32 Circuit Connection

Upload the code to the ESP32 by selecting the appropriate port in the IDE. Next, connect the Thunder sensor to the ESP32 board. If you are using an SPI sensor, use the HW SPI pins on the ESP32. For I2C-based sensors, use the HW I2C pin on the ESP32. In this case, since the sensor is I2C-based, follow the circuit diagram provided to make the appropriate connections.

Testing

Thunder Distance Detection
Thunder Distance Detection on Serial Monitor

Now open the serial port to view the thunder report. If there is a possibility of thunder within a 40km range of the device, it will notify you. Additionally, if thunder strikes the earth, it will report the energy level and indicate if it is approaching your location.

Download Source Code

Ashwini Sinha
Ashwini Sinha
A tech journalist at EFY, with hands-on expertise in electronics DIY. He has an extraordinary passion for AI, IoT, and electronics. Holder of two design records and two times winner of US-China Makers Award.

3 COMMENTS

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Electronics News

Truly Innovative Electronics

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics