Building the Lightning Detector – New Weather Instructable Published.

Building the Lightning Detector. New Instructable images-8Published.

SwitchDoc Labs has published a new Instructable:  “Lightning! The Lightning Detector for Raspberry Pi Weather Station”

In the Instructable you will learn:

  1. How to a connect a Lightning Detector to a Solar Powered Weather Station
  2. How to design and position the lightning detector for best perfomance
  3. How to gather data to see the Lightning story as it happens
  4. How to wire up a the lightning detector to an I2C Mux and a Raspberry Pi
  5. Building 3D Printed Parts for the pylon to hold the Lightning Detector
  6. Examine the Python software for running the Lightning Detector on a Raspberry Pi

Recently, we published an Instructable detailing how to build a solar powered Raspberry Pi weather station, WeatherPi.

What is Weather Pi? 

WeatherPi is a solar powered Raspberry Pi WiFi connected weather station designed for Makers by SwitchDoc Labs.IMG_4129 This is a great system to build and tinker with. All of it is modifiable and all source code is included. The most important functions are:

  • Senses 20 different environmental values
  • Completely Solar Powered
  • Has a full database containing history of the environment (MySQL)
  • Monitors and reports lots of data on the solar powered system – great for education!
  • Self contained and monitored for brownouts and power issues
  • Can be modified remotely
  • Download your data to crunch it on your PC
  • Can be modified to do SMS (Text) messaging, Twitters, webpages and more
  • Has an iPad Based Control Panel
  • Easy to connect to Twitter, WeatherUnderground, etc

Enter the Lightning

footer-robotThis Instructable will show you how to add an Embedded Adventures MOD-1016 AS3935 Lightning Detector Breakout Board to the Solar Powered Raspberry Pi Weather Station.

What is the AS3935 and How Does It Work?

MOD-1016_6_600The Austrian Microsystems AS3935 is a programmable Lightning Sensor IC that detects the presence and approach of potentially hazardous lightning activity in the vicinity and provides an estimation on the distance to the head of the storm. The embedded lightning algorithm checks the incoming signal pattern to reject the potential man-made disturbers and various noise sources.

The AS3935 can also provide information on the noise level and inform the Raspberry Pi of high noise conditions.

Here is a lightning storm detected by WeatherPi and displayed on a RasPiConnect screen.

IMG_0908

11 Comments

  1. “Building the Lightning Detector. New Instructable published.” ->
    Where can I find this?

  2. Hi,

    Thank you for the instructables.
    One more problem I have.
    It was written, the lightning detector is very sensitive for Radio frequency etc.
    Yesterday there was a storm here, so I was running the test without success.
    There was no alert at all, however the storm was max 20 km far.
    This morning I found an article where it was written there is a calibration number on the package of the circuit and I should use the same number in the init.
    Despite I changed that number the and attempted to create disturbance with my mobile phone (placed next to the device) then using the flash of my digital camera, nothing happened (except the Raspberry pi crashed due to a “hidden feature”).

    Do you think it is a normal behavior not to report anything in case of around displays, RaspiS and mobile phone? Should it report anything?

    • Zoltan,

      Which Lightning detector are you using? We did all of our testing with the Embedded Systems unit.

      Where do you have the detector mounted? Is it inside a metal box? Is it close to your raspberry Pi?

      You should at least be picking up Noise Floor warnings.

      Is the unit really connected? 🙂

      SDL

  3. I was able to make a noice only once, but since that there is nothing.
    As far as I remember this is using i2c and I can see on the bus.

    Regarding the JP13 I was asking in another part of your webpage it seems on this picture it is connected to somewhere:
    https://www.instructables.com/id/Lightning-Detector-for-Raspberry-Pi-WeatherPi-Weat/step3/3D-Print-your-Lightning-Pylon/

    Also it is not in a metal box 🙂 but on my desk, inside the room, however close to the window.
    According to the instructables.com documentation above this should be very sensisitve for mobile phone, display or even for raspberry. For me it does not seems to be sensitive at all. I was able to make some noise once with a simple tool that was supposed to create sparkle at cooker)

  4. Great project. I have mine almost complete but I have run into a snag. When running the WeatherPi python script for the lightning sensor connected to the WeatherPiArduino board itself, it is throwing input/output errors. It does show on the I2C multiplex at the correct 0x03 and on bus 0. I can comment out all the lightning detector calls and the script works fine.

    Any suggestions?

    • Matt,

      We would suggest running the example scripts included with the drivers. Try to isolate the problem. Did you hook up the interrupt line?

      Best regards,

      SDL

  5. Checked all my connections and this is the output of the demo code in the driver line. No registers or anything has been changed from the program.

    pi@rpi-wxstation:~/WeatherPi/RaspberryPi-AS3935 $ sudo python demo.py
    Traceback (most recent call last):
    File “demo.py”, line 15, in
    sensor.set_indoors(True)
    File “/home/pi/WeatherPi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py”, line 156, in set_indoors
    self.read_data()
    File “/home/pi/WeatherPi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py”, line 228, in read_data
    self.registers = self.i2cbus.read_i2c_block_data(self.address, 0x00)
    IOError: [Errno 5] Input/output error

    The board should not be bad – I tried it with just the WeatherPiArduino board (before building the project) and it was fine – that’s the puzzling part. All other pieces of the system work fine.

    • Matt,

      Check the address in the code and make sure it is the same I2C address as shown in i2cdetect

      It looks like you are no longer reading the address. Did you use anti-static straps when you handled it?

      Does the Demo software set the I2C Mux to the correct bus? If I were guessing, that would be the problem.

      SDL

  6. Hi,

    I have exactly the same issue here.
    I have the V6 version of the board, however driver talks about v2 and v4.

    QUESTION1:
    Are you sure the v6 version should be able to read with this? https://github.com/pcfens/RaspberryPi-AS3935

    QUESTION2:
    i2cdetect -y 1 shows the device is at 0x03
    Is it enough to change in demo.py the sensor = RPi_AS3935(address=0x00, bus=0) to sensor = RPi_AS3935(address=0x03, bus=1)

    QUESTION3:
    Is there anything else I should change such as here: ./RaspberryPi-AS3935-master/RPi_AS3935/RPi_AS3935.py
    in class RPi_AS3935:
    def __init__(self, address, bus=0):
    (probably change bus=0 to bus=1 as my device is on i2c bus 1?)

    QUESTION4:
    How can I get the calibration data of the device? (that used to be on the antistatic bag, however it was not readable in my case as far as I remember. Is there any way to get this data?

    Thanks for the help.
    (I have been fighting to get result for 6 months now. Now I know the JP13 should be connected to a GPIO port despite what is showing on the weatherpi board schematic graphics. Now I’m able to generate interrupts, however I get I/O errors.)

    Zoli

    • Happy to do some research on your questions. First, what board is V6? The Lightning board? Take a picture of the board front and back and post them so we know exactly what you have.

      Best,

      SDL

3 Trackbacks / Pingbacks

  1. What is the Solar Powered SunRover Robot? - Part 2 - SwitchDoc Labs
  2. How to Mount and Use an I2C Compass on your Raspberry Pi/Arduino Project - SwitchDoc Labs
  3. Solar Power WeatherPi Makes it Through the Winter - SwitchDoc Labs

Comments are closed.