Introduction
This short post contains details on an Arduino-compatible circuit board (board) to carry the Gravity lightning sensor module.
Custom Shield
In a previous blog, a custom Arduino board with a ScioSense AS3935 lightning sensor was designed. Instead of using a dedicated design, a Gravity Lightning Sensor Module (SEN0290) was used in conjunction with a simplified board to carry the module. This board, with the sensor module, could easily be assembled in educational environments when required. The Gravity module is commonly connected to an Arduino with jumper cables, however a custom board was created to provide a permanent fixture.
![]() |
Simplified Gravity Sensor Board for Arduino |
Circuit Board Build
The board consists of a few connectors for the Arduino and the sensor module. The custom board was designed to use a standard 4-pin to 4-pin sensor cable to connect to the Gravity module.
Grove 4-pin through-hole connectors were chosen. The pin mapping on the 4-pin connectors for the I2C was adjusted to account for the difference between the Gravity Sensor and the Grove RGB LED Matrix.
Circuit Board with Gravity Sensor Module |
Test Data
After completion of the hardware pictured above and connection of the module to an Arduino Uno, the example ‘DFRobotAS3935LightningSensorDetails.ino’ code was uploaded to an Arduino Uno.
![]() |
Arduino Sketch for Circuit Board with Gravity Sensor |
On running the Uno, various noise sources in the development area resulted in continuous ‘Disturber discovered!’ messages. After some tweaking of the Arduino example, the settings in the code listed below yielded more stable lightning measurement results.
Changes in setup
lightning0.setOutdoors();
lightning0.disturberDis();
lightning0.setNoiseFloorLvl(1);
lightning0.setWatchdogThreshold(1);
lightning0.setSpikeRejection(1);
Below is a contiguous debug output from the Arduino debug running the sketch ‘DFRobotAS3935LightningSensorDetails.ino’ with the above modified settings.
DFRobot AS3935 lightning sensor begin!
set up for outdoor operation
AS3935 manual cal complete
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 0
Reg 0x05: 0
Reg 0x06: 0
Reg 0x07: 10
Reg 0x08: 12
0
Lightning occurs!
Distance: 10 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 140
Reg 0x05: 45
Reg 0x06: 0
Reg 0x07: 10
Reg 0x08: 12
0
Lightning occurs!
Distance: 5 km
Intensity: 10
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 79
Reg 0x05: 203
Reg 0x06: 2
Reg 0x07: 5
Reg 0x08: 12
10
Lightning occurs!
Distance: 10 km
Intensity: 4
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 201
Reg 0x05: 39
Reg 0x06: 1
Reg 0x07: 10
Reg 0x08: 12
4
Lightning occurs!
Distance: 10 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 115
Reg 0x05: 9
Reg 0x06: 0
Reg 0x07: 10
Reg 0x08: 12
0
Lightning occurs!
Distance: 10 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 97
Reg 0x05: 48
Reg 0x06: 0
Reg 0x07: 10
Reg 0x08: 12
0
Lightning occurs!
Distance: 10 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 208
Reg 0x05: 41
Reg 0x06: 0
Reg 0x07: 10
Reg 0x08: 12
0
Lightning occurs!
Distance: 10 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 108
Reg 0x05: 35
Reg 0x06: 0
Reg 0x07: 10
Reg 0x08: 12
0
Lightning occurs!
Distance: 10 km
Intensity: 1
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 155
Reg 0x05: 101
Reg 0x06: 0
Reg 0x07: 10
Reg 0x08: 12
1
Lightning occurs!
Distance: 14 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 233
Reg 0x05: 25
Reg 0x06: 0
Reg 0x07: 14
Reg 0x08: 12
0
Lightning occurs!
Distance: 14 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 159
Reg 0x05: 13
Reg 0x06: 0
Reg 0x07: 14
Reg 0x08: 12
0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 0
Reg 0x05: 0
Reg 0x06: 0
Reg 0x07: 27
Reg 0x08: 12
0
Lightning occurs!
Distance: 27 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 43
Reg 0x05: 6
Reg 0x06: 0
Reg 0x07: 27
Reg 0x08: 12
0
Lightning occurs!
Distance: 17 km
Intensity: 1
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 144
Reg 0x05: 73
Reg 0x06: 0
Reg 0x07: 17
Reg 0x08: 12
1
Lightning occurs!
Distance: 27 km
Intensity: 0
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 65
Reg 0x05: 21
Reg 0x06: 0
Reg 0x07: 27
Reg 0x08: 12
0
Lightning occurs!
Distance: 12 km
Intensity: 2
Reg 0x00: 28
Reg 0x01: 17
Reg 0x02: 193
Reg 0x03: 32
Reg 0x04: 216
Reg 0x05: 159
Reg 0x06: 0
Reg 0x07: 12
Reg 0x08: 12
2
Gerber and Lightning PCB Parts
![]() |
Lightning (PCB) Gerber |
Lightning Project Parts
Item | Description | Quantity |
1 | Gravity Lightning Sensor Module (SEN0290) | 1 |
2 | Lightning PCB | 1 |
3 | Grove 4-pin through-hole | 1 |
4 | Grove 4-pin to 4-pin connector cable | 1 |
5 | Arduino stackable headers | 1 |
6 | Header pins for Gravity IRQ connection | 1 |