AS3935 Lightning sensor

Hello. Has anyone tried to use the AS3935 with the spark core?

1 Like

Redland. I have just got myself the AS3935 Breakout Board and will be trying to hook it up to the SparkCore. I’ve downloaded the example Arduino code and have emailed the designers of the board / code (let’s see what they say).

Otherwise I trust someone else is also heading down a similar path?


Looks cool! It looks like it’s just a SPI device, so connecting it should be totally do-able I would think. I was considering grabbing a geo-phone to do a wifi seismic sensor, but this might be a more fun project in the meantime. Where did you pick one of these up from?


One of the comments mentioned this source

$35.99 + $2.75 to ship.

It looks very interesting!

The code looks good and just requires a few minor tweaks. I can do the port but someone else will have to test it :smile:

1 Like

Hello Guys, Thank you for the reply. I bought one of those from and It works fine with arduino. I made it to send lightning reports to a php page using a RN-XV wifly radio. but it would be more fun of course with the spark. I haven’t try it with the core because don’t know from where to start. Im not that good in programing )-; Please keep me post it on any update?
Thank you all.

1 Like

I have adapted the Arduino library for the Spark core here on my github. I compiles on the web IDE. All that is needed is for someone to test it. :slight_smile:

1 Like

Hello peekay. I would love to try it. But I don’t know where to start. Where do I upload those files to?
can you provide me step by step on how to do it? (I’m OK about wiring the AS3935.)
Sorry for this stupid question?
Thank You

I think I got it. I’ll keep you posted.

1 Like

redland, assuming you are using the web IDE, create a new “app” and name it “LightningDetector.ino” which is the name of the example program provided (in the example folder). Then create a new file “pair” using the add file button on the RHS of the build window. Name the file AS3595 and the IDE will supply the .cpp and .h extensions automatically. On github, copy and paste the code from the AS3595 files to the corresponding AS3595 files in the IDE (each is a tab). Don’t forget to save.

Finally, delete all the stuff in the LightningDetector.ino file tab and copy and paste the content from the github file of the same name (the example). Again, hit the save button. If all goes well, you can hit the verify button and you should have no errors. You can now send the code over the air to the core of your choice.

I flashed the core and it took it fine. It seems to work. But now how can I see it?
Thank You,

redland, you need to open a terminal window with the correct serial port selected. I am on Win 8 so I use Putty for that. Does that help you?

peekay, It WORKS!! Yay… It needs to be fine-tuned. But it works… I had to disable the: AS3935.enableDisturbers(); to make the detector work.


redland, great news! It’s obvious that it does not like Disturbers() to be enabled (huh!). :open_mouth:

1 Like

To test it. I use the Lightning Emulator.


Thank goodness it was an emulated storm! I was worried for a minute there.

Some of the buyers comments on Tindie make me think it is a bit fiddly to get set up right.

Excellent news peekay123, I’ll also be giving it a try on my Sparkcore. Thanks for the porting! I got mine from tindie; just arrived yesterday.

1 Like

Redland. Do you have to disable the AS3935.enableDisturbers() in all three files or just the LightningDetector.ino?

I’ve got the following error when I tried to compile it (even though I’ve followed peekay123’s instructions step by step):

AS3595.cpp:22:20: fatal error: AS3935.h: No such file or directory
compilation terminated.
make: *** [AS3595.o] Error 1

Sorry, worked it out… I had mixed up the AS3935 and AS3595…!

neal_tommy. Only in the LightningDtector.ino . Also I had to add AS3935.reset(); under two if statements. because if you don’t have it lets say you got a lightning at 10 kilometer and you get another one at 12 kilometer it shows the closest one (10) . Also if you get a Storm overhead, watch out! and the next one is 6 kilometers away still get the Storm overhead, watch out!. So for me by adding that, it fixed. I don’t know if that would be the right way to fixed it, but it worked. (-:

Thank You peekay​123 for helping us out!!!