There are several examples with the library: Fine tuning can be done programmatically.
There are many libraries for the Arduino IDE for the sensor, I used the library from Sparkfun. The AS3935 is the world’s first lightning detection IC designed for low power portable or stationary applications. Capacitors connected in parallel to the antenna (680pF and 270pF) set the resonant reception frequency in the region of 500 kHz.
The video shows the operation of the sensor a little more clearly. Fyodor Tyutchev. Surely for many, the approaching thunderstorm causes a primitive feeling of fear: it seems that there is no hiding or running away from this element.
DIYmall AS3935 lightning sensor: how to "catch" lightning (or fool and lightning)
The AS3935’s built-in hardware distance estimation algorithm generates an interrupt on the IRQ pin every time lightning is detected. On the reverse side there are jumpers for activating the MISO and CS ports of the SPI bus and for setting the address when using I2C. 1. Spring this year turned out to be dry and only at the end of May a thunderstorm suddenly broke out, but I was not ready and almost missed it. Also, the sensor did not detect any household electromagnetic noise.
Aliexpress has several options for the AS3935 sensor board, I honestly chose the cheapest option. Rumbles in the blue sky." The example generates 3 types of messages: “Distorber” (intruder) — subjectively, this message occurs during distant flashes; The estimated distance displayed in the Distance Estimation Register is not the distance to a single lightning bolt, but the estimated distance to the leading edge of the storm. The sensor detects cloud-to-cloud and cloud-to-ground discharges. "I love a thunderstorm in early May, The manufacturer, along with the sensor, offers a lightning discharge simulator to test the sensor. Advanced settings example: This example demonstrates other features not mentioned in the basic code example. https://jiji.ng/cars/nissan-pathfinder-2000 as if frolicking and playing, After purchasing the sensor, I was itching to plug it in and test it.
The sensor has a built-in voltage regulator, which in this version of the board is always active, so the sensor can be powered from a 5 V voltage source, but there are modules where the stabilizer activation pin (EN_VREG) is brought out and can be controlled giving a high or low level respectively. And yet, at the end of the day, the sensor was connected to the first Arduino Nano that came across. It has several basic settings to help suppress noise or "interfering" (false lightning). I tried different libraries, changed different sensitivity settings, but all to no avail. I was upset and decided that I got a defective sensor, but still I was waiting for spring thunderstorms … But, despite the feeling of fear, curiosity sometimes turns out to be stronger and you want to “touch” this destructive and, to some extent, mysterious phenomenon. When searching for information about this module, I came across reports that there are modules with incorrect capacitor ratings (1000pF and 100pF), in this case it will not work to programmatically calibrate the antenna. I uploaded the sketch from the sparkfun library examples to the Arduino, I opened the port monitor and waited. This sensor costs several times more than common sensors, such as temperature and humidity, but this did not stop me and I am glad to share my impressions. On the front side of the board are the sensor itself, the antenna and the sensor piping in the form of capacitors and resistors. When the first thunder of spring, It includes various ways to reduce false events, turn off and wake up the sensor, as well as reset all settings to factory defaults. Using a sensitive RF receiver and a built-in patented algorithm, the AS3935 detects electrical emissions from lightning activity and then provides a distance estimate of 40 km to 1 km to the storm source, while eliminating interference from household appliances such as motors and microwave ovens.
The AS3935 can detect an approaching thunderstorm and provide a leading edge distance estimate, where the leading edge of the storm is defined as the minimum distance from the sensor to the nearest edge of the thunderstorm. Sparkfun has a page detailing how to get started with the sensor, where it is recommended to use the SPI interface, but the library also supports I2C. This is familiar to me, so when I saw a lightning sensor for sale, of course, I hesitated for a while, but still bought it. 2. “Noise level so high” — when the noise level is high. I spent the whole evening looking out the window, then the monitor, and purely subjectively I can note the correlation of the distance to the lightning flash, calculated by the sensor, and observed by me.
The size of the board with the sensor is 21*20 mm. By default, the MISO and CS ports of the SPI bus are not active. Unfortunately, by the night the storm was almost over and we managed to capture very few flashes of lightning. The choice of the operating mode is carried out using the SI pin, at a low level on SI, the sensor operates in SPI mode, at a high level – in
I2C mode. I bought the sensor at the end of last summer and the thunderstorm season has already passed.
AS3935 Franklin Lightning Sensor™ is a lightning sensor with built-in distance estimation algorithm from AMS. “Lightning strike detected! Approximately: XX km away» — when a lightning strike is detected with an estimated distance to the thunder front; There was no limit to the delight when, with each, even barely noticeable, flash in the sky, a new message appeared in the port monitor. Basic example with minimal settings: This example demonstrates how to detect lightning.
I don’t have such a simulator and all attempts to use a piezo element from a lighter or a high-voltage converter from a stun gun were unsuccessful.