thunderemu 2.1.0.0
Main Page

Thunder EMU click

‍Thunder EMU Click is a compact add-on board that can be used to emulate lightning. This board features circuits that generate an RF signal that mimics lightning strikes. It is a thunder emulator board that allows you to mimic lightning signals that can represent different distances, thus enabling you to debug your lightning detector application for all kinds of scenarios. The RF signal has an effective range of about 5 – 15cm from the emulator antenna of this Click boardâ„¢ to the sensor antenna.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Sep 2023.
  • Type : I2C type

Software Support

We provide a library for the Thunder EMU 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 EMU Click driver.

Standard key functions :

Example key functions :

Example Description

‍This example demonstrates the use of Thunder EMU click board by generating

CLOSE, MID, or FAR range thunder signal depending on the click push-buttons state.

The demo application is composed of two sections :

Application Init

‍Initializes the driver and performs the click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
thunderemu_cfg_t thunderemu_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
thunderemu_cfg_setup( &thunderemu_cfg );
THUNDEREMU_MAP_MIKROBUS( thunderemu_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == thunderemu_init( &thunderemu, &thunderemu_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( THUNDEREMU_ERROR == thunderemu_default_cfg ( &thunderemu ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define THUNDEREMU_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition thunderemu.h:121
void application_init(void)
Definition main.c:35
@ THUNDEREMU_ERROR
Definition thunderemu.h:180

Application Task

‍Checks if any of the click board buttons are pressed and then generates a thunder

signal related to the pressed button and displays an appropriate message on the USB UART.

void application_task ( void )
{
if ( !thunderemu_get_close_pin ( &thunderemu ) )
{
{
log_printf( &logger, " Close range thunder signal generated!\r\n\n" );
Delay_ms ( 500 );
}
}
else if ( !thunderemu_get_mid_pin ( &thunderemu ) )
{
{
log_printf( &logger, " Mid range thunder signal generated!\r\n\n" );
Delay_ms ( 500 );
}
}
else if ( !thunderemu_get_far_pin ( &thunderemu ) )
{
{
log_printf( &logger, " Far range thunder signal generated!\r\n\n" );
Delay_ms ( 500 );
}
}
}
#define THUNDEREMU_MODE_FAR
Definition thunderemu.h:75
#define THUNDEREMU_MODE_MID
Definition thunderemu.h:74
#define THUNDEREMU_MODE_CLOSE
Thunder EMU mode setting.
Definition thunderemu.h:73
uint8_t thunderemu_get_far_pin(thunderemu_t *ctx)
Thunder EMU get far pin function.
void application_task(void)
Definition main.c:71
@ THUNDEREMU_OK
Definition thunderemu.h:179

Note

‍Thunder EMU click should be used in combination with a Thunder click which detects

a lightning presence. The emulator is calibrated for ranges of up to 15cm from the sensor board. It's recommended to distant both click boards from their development boards using a Shuttle click to reduce the board noise that can affect the sensor and emulator performance.

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.ThunderEMU

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.