How does it work?
Thunder Click is based on the AS3935, a programmable fully integrated lightning sensor from ams AG that detects the approach of potentially hazardous lightning activity with a sensitive coil antenna, and the MA5532 from Coilcraft. The embedded lightning algorithm checks the incoming signal pattern to reject the potential manufactured disturbers, provides information on the noise level, and informs the host MCU in case of high noise conditions. If the signal is classified as a manufactured disturber, the event is rejected, and the sensor automatically returns to listening mode. Still, if the event is classified as a lightning strike, the statistical distance estimation block evaluates the distance to the head of the storm.
The MA5532 external antenna is directly connected to the AS3935’s Analog Front-end (AFE), which amplifies and demodulates the received signal. The watchdog continuously monitors the output of the AFE and alerts the integrated lightning algorithm block in the event of an incoming signal. The embedded hardwired distance estimation algorithm of the AS3935 issues an interrupt on the IRQ pin, routed to the INT pin of the mikroBUS™ socket, every time lightning is detected. The estimated distance, displayed in the distance estimation register, does not represent the distance to the single lightning but the estimated distance to the storm’s leading edge.
Besides detecting potentially hazardous lightning activity, this Click board™ also provides information on the estimated distance to the center of the storm on the noise level. The AS3935 can detect lightning up to 40km away with an accuracy of 1km to the storm front with a sensitive antenna tuned to pick up lightning events in the 500kHz band. The AS3935 lightning sensor communicates with MCU using the SPI serial interface with a maximum SPI frequency of 2MHz. Note that the clock operation frequency of the SPI should not be identical to the resonance frequency of the antenna (500kHz) to minimize the onboard noise.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the PWR SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Miscellaneous
Applications
Can be used for weather station applications by adding lightning detection to your design
On-board modules
AS3935 – programmable fully integrated lightning sensor from ams AG
Key Features
Advanced warning ahead of human senses, radius of 40km, distance estimation down to 1km, detects both cloud-to-ground and intra-cloud (cloud-to-cloud) flashes, man-made disturber rejection, SPI interface, flexibility, and more
Interface
GPIO,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Thunder Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
JP1 | PWR SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Thunder Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Storm Activity Sensing Distance | – | – | 40 | km |
Antenna Resonance Frequency | – | 500 | – | kHz |
Software Support
We provide a library for the Thunder Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Thunder Click driver.
Key functions
-
Function checks and returns the interrupt value.
-
Function gets energy of the single lightning and distance estimation for the head of the storm.
-
Function reads the desired number of bytes from the registers.
Example Description
This application detects the presence and proximity of potentially lightning activity and provides estimated distance to the center of the storm. It can also provide information on the noise level.
void application_task ( void )
{
storm_mode = thunder_check_interr( &thunder );
if ( storm_mode == THUNDER_NOISE_LEVEL_INTERR )
{
log_printf( &logger, "Noise level too highrn" );
}
else if ( storm_mode == THUNDER_DISTURBER_INTERR )
{
log_printf( &logger, "Disturber detectedrn" );
}
else if ( storm_mode == THUNDER_LIGHTNING_INTERR )
{
thunder_get_storm_info( &thunder, &storm_energy, &storm_distance );
log_printf( &logger, "Energy of the single lightning : %ldrn", storm_energy );
log_printf( &logger, "Distance estimation : %d kmrn", storm_distance );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Thunder
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.