If you have trouble getting this sensor to work you might need to add a 10k pull-up resistor to the SDA line. I have the sensor connected to an ESP8266 and couldn’t get it working. When I checked the designers circuit I could see a pull-up on the SCL but nothng on the SDA line. Confirmed with a multimeter.
Hi Robert,
Welcome to the forum
That’s a good catch! When multiple devices are connected to the I2C bus not every device will need its own pull-up resistors, so manufacturers sometimes leave them out, though they are often still accounted for in the design if they need to be added, or have the values changed later to suit the application and specifics of your I2C bus.
Thanks Trent. Maybe not such a good catch as the data sheet shows the SDA line has a pullup resistor inside the chip. What I found is my ESP couldn’t see the Ligning Sensor on the I2C bus untill I connected another device (BME280) to the bus. I also found some great detailed information about using the sensor which might help someone else here.
I live on a yacht & use an Acu Rite lightning sensor to tell how far off a storm is to shorten sail if the storm is getting closer &/or to disconnect electronics. I was in a marina a few weeks ago and 5 boats had lost their electronics [not in the marina though].
I’ve just ordered the lightning sensor to integrate with my RPi4 management system.
On setting it up:
in harbours, shipping radar often triggers my sensor and using AIS [lets you see name of boat, speed, vector, distance, etc] you could calibrate yours. So ‘borrow’ a yachty with AIS when setting this up
Hey Mahesha,
That is an absolutely awesome application! This a perfect example of a very practical use for the module . When you are on a boat in still water the highest point that’ll draw the electricity is always the top of the mast. It doesn’t surprise me that boats are having their electrical sensors and systems blown out by lightning (albeit it, still scary).
When you have your system set up we’d love to see it. We have a project page here (with store credit up for grabs) - Electronics Projects Australia
Kind regards,
Tim
Hi all,
Its been a while but I finally managed to get things working on my Pi 400 and just in time as a storm front passes by and its awesome seeing it detected on Thonny!
I went back and checked the soldering, re-watched Tim’s great video and it appears I had the IRQ wire hooked up wrong as initially it wasn’t showing a red power light so it helps to be patient and if at first you don’t succeed try again as its worth it…
Thanks again and happy making!
Followed the article and youtube video and confirmed all is running like in the video, but when I start the program I get this error.
File “/home/pi/DFRobot_AS3935/python/raspberrypi/example/DFRobot_AS3935_detailed/DFRobot_AS3935_detailed.py”, line 101, in
GPIO.add_event_detect(IRQ_PIN, GPIO.RISING, callback = callback_handle)
RuntimeError: Failed to add edge detection
@JOHN273072 try this:
sudo apt remove python3-rpi.gpio
sudo apt update
sudo apt install python3-rpi-lgpio
@Andrew276246 , @JOHN273072 ,
Just confirming that John’s suggestion works