SparkFun Electronics Commentsurn:uuid:214d0e4e-f1b1-d287-ce26-ac5b4c9f82492024-03-28T06:22:12-06:00SparkFun ElectronicsCustomer #887589 on SEN-15441 - SparkFun Lightning Detector - AS3935Customer #887589urn:uuid:5b210140-ab3c-150c-f976-86e7dfe60ae52022-10-13T11:02:51-06:00<p>I tried the board in SPI mode. The SPI software reported a ready condition, even when the board was NOT installed in the circuit!!<p>I cut the trace on the board and bridged CS to ground, per the text. Hooked it up in I2C mode. The I2C software reports the board as ready correctly. So much for the more "reliable" SPI mode of operation.</p><p>I am now building the lightning simulator as described here, https://sites.google.com/view/as3935workbook/home, for future testing, with the board in I2C mode.</p></p>
farzadb on SEN-15441 - SparkFun Lightning Detector - AS3935farzadburn:uuid:7a71e70e-fb4e-9cca-4d4f-77e5dfbdeb522021-05-11T09:37:55-06:00<p>Fantastic write up! Thanks for posting.</p>
santaimpersonator on SEN-15441 - SparkFun Lightning Detector - AS3935santaimpersonatorurn:uuid:a47f4a2a-dff1-815b-a700-b7e9caf4051f2020-08-19T19:20:10-06:00<p>Thanks for the heads up.<p>I am sure the engineer for this product will be taking a look into the issue, but I believe your error messages have to do with the compatibility with SPI library for the respective Arduino cores. I know the Mbed port for the Arduino Nano 33 BLE is relatively complex, but I am sure we will do what we can to resolve the issue.</p></p>
Bob, Clearwater Beach, FL, USA on SEN-15441 - SparkFun Lightning Detector - AS3935Bob, Clearwater Beach, FL, USAurn:uuid:cb9b1ea2-5f94-46b9-48cd-2c302fa5059f2020-08-07T15:25:24-06:00<p>Just put in an issue in the GitHub registry. The library doesn't work on certain MCU's, like SparkFun Pro nRF52840 - getting the dreaded:<p>~Arduino/libraries/SparkFun_AS3935_Lightning_Detector_Arduino_Library/src/SparkFun_AS3935.cpp: In member function 'bool SparkFun_AS3935::beginSPI(uint8_t, uint32_t, arduino::SPIClass&)':</p><p>~SparkFun_AS3935_Lightning_Detector_Arduino_Library/src/SparkFun_AS3935.cpp:58:9: error: 'class arduino::MbedSPI' has no member named 'setBitOrder'
SPI.setBitOrder(MSBFIRST);
^~~~~~~~~~~
exit status 1
Error compiling for board Arduino Nano 33 BLE.</p><p>Hopefully, this will get rectified. Using it on a SAMD based board and it is fantastic.</p></p>
bboyho on SEN-15441 - SparkFun Lightning Detector - AS3935bboyhourn:uuid:dd25de0c-e349-eb10-53ed-128a4e3608c72020-08-03T11:35:44-06:00<p>Sweeeeet. =)</p>
Customer #1612718 on SEN-15441 - SparkFun Lightning Detector - AS3935Customer #1612718urn:uuid:c2c2261e-23bc-a6c0-d0c7-166b42f858802020-08-02T10:41:58-06:00<p>I found it difficult to debug this part since you seldom have lightning around when you need it. I designed a simple lightning signal generator that creates the pattern the AS3935 is looking for: Details are on this webpage: https://sites.google.com/view/as3935workbook/home</p>
Elias The Sparkiest on SEN-15441 - SparkFun Lightning Detector - AS3935Elias The Sparkiesturn:uuid:bc0b3a52-7457-14e3-ed01-e633841df4912019-08-19T08:33:52-06:00<p>All but one have been fixed - the last remaining image should be fixed today.</p>
Elias The Sparkiest on SEN-15441 - SparkFun Lightning Detector - AS3935Elias The Sparkiesturn:uuid:eb58ac63-f692-523f-4495-cdc6bf721a5d2019-08-19T08:15:53-06:00<p>Thanks for saying something! We had some issues with our servers and lost a few images but it wasn't clear which ones were lost. I'll get those updated as soon as possible.</p>
dafoink on SEN-15441 - SparkFun Lightning Detector - AS3935dafoinkurn:uuid:e335edf6-1ced-8ab3-4a59-9ce0ad9e7a332019-08-18T06:43:20-06:00<p>Is anyone else having issues seeing images in the tutorial?</p>
Elias The Sparkiest on SEN-15441 - SparkFun Lightning Detector - AS3935Elias The Sparkiesturn:uuid:6cf6089f-0a08-c9dc-c18c-2c92157e5fb52019-08-09T08:52:02-06:00<p>That is odd. This is a question better suited to our forums: forums.sparkfun.com. However, I do have a suggestion: try changing your setting to OUTDOOR to see if you have better results. Clearly it's detecting lightning but is not registering it as lightning which leads me to suspect that the INDOOR setting may be too robust in your case.</p>
Customer #1537081 on SEN-15441 - SparkFun Lightning Detector - AS3935Customer #1537081urn:uuid:977c72c3-f420-5f62-9fa7-738e544b05512019-08-08T16:16:57-06:00<p>I just received two of these units and got them running. I checked the antenna tuning and they seem to be running right at 500 kHz. We just had a lightning storm roll over our place but all I got were disturbers with over 100 incidents.<br>
I trying the example code with this heading:
By: Elias Santistevan
SparkFun Electronics
Date: July, 2019
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Example 2
These are the settings that come up when I boot:
18:16:34.781 -> AS3935 Franklin Lightning Detector
18:16:34.781 -> Schmow-ZoW, Lightning Detector Ready!
18:16:34.781 ->
18:16:34.781 -> Are disturbers being masked: YES
18:16:34.781 -> Are we set for indoor or outdoor: Indoor.
18:16:34.781 -> Noise Level is set at: 2
18:16:34.781 -> Watchdog Threshold is set to: 2
18:16:34.781 -> Spike Rejection is set to: 2
18:16:34.816 -> The number of strikes before interrupt is triggerd: 1
18:16:35.125 -> Disturber.</p>
Skye on SEN-15441 - SparkFun Lightning Detector - AS3935Skyeurn:uuid:0e508b7f-8241-e1ab-a6c8-dc2e9458042f2019-08-07T09:01:32-06:00<p>I did not mean to indicate that chip did not document the issue with the delay. Even the datasheet from 5 years ago had this documented. What I found aggrevating was having to wait the 2ms before getting to read the in service register. Of all the chips I have used in 25 years of electronic design, this is the first time I have seen an interrupt pin requires a delay before reading the ISR. In my opinion it is a terrible design. Yes, you can work around it.Just make sure you do not wait the 2ms in the interrupt service routine. You need to set a flag or a timer in the ISR and check it in the main loop. This "feature" made it tough to use in a very limited resource micro like an MSP430.<p>I am glad to hear the Sparkfun's library accounts for this issue.</p><p>Interesting that they recommend gating the events with other sensors. That I think must be new in the datasheet. I did not see that in the original version.</p></p>
Elias The Sparkiest on SEN-15441 - SparkFun Lightning Detector - AS3935Elias The Sparkiesturn:uuid:ffe79ffd-7117-9206-63be-ae13f0e6c94d2019-08-07T08:34:54-06:00<p>That is correct! The Arduino Library that we've written for this already accounts for this delay and is included in the "readInterrupt" function. There's no need to add your own 2ms delay. This is just an FYI for anyone using the library.</p>
TankMasterRL on SEN-15441 - SparkFun Lightning Detector - AS3935TankMasterRLurn:uuid:a4c7b180-6219-9142-11fd-9598aa39dbae2019-08-07T01:41:22-06:00<p>The datasheet gives a nice tip about a way of reducing false triggers: "In consumer weather stations power can be saved and false triggers avoided by powering down the AS3935 based on humidity and pressure information." - Page 36 of v1.04 datasheet.<p>About the interrupt routine: it's documented in the datasheet that a wait of 2 ms is required before reading the relevant part of the register.
"Whenever events happen, the AS3935 pulls the IRQ high and displays the interrupt in the REG0x03[3:0]. Figure 44 shows the interrupt register. After the signal IRQ goes high the external unit should wait 2ms before reading the interrupt register. The interrupt bus IRQ is set back to low whenever the interrupt register is read out." - Page 34 of v1.04 datasheet.</p></p>
santaimpersonator on SEN-15441 - SparkFun Lightning Detector - AS3935santaimpersonatorurn:uuid:0138ed14-4856-6e22-16d1-9a0371aea3492019-08-05T11:37:00-06:00<p>Thanks for the heads up, I'll let our TS team know about this quirk in case any other customers run into this issue.</p>
Skye on SEN-15441 - SparkFun Lightning Detector - AS3935Skyeurn:uuid:60fcb87a-52ec-f272-abda-42d266d0e4362019-08-02T19:16:04-06:00<p>I purchased a very similar breakout board from a different vendors years ago. I am trying to protect a fairly significant investment in computer gear by power it all down and disconnecting from power when a storm comes by. I found this chip (not the break out board implementation) to be much less than satisfactory. First if the detector is keep inside, every time some motor kicks on in the house (AC units, furnace blower, dishwasher, disposal, ...) I would get a false alarm. If I reduced the sensitivity (via registers) then I would miss storms. I never did try this outdoors away from the house because of the difficulty in getting power to it.<p>The second problem is again with the chip (not the breakout board). They provide an "interrupt" pin to tell you of events. The problem is that when the interrupt pin is asserted, the interrupt service register (tells you why you got the interrupt) can't be read right away. You have to wait an ungodly amount of time before it becomes valid. If memory served me right something like a few milliseconds. Makes having an interrupt pin pretty idiotic. When the interrupt happens, you need to kick off a timer in you interrupt service routine. When that timer expires, then you can read the service register. Why you could not have held off the interrupt till the register was valid is beyond me. It is a huge bone headed error.</p><p>After several months of screwing around with the chip, it went into the junk drawer and I built a much more reliable detector from an old AM radio.</p><p>Again, I am sure the Sparkfun board is just fine (although I have not purchased one). It is the chip itself that has the issues.</p></p>
Customer #220589 on SEN-15441 - SparkFun Lightning Detector - AS3935Customer #220589urn:uuid:e1c3318d-54f1-52a8-64f2-11e0e33a693d2019-07-29T12:28:10-06:00<p>I'm sure there are similar projects, but check out the CameraAxe Arduino based camera controller. If I buy one of these my plan is to interface it with an older CameraAxe that I built. They provide a lightning sensor, but it's just a light sensor that detects the preliminary flash and fires the camera to capture subsequent flashes. I've wanted to experiment with something like this because I think the static RF interference precedes the initial flash and could trigger the camera. After that it would be a matter of determining the length of exposure to capture the entire event. Keep in mind, this is speculation on my part as I haven't tested the build yet.</p>
bboyho on SEN-15441 - SparkFun Lightning Detector - AS3935bboyhourn:uuid:19397ec6-6b55-2810-0fcb-e8de15837ef22019-07-29T10:32:20-06:00<p>It could be tricky with the timing for a photo but you could possibly use a Raspberry Pi with a USB webcam. There was a project that I recently saw that <a href="https://hackaday.com/2019/07/21/a-baseball-cap-that-films-the-past/" rel="nofollow">"films the past" using a Pi and a USB camera</a>. Basically the camera is constantly on and saves the last 7 seconds of video when the button is pressed. I would think the resolution and focus for the photo would be pretty bad when using a USB webcam as opposed to a DSLR though.</p>
Elias The Sparkiest on SEN-15441 - SparkFun Lightning Detector - AS3935Elias The Sparkiesturn:uuid:9702762e-32db-1e51-d9ef-3affa2f15be82019-07-28T17:26:50-06:00<p>That is correct, our clone is functionally comparable to the Arduino Uno, and so you're Uno would work just fine. Unfortunately, you could not get directionality with a single lightning detector. To your first question, a shield would only hinder the ability of the Lightning Detector to detect lightning. As to your second question, the antenna on the Lightning Detector and its' passive components were chosen so that they resonate at a specific frequency: 500kHz. In addition the components give the antenna a specific "Q-factor" or quality factor. This is also vital to its' ability to detect lightning. I have wondered if it would be possible to get direction with triangulation but I'm not familiar enough with the specifics of triangulation. Sorry about that, hopefully you can still find a way to integrate it into a project!</p>
Elias The Sparkiest on SEN-15441 - SparkFun Lightning Detector - AS3935Elias The Sparkiesturn:uuid:0d715cda-aab9-d338-52a9-ef1956bde56b2019-07-28T17:01:31-06:00<p>It does have a trigger (an "interrupt") to do such a thing, however my gut is telling me "no". The time for the signal from the lightning has to travel to the Lightning Detector's antenna, then the Lightning Detector has to determine if it sensed lightning (which takes 2 milliseconds), and then the camera has to be alerted and then take a picture. All of that BEFORE the lightning strike disappears.</p>
Customer #220589 on SEN-15441 - SparkFun Lightning Detector - AS3935Customer #220589urn:uuid:d8dcb341-a042-ff5d-9d3a-1d4a6f65cf962019-07-27T12:40:29-06:00<p>This is awesome... I was going to build something like this using analog components. I've got a couple of questions: your example shows using it with a SparkFun Arduino clone, but it looks like it would work fine with a genuine Arduino Uno R3. Is that correct? I want it to be directional (for photography). Would it be possible to either shield it to provide directionality, or attach a home-made antenna that would do the same? Thanks!</p>
Customer #1516346 on SEN-15441 - SparkFun Lightning Detector - AS3935Customer #1516346urn:uuid:69821fbd-7e7b-a8ba-b16f-8a084f0abff52019-07-26T13:45:36-06:00<p>Can this be used to trigger a camera to take a photo of the lightning?</p>