Raspberry Pi Lightning Detector - Version 3.2

I’ll give that a try, Chris, tomorrow morning.

Thanks for the Home Depot idea. Looks like it’ll work if I can put an electrical socket in it.

Where’s the alternate template at?

Just thinking about ignoring strikes with less energy than a user definable option. Should they be ignored completely or turn them into disturbers so that they’re acknowledged but don’t appear as real lightning?

Chris - for me, I’m not sure. Here’s what I’ve seen on the web interface:

Setting	Value
CPU Temperature (Max = 180 degF)	114.4 degF
Units	us
Distance of last stroke	0.6214
Energy of last stroke	0
Minimum strikes before interrupt	5
Set for indoor use?	false
Analog Front End Gain Boost	14
Watchdog Threshold	1
Spike Rejection	3
Noise Floor	1
Disturbers masked?	true
Tuning Capacitor Setting	7 (56pF)

Thanks for the link to the template. Looks like I’ll be busy screwing up my website tomorrow - hopefully not.

so far the greatest distance I have recorded is 27 km. Seeing the storm in the distance on my webcam, I would say this is reasonable

I’m really enjoying that alternate template. I installed it a little while ago. And, I can see my bogus lightening - hopefully outside tomorrow and cured!

I was about to write some code to use the data from nowcast.json and hoping to use the distance and energy values but I don’t see them. Is there somewhere else these values are stored?

Looking good

All the strokes for the last three hours are in events.json which is only accessible through the web server.

I’ve temporarily moved the Pi to the front porch.

Much, much better!

Outside the house seems to be the answer.

Total	Average
Type	1 min	5 min	10 min	20 min	30 min	60 min	1 min	5 min	10 min	20 min	30 min	60 min
Strikes	0	0	0	0	1	2	--	0	0	0	0	0
Disturbers	5	48	88	171	233	416	--	9.6	8.8	8.6	7.8	6.9
Noises	0	0	0	0	0	10	--	0	0	0	0	0.2
Time	Message
2020-08-04 09:37:58	Disturber detected
2020-08-04 09:37:53	Disturber detected
2020-08-04 09:37:50	Disturber detected
2020-08-04 09:37:39	Disturber detected
2020-08-04 09:37:35	Disturber detected
2020-08-04 09:37:33	Disturber detected
2020-08-04 09:37:25	Disturber detected
2020-08-04 09:37:23	Disturber detected
2020-08-04 09:37:13	Disturber detected
2020-08-04 09:37:09	Disturber detected
2020-08-04 09:36:52	Disturber detected
2020-08-04 09:36:47	Disturber detected
2020-08-04 09:36:28	Disturber detected
2020-08-04 09:36:22	Disturber detected
2020-08-04 09:36:14	Disturber detected
2020-08-04 09:36:02	Disturber detected

CPU Temperature (Max = 180 degF)	95.1 degF
Units	us
Distance of last stroke	0
Energy of last stroke	0
Minimum strikes before interrupt	1
Set for indoor use?	false
Analog Front End Gain Boost	14
Watchdog Threshold	1
Spike Rejection	2
Noise Floor	1
Disturbers masked?	false
Tuning Capacitor Setting	5 (40pF)

All I need is some help in clearing out the nowcast.txt file so that the bogus lightening strikes don’t show up on my new alternate template site (month, August & Year to Date).


Nowcast.txt only survives for an hour so it’s self clearing.

That happens here too.
But the energy is not zero (at least in my case) but is not shown in the right part of the screen.


Interesting. The last energy comes from the sensor so I’m either reading it incorrectly or the sensor isn’t providing it for some strokes. I’ll check my code to see if I can spot any obvious errors.

I wouldn’t worry about it too much. Once I moved the Pi outside, I did shut off the disturber reporting - numerous. I still had a lot of noise reports but I think most of those came from the garage door opener.

I’ve shut down the Pi until I get my outdoor home built for it on the patio. Hopefully this weekend.

While it was on the front porch I got no bogus lightening strikes.

That’s good to know that in at least two cases moving outside kills off the false positives. I’m sure there will be ways to get the sensor on the end of a long cable so that the Pi can stay inside. Maybe something like SPI<->RS485 or RS422 and then have the sensor in a little box with a battery, or even a small rechargeable battery and a small solar panel. Something to look into…one of many projects/sub-projects that I could add to my bucket list of projects!

I did some soldering today to start getting the hardware ready for another project. See the attached picture.


Getting the sensor on a long cable would be awesome.

Looks like a neat project. I can’t tell what it would be though. I’m envious of you hardware guys and low level programming. I know a little javascript and visual basic, that’s about it.

From top to bottom it’s

  • Enviro+ Featherwing - Temp, press, hum, light, sound, air quality (gases) and particulate matter in air with a neat little 1.4 inch colour display
  • nRF52840 - Single board computer with 1MB Flash and 512k RAM. It has Bluetooth LE onboard and can be programmed either like an Arduino using C or using CircuitPython. This is the brains of the stack
  • RFM69HCW 868MHz data transceiver. It can send low speed data up to about 300m/1000ft. This is the technology used in the Davis equipment.
  • Real time clock with battery backup

I’m hoping that collectively these are low power enough to run off a rechargable battery with solar panel so I can create a mini environmental monitoring module to put outside, maybe in the greenhouse. I could even add a lightning sensor to get it out of the house. I’ll be documenting my progress once I start, but I’ve got some other things to do first like get v3.3 of the lighting sensor out and then move on to the other Click sensors that I’ve got. I’ll probably get distracted along the way and do a few other things too.

If you can write some JavaScript and know Visual Basic then take a look at Python. I’m finding it a very easy language to use and I’ve really only been using it for 2-3 months. There are free online courses to learn it and then you can start looking at my code to see how it works. If you, or anyone else, wants to understand how any of my code works at a more detailed level just ask. I’ll be happy to help people understand and help them progress their programming skills.

A bit off topic but it’s still IOT. I’m just playing with the demo code for the Enviro+ FeatherWing and thought you might like to see what it can do. The attached picture shows it reading the temp/press/hum sensors every 2 seconds and then displaying and plotting the values. This is done using just 28 lines of Python code!

I can see I’m going to have some fun with this stuff.

I’ve been out most of today so not had time to dedicate to v3.3 of the AS3935 code. Hopefully I’ll get back to that tomorrow.


Super !

I’ve not gone missing! v3.3 is still being developed.

I’m currently working on a program which will allow you to edit the config files and validate most of the settings so that you can’t end up with a badly broken config file. There are still a few options that are difficult to validate, e.g. the date format string, and it’s still going to be possible to select not very useful values, e.g. a current settings update frequency of 3 months. I’m nearly finished writing the validation functions and the next step will be to add the menu to allow you to navigate around and modify the values you want to change.