If you’re using a [RedBoard Qwiic you can modify the board to use 3.3 volt I/O without using a logic level converter by cutting a trace and then adding a solder jumper to two pads. The picture below shows what you need to do.
everything is working fine with a redboard with the mods you suggested to change the logic level. I ended up using the Example2_More_Lightning_Features_SPI.ino which was very accurate when we had some thunderstorms here it alerted each lightning strike.
I really need to use this with a mega r3 board with 5v levels. was looking at level shifters: SparkFun Logic Level Converter - Bi-Directional BOB-12009, but they only seem to handle 4 wires and this board has 5, MOSI MISO, SCK, CS, INT ? do I have to buy two of those logic boards to handle 5 wires ?
The INT is only one-direction; output of AS3935, input to Mega. You certainly should not need the bi-directional converter. You could probably hook it up directly (the Mega should accept 3.3V logic levels ok). Or you could place a series resistor in between the two to limit any potential current surge at power-on.
Are you saying I can skip the converter for all the lines or just INT. the doc said besides the input voltage of 3.3v, the lines also had to be 3.3v. It was a pretty expensive board at $25 so I do not want to damage it, thanks
If you are connecting the Lightning Detector to a 5V microcontroller like the Mega, you absolutely need to level shift the SPI lines and the INT line because it is active HIGH. The SparkFun breakout was designed to only use 3.3V input and logic levels. You’ll want to use a level shifter like [this or if you want to switch at high speeds, the [TXB0104 Breakout will work as well.](https://www.sparkfun.com/products/11771)](https://www.sparkfun.com/products/12009)
While it’s a really good idea to level shift all 5 lines, (with two logic level shifters) you can get away without shifting signals that are outputs of the AS3935 and only inputs for the Arduino.
MISO and INT are both AS3935 outputs and as long as you don’t have another 5 volt SPI device on the same bus, or a 5 volt board that has an INT pin on it, you could connect both pins directly to the Arduino. Just be absolutely sure nothing in your code ever drives either of those pins high on the Arduino side and you can skip the logic level shifter for those pins.