wiki:Telemetry/sensgw/lightning
Last modified 4 years ago Last modified on 07/03/2013 01:44:12 PM

sensor gateway lightning detector

Lightning detector based on AS3935 chip is compatible with sensor gateway and can be used it with it.

The Arduino code is located available at https://github.com/SloMusti/sensgw_lightning

Command set

Commans must be sent only with \n terminator !!!

GET functions:

  • ACOM /0 - test
  • ACOM /1 - time in 100ms (beware wraps around at 65536 or once about every 109 minutes, read data more often then that)
  • ACOM /2 - detection results list, entries separated by comma, each entry <time> <type> <distance> <power>
  • ACOM /3 - calibration offset (range 0-10 is ok)
  • ACOM /4 - noise level (under 3 is ok)
  • ACOM /5 - reset system

SET functions:

  • ACOM /0 x - test set
  • ACOM /1 x - led on/off
  • ACOM /2 x - set gain 0-15(default)
  • ACOM /3 x - set disturber 1 enable(default), 0 disable

Example output of UART communication showing the output of these commands.

ACOM /0
sensgw hw 0.50 fw 0.26

ACOM /1
285

ACOM /1
296

ACOM /1
304

ACOM /2
16 0 31 0,41 0 31 0,

ACOM /3
5

ACOM /4
2

ACOM /5
OKACOM /0 1
test write, decimal value: 1

ACOM /1 1
OK

ACOM /2 15
OK

ACOM /3 1
OK

Detection results list explained

Detection results list has entries separated by comma, each entry <time> <type> <distance> <power>

Time (100ms step):

0-65536 , wrap around

Types:

  • 0 - noise floor too high
  • 1 - disturber detection
  • 2 - lightning strike

Distance (km):

0-40 range

Power (no units):

not yet implemented

Example detections:

16 0 31 0, 230 1 31 0, 350 2 16 0

Example output explained:

  • first entry 16 0 31 0 : at time 1.6s noise too high, ignore other values
  • second entry: 230 1 31 0 : at time 23.0s disturber detected, ignore other values
  • third entry: 350 2 16 0 : at time 35.0s lightning detected at distance 16km, power not yet implemented