- Dfrobot gravity circuit how to#
- Dfrobot gravity circuit serial#
- Dfrobot gravity circuit software#
- Dfrobot gravity circuit code#
Start the I2C interface of the Raspberry Pi.When lightning occurs, the interrupt alarm pin IRQ triggers the controller to display the lightning alarm "Lightning occurs!", and shows the estimated lightning distance and intensity.Uint32_t lightningEnergyVal = lightning0.getStrikeEnergyRaw() Uint8_t lightningDistKm = lightning0.getLightningDistKm() Uint8_t intSrc = lightning0.getInterruptSrc() It does nothing until an interrupt is detected on the IRQ pin. Tuning AS3935_CAPACITANCE to make the frequency within 500/16 kHz ± 3.5% This will dispaly the antenna's resonance frequency/16 on IRQ pin (The resonance frequency will be divided by 16 on this pin) uncomment the following sentences to fine tune the antenna for better performance. Connect the IRQ and GND pin to the oscilloscope. Enable interrupt (connect IRQ pin IRQ_PIN: 2, default)
Lightning0.manualCal(AS3935_CAPACITANCE, AS3935_MODE, AS3935_DIST) Setup for the the I2C library: (enable pullups, set speed to 400kHz) Serial.println("DFRobot AS3935 lightning sensor begin!") Antenna tuning capcitance (must be integer multiple of 8, 8 - 120 pf)ĭFRobot_AS3935_I2C lightning0((uint8_t)IRQ_PIN, (uint8_t)AS3935_I2C_ADDR) The module has three I2C, these addresses are:Ĭopyright GNU Lesser General Public License This sensor can detect lightning and display the distance and intensity of the lightning within 40 km
Dfrobot gravity circuit serial#
Dfrobot gravity circuit code#
Open Arduino IDE, upload the following sample code to the Arduino UNO.
Dfrobot gravity circuit software#
If you need to modify the I2C address, you can change it to 0x01 or 0x02 through the DIP switch on the module, and modify the macro definition of the I2C address in the software "#define AS3935_I2C_ADDR AS3935_ADDx", where x can be 1, 2, 3. The I2C address defaults to 0x03, which corresponds to “AS3935_ADD3” in the code.
Dfrobot gravity circuit how to#
Limited by the inherent measurement method and algorithm, the distance estimation resolution is 1~4km, 40 km in 15 steps. The maximum estimated distance of lightning strike is 40km.Interface: Gravity I2C (logic level: 0-VCC)Ībout Lightning Distance and Intensity Estimation.I2C Address: Three options 0x03, 0x02, 0x01.Intensity Detection Resolution: 21 bits, i.e.Embedded man-made disturber rejection algorithm.Lightning detection within 40km in 15 steps.This can be used to trigger the shutter to open, helping photographers to accurately capture the exciting moment of lightning. At the moment of lightning, the interrupt pin IRQ generates a pulse.
The sensor can also be embedded in the indoor protection device inside lightning-sensitive equipment, and automatically trigger these devices to switch to the backup power to isolate the power grid when lightning strikes. This provides early warning of thunderstorms that people can perceive, so that people can take precautions a step ahead. In addition to allowing general weather enthusiasts to measure local thunderstorm data simply and efficiently, thanks to its compact size and wide detection range, it can also be embedded in various smart wearable devices for outdoor climber or people who work at heights. The embedded man-made disturber rejection algorithm can effectively avoid the electrical interference generated by various household appliances. Gravity: Lightning Sensor employs AMS innovative AS3935 Franklin lightning sensor IC and Coilcraft MA5532-AE dedicated antenna to detect lightning distance, intensity, and frequency within a radius of 40km both indoors or outdoors.