thunderstorm warnings for Monday and Tuesday
I’ve got 3.3 running happily as a test so I hope there is a lightning show. I’m going to check if my WiFi reaches the garage and if it does I might put the Pi out there to run in test mode. The stuff I’m doing I can easily do across the network and I don’t need to swap SD cards or power off so it might be a good place to put it. That all depends on how electrically noisy my neighbours are though because the garage is much nearer them than it is to my house.
In the spirit of adventure and experimentation I decided to test the AS3935 on a Raspberry Pi Zero W (actually a WH with pre-soldered headers) running Duster Lite. It more or less works. The biggest problem is the calibration routine which is pretty heavy on the CPU (handling 4-5000 interrupts per second). The tuning capacitor value isn’t always below 3.5% and even when it is it varies quite a bit (but from running on a Pi4 I know the values are pretty much all OK). Once a calibration value is set the normal operation seems to work well. With effectively no disturber limiting it’s handling about 6 events per second so I think it would handle most lightning storms.
I’ll let it run a little longer to see how it goes.
I’ve just seen an update. ‘Intense’ thunderstorms forecast between Monday and Wednesday. Having said that previous forecasts haven’t been right so I’m not too sure if I’ll see anything.
In anticipation of lightning between 04:00 and 08:00 tomorrow morning I’ve moved my Pi somewhere quieter. It’s still inside but on a bedroom windowsill where there aren’t many electrical items nearby. I’m seeing much less noise and far fewer disturbers. For example, next to my laptop I had noise_floor at about 3-4 and to quell the disturbers I was running with WDTH at up to 6-7 and SREJ at 3. In the new location noise_floor is 0 and with WDTH/SREJ both at 2 I’m seeing about 1 disturber per minute. This is running with front-end gain of 15. That option isn’t available in v3.2 but it’s between indoors and outdoors…closer to outdoors. Hopefully there will be some flashes and bangs overnight so that I can at last see some real activity on the Pi.
Other news…whilst the Pi Zero W experiment was relatively successful I felt that it was a bit close to the edge in terms of actual performance v required performance. The calibration issues show how close to the edge it was. I did try to improve performance of the calibration routine but it was still very hit and miss. I think it’s safe to say that the code will happily run on Pi 3’s so if you have one then you can use it. If you’re looking to buy a new Pi then I’d recommend looking at the 2GB Pi 4. In the UK, that’s about the same price as a Pi3B+. You could save £10 by going for a Pi3A+ but for longevity it would probably be better to pay the extra £10 and have a device that will be good for number of years.
I’ve squashed a couple more bugs I found whilst testing. They’re not common but could occur so worth removing.
Finally, the config editor is coming along nicely. I’ve started to build the menu but as that’s using a module that’s new to me I’m taking it slowly to make sure I get it right.
just to show things can differ the local (Ronaldsway issued 8pm) forecast for tomorrow says cloudy with some showers that may be heavy at times, but no mention of thunder but the country file forecast for tomorrow showed rain and lighting right over the island
I was going off windy.com forecast and I see that’s changed now. No rain overnight. Possibly some thunder around lunch time tomorrow and then again tomorrow evening. I guess we’ll just have to wait and see but I’m not getting too excited just yet. When I see the dark clouds rolling in I’ll pay more attention
Is it possible to have the wrong kind of lightning? We’ve had two storms (or one storm that went away and came back) tonight. Lots of flashes and bangs but no detections. The storm(s) started just before midnight and the second one is still rumbling on at 02:00, so being late at night I’m not really in a position to start looking at code, but there appears to be a fundamental problem somewhere. The storm seemed close enough but was difficult to estimate distance by sound because there were too many flashes and bangs going on to work out which bang belonged to which flash. Something to investigate in the morning, when of course there won’t be a storm to work with :roll:
Loads of rain too. 45mm in the last 2 hours which is a lot for here.
Chris Blitzortung have an archive which allows you to see past events graphically so you should be able to verify how close the strikes are and validate whether or not the detector should have seen them.
Stuart
Thanks Stuart. Unfortunately they only produce a UK-wide map which shows the storm covering the north-west but it’s not possible to tell how close the strikes were. Given that I was hearing thunder that suggests it was closer than 20km and so the detector should have seen at least some of the lightning.
I have been following this thread for some time and have been thinking about building one of these however the thing which just hit me was the radius of detection which is around 12.5 miles. Now my main concern for lightning is the interference it gives to my internet connection (VDSL) and I know from past experience storms around 20-30 miles away give me problems so one of these is not going to cut it in terms of warnings. We often hear and see storms 25+ miles away in the English Channel, we are some 800yards from the coast around 130 feet up and have a clear view of France some days! Is there any way to extend the detection radius?
Stuart
The AS3935 can detect storms up to 40km away…but…there’s always a but. The detection distance is limited by the amount of local electrical noise. There are parameters which affect how much the sensor hears, e.g. AFE_GB, WDTH, and SREJ. If you have to increase these to mitigate local noise then you reduce the detection distance. There are also no guarantees that it will detect every stroke and the further away the storm is the lower the probability of detecting strokes. If you look at the AS3935 datasheet (plenty of copies online) they describe the effect of the parameters on distance with a few graphs.
Putting the Pi+Sensor indoors near other electrical equipment does cause a lot of extra noise to be received which means the noise mitigation parameters need to be higher, reducing the distance. However, as a couple of people have found, moving the Pi+Sensor outdoors , even by just a few metres can significantly reduce the amount of electrical noise heard so it might be possible to get pretty good distances. It’s difficult to know for sure about any specific location though. You might be in a quiet location or you might have a horribly loud source of electrical noise very close by.
PS. I lost my broadband briefly last night. I don’t know if it was the connection that got taken out or or maybe a local loss of power that took my router down. I’ll lhave to ook at the logs when I get home.
Tonight we had a few distant strikes. The most distant one recorded was 34 KM
events.json.txt (738 Bytes)
silly question where is the event.json stored as i have not found one in the sensors folders or have i missed something.
I updated my pi3B+ from stretch to buster a couple of days ago had to run the installer again for version 3.2 as was not running after update of OS. I also found the wifi was going off due to power management being on so at the moment use “sudo iw dev wlan0 set power_save off” at each reboot to turn it off
I received my new lightning detector yesterday and with the help from Chris managed to get it online. The installation process was straightforward, perhaps too user-friendly in my opinion (I like to do some work by myself ).
The html is nice and I really like how it presents the data! What I like the most is the configuration of various parameters through the .config file. That is great for optimizing the detection performance based on micro location.
I do have a proposal, though. I did not follow the topic 100% so maybe this was asked already. In all my other AS3935 installations I log the strike events in daily log files. Basically same data as in the event_history.log file but split to days. This way I can do analysis of the weekly/monthly/yearly events very easy. Is it possible to add this option perhaps? I know it’s possible to have a nowcast.txt file but according to my experience, WD does not handle this file very well on longterm.
Looking forward to the storms in the upcoming days so I can report back.
Thanks for the comments
The installation process is intended to be as easy as possible so that pretty much anyone can do it, even people with their first ever Pi and/or using Linux for the first time. All the source code I’ve written/modified is provided so if anyone wants to dig deeper and do things ‘the hard way’ then that’s an option too I’m going to make editing the config files easier in the next version so less opportunity to make mistakes. I hope that’s not going to be too much of a disappointment
I think this will give you what you want…data more than 3 hours old is archived into a monthly log file, e.g. 2020-08-strike_archive.log. You can choose what to archive (SIND = Strikes/Sim Strikes/Noise/Disturbers) in the config file so unless you want to analyse noise and disturbers this is probably best set to just ‘S’ for the strike details. You’re lucky in not having many disturbers and very little noise so you could easily use ‘SND’. The ‘I’ option isn’t really too relevant but is there for completeness (and to allow me to test without active storms nearby).
You basically copied my mind! My current log files have almost identical formatting, except that the EPOCH and time string columns are swapped Unbelievable.
Chris when I mentioned Blitzortung before I had forgotten that their App on my phone indicates the distance and direction to the most recent strike in the period displayed (mine is set to refresh every 30 seconds but it allows down to 20) and it shows my location, so this might help when you have a storm to see how close it is according to them. The info is in green at top right and your location is a small blue cross.
Stuart
My telepathy isn’t quite perfect yet