I’m getting “BreakoutBME68X: breakout not found when initialising” when running any scripts attempting to utilise a BME688 breakout sensor over I2C (connected via QW/ST) to a Badger 2040.
Looking at the schematic, pins 4 and 5 are the correct pins.
I’ve been editing my code examples as follows. I have a Tufty that uses the same pins for i2c.
from breakout_bme68x import BreakoutBME688
from pimoroni_i2c import PimoroniI2C
i2c = PimoroniI2C(sda=(4), scl=(5))
bme = BreakoutBME688(i2c)
This code “should” do an i2c scan.
import machine
sda=machine.Pin(4) # Explorer 20 Breakout 4
scl=machine.Pin(5) # Explorer 21 Breakout 5
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
print('Scan i2c bus...')
devices = i2c.scan()
if len(devices) == 0:
print("No i2c device !")
else:
print('i2c devices found:',len(devices))
for device in devices:
print("Decimal address: ",device," | Hex address: ",hex(device))
The default address for the BME688 is 0x76 bme = BreakoutBME688(i2c) assumes this. Only edit / chnage it if you have cut the address jumper on the breakout.
Thanks that’s super helpful. Will save that away somewhere. Unfortunately it has returned No i2c device…
So some additional background that might be relevant(?):
there were no QW/ST to QW/ST cables available in stock when I was buying, so I bought 2x QW/ST to Dupont header cables
I used electrical tape to put the dupont header for each coloured wire together, to make a make-shift QW/ST to QW/ST cable as I couldn’t get anything else by the day that I needed it
Once the event was over and I was back home, [and the purpose of buying the sensor passed 😔], I’ve undone the tape and used a breadboard in between rather than tapeing the pins together; still not working
Is there any protection on the BME688 breakout board? Could it have somehow been fried? Or is it more likely that it was dead on arrival?
There is reverse voltage protection on the V+ and Ground. And getting the i2c pins reversed won’t hurt it.
Do you have a raspberry Pi you could test it on?
argh I’ve figured it out… I’d mostly been leaving the QW/ST cable on the Badger 2040 disconnected, but had only connected it about 5 times. Just now I thought I’d inspect it a bit closer and noticed that it looked like the back pins of the connector were raised/spikey where I would’ve expected solder - so I unplugged the cable and gave the connector a bit of a wiggle…out it comes from its front anchors with no resistance on the solder pads whatsoever - it looks like the QW/ST connector wasn’t ever soldered on! oops!
…guess its time to dust off my very rusty soldering skills and borrow my neighbours soldering iron…
Thanks to @alphanumeric for pointing me in the right direction to rule things out and make this discovery.
Those tabs must have been bent up slightly when the board was soldered up in the oven. They weren’t touching the pads so they didn’t get soldered down. Bummer, but at least you know what’s up with that board now. Pun intended. I’d push / hold them down with a pin or needle, then reflow the solder with a your iron. I’d use a fin tip, if that’s an option.
The example works within the overall badger_os, but adding the temperature sensing as another “app”. I’ve tested this with BME680. If anybody knows how to test other sensors (e.g., BME280 as above, BME688 etc), and display the different set measurements accordingly, help is very welcome!