I wonder about the change you propose in the comment (OKE I know it’s just a comment…)
We simple hobbyists get confused about things like that But as I see it that is an improovement as the Lightning sensor is using IRQ-18
Will try to implement the change later this evening as the sky at the moment is turbulent. Far away some flashes are already visible and some rumbling can be heard
Przemek The change Pieter proposes, changes the initialization of the sensor by telling the arduino how to handle the signals on the pins and wires to the sensor.
(Not that I 100% understand… )
Local situation here: cloudy and some distant flashes have past far away.
I now have implemented the change Pieter proposed and running.
Maybe later tonight no…
Correction: maybe tomorrow a chance to trigger the lightning sensor.
@VEL342 Pieter , hypothetical question - if sensor is mounted outside the casting is it possibile that it loses connection during operating? For example when tipped off by something? I am asking because sometimes when I am turning on the station I get message that lightning sensor is not detected and then I have to check the wires and turn it on again.
@bert.test Current forecast for my town! Circles on the diagram in the second row indicate possibile thunderstorm.
Very interesting graphic, Przemek! Thanks.
My Polish does not go any further than “supermarket”
By the indication of KM for distance I assume there are quit some possibilities of Lightning triggers coming. (No looking at the wrong row…)
@bert.test
Here is the same version but in English and with legend of markings so You can identify what means what:)
Also You can go to the maps.meteo.pl website and it also has an English version😀
Hello @VEL342,
Unfortunatelly, I don’t have the schematics for the I/O board.
But I checked and the lightning sensor is really connected to pin 19 on my board.
I measured from the IRQ pin on the board, to a transistor. And from that transistor to the pin on the arduino.
So in my case, It would mix up pin 18 and 19, the IRQ for the sensor boards would be wrong. (Unless I made a mistake in the measurements, I checked the 2nd IRQ as well and came up on pin 18 and the other transistor.)
I could test by deliberately connecting pin 18 or 19 to GND to trigger an interrupt. Or trigger the IRQ pin on the I/O board.
@bert.test@VEL342
There is thunderstorm right now, but the sensor does not report any disturbances.
Code has been uploaded with changes and nothing…
Station is placed on the window.
What could be wrong?
Just to be clear: the interrupt form the lightning sensor should go to pin 18 on the sensor board.
See https://manuals.velleman.eu/article.php?id=1163 @bert.test sorry for the confusion, the commends in the code indeed mentioned pin 19, but we have changed this in version 3.7 and that’s why I also changed that in the code here ;-).
The change in the code above was handling the interrupts of the sensor. It will now detect a change on rising or falling, so we are sure not to miss anything from the sensor. If you want to know more about this, check https://www.arduino.cc/en/Tutorial/DigitalPins.
@Pz83 If the sensor is mounted on the outside, we do not had issues with the wiring coming loose. But it’s always a good practice to double check the wiring. If you boot the EarthListener, you will have an overview if sensors are wired correctly, otherwise the screen will say “not found” or “error” at that sensor.
An update after a disappointing weekend without lightning .
No lighting = no real lightning event testing, so our tests were limited to artificial generated lightning.
However, they did give us some insight about what is going on.
Here is what we tested:
changing the way the Arduino handles the interrupt from the lightning sensor
-basic input that is checked every loop
-interrupt that is using rising edge
-interrupt that is using change (rising & falling edge)
-interrupt that is using internal pullup resistors
The test results remained the same: artificial lightning was detected by the new version 3.7_2 and the old version 3.4.
However, Sparkfun noted they had trouble with the I²C implementation of the sensor and are suggesting using the SPI interface instead. We are now investigating if the SPI interface is a more stable solution. The lightning sensor supports SPI, but it is difficult to connect when the screen and sensor board are in place.
We are waiting for the next round of lightning to have a clear view what is possible with version 3.7_2 and are investigating further. Please keep us posted about your findings as it is not possible for us to go storm chasing across Europe, looking for some lightning .
We use a spark lighter for a gas cooking stove, a mini tesla coil and a PlayingWithFusion Lightning “Generator” Shield to create artificial lightning sparks.
Wow, @vel342 you have been busy!
Good to have the comments correct. No real confusion here.
Will download the 3v7_2 and give it a test.
Thanks for the datasheet.
@Pz83 The lightning sensor is mounted outside the box here.
No problems with wiring coming loose.
I left the jumpers on only one pin on the sensor, so they give some protection if the box is on his (her?) back.