I am attempting to add the Sparkfun AS3935 sensor to my weather station on a Raspberry Pi 3A+. I’m running into the issue that if i have the BME280 sensor attached (via I2C) and the AS3935 attached via SPI using CE1, the lightning sensor fails to connect (and if it is already attached it generates endless interrupts with no type associated with it). The MCP3008 ADC is not having any issues (using SPI on CE0) and the lightning sensor works perfectly when the BME280 is not connected. Is there some known interference between I2C and SPI using CE1? I took me a while to figure out why the lightning sensor would work in testing but would fail to connect when I put it all together.
I’m also more than willing to entertain any work-around suggestions with regards to getting the AS3935 communicating with the pi. I2C seems to be out as unreliable.
I saw the sticky “AS3935 LIGHTNING DETECTOR UNABLE TO INITIALIZE troubleshooting.” but that appears to be addressing the I2C implementation and predates the withdrawal of support for I2C w/ this sensor.
Thanks,
Michael
Since the Pi 3 A+ has 3 hardware chip selects for SPI1, maybe try using SPI for all 3 interfaces (12, 11, 36) https://www.raspberrypi.org/documentati … erface-spi?
Or try swapping CE0/1 and see if you still get the same result, etc…
Finally, make sure the lightning sensor is running at 3.3v
Thank you for the suggestions. I’ll look into it. MCP3008 is connected to CE0 via soldered wire so it will take some breaking down to swap them but might be worth a shot if nothing else works.
I also found this snippet in the CircuitPython documentation:
The upshot here is basically never connect anything to CE0 (or CE1 for that matter) when using SPI in its default configuration. Use whatever chip select pin you define in CircuitPython and just leave the CE pins alone, it will toggle as if it is the chip select line, completely on its own, so you shouldn’t try to use it as a digital input/output/whatever.
Their reasoning for not using the CE0 and CE1 pins isn’t clear but I moved the AS3935 sensor to an “arbitrary” IO pin as the select pin but, again, I will need to do some “desoldering” to move the ADC.