3

I am having a lot of trouble getting the RPi2 to recognize the sensor, even after configuring the I2C for the RPi and following the guide several times.

Running:

sudo i2cdetect -y 1 

outputs that nothing is connected.

I've tried connected the BMP180 to both 5V and 3.3V, and using multiple different grounds, but have not gotten anything to work; has this happened to anyone else before?

hive-node.py is the script running on the RPi, and only the BMP180 does not work: https://github.com/trevstanhope/hive-node

pi 2 pins

bmp180 pins

output of sudo i2cdetect -y 1 gpio-readall

14
  • 1
    Have you followed this guide to setup i2c correctly ? learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/… it's not enabled by default. Jun 16, 2015 at 20:05
  • 1
    Did you run raspi-config->Advanced->enable I2C, add the modules, remove the blacklisted items and added the lines in config.txt as per the tutorial?
    – Phil B.
    Jun 17, 2015 at 0:25
  • 1
    @PhilB. i2cdetect would fail with a /dev/i2c-1 error if the modules were not correctly loaded. @ Evan Could you check that the gpios 2 and 3 are actually in I2C mode (ALT0). Perhaps they have been set as inputs or outputs. If you have wiringPi installed you could use its gpio readall command. Alternatively with my pigpio library you could use pigs mg 2 and pigs mg 3.
    – joan
    Jun 17, 2015 at 7:49
  • 1
    @joan, GPIO.2 and GPIO.3 are both set as inputs. SDA.1 and SCL.1, the pins that the BMP180 use, are both in the ATL0 mode. Do you mean that I should be using GPIO.2 and GPIO.3 as ALT0?...I added a screen capture of the gpio-readall
    – Evan
    Jun 17, 2015 at 13:06
  • 1
    No, what you have is correct. GPIO.2 and GPIO.3 are arbitrary names used by wiringPi. The BCM column shows the gpio numbers and gpios 2 and 3 are shown as correctly set to ALT0. It is starting to seem likely that your sensor is faulty. Do you have another I2C device? I'd try powering sensor Vin from 5V and then sensor 3V3 from 3V3. If neither of those work I don't know what else to try.
    – joan
    Jun 17, 2015 at 13:17

2 Answers 2

1

In my experience with the BMP180 sensor module I have (not exactly like your adafruit? one), it can periodically refuse to respond to I2C, seemingly at random. There is a soft-reset command for this chip, but no way to issue it if it doesn't respond to I2C. The only option is power-cycling. Did you try power-cycling your BMP180 by pulling out the jumper on its Vin pin (leaving everything else connected and running)? If that helps, you may be able to connect the BMP180's Vin to another Pi DIO so you can power cycle the BMP180 in software. Not sure if the Raspberry PI's DIO current limit will be enough to power the BMP180 though. If not, you can use a PFET.

2
  • It depend on the current requirements - the Vin pin on the board is connected to the 3.3V RPi rail SO THAT THE BMP180 uses 3.3V logic levels for it's I2C connections. There is the alternative of using the 5V rail and spending a couple of pounds for an I2C 3V3 to 5V level shifter neede for the RPi connection to the bus, so you could use pFET control of that 5V power supply to the BMP180. In general running I2C at 5V is a little more reliable - or at least it allows for a higher frequency of operation or longer maximum bus lengths then at 3.3V ...
    – SlySven
    Jan 28, 2016 at 0:01
  • Its no problem to put a logic-level pFET between the RPi 3.3V and the I2C 3.3V. You just need to pick one with a 3V or less gate drive voltage, and a low Rds-on (since it's powering the sensors). These are not exotic these days and < $1 in singles. The gate can be driven directly by a DIO pin without additional components: pFET-S to RPi 3V3, pFET-D to I2C 3V3, pFET-G to a free RPi DIO. Set the pFET-G LOW to turn on I2C 3V3.
    – iggie
    Feb 26, 2016 at 21:35
0

The way I remember, GND is on pin 6, not 9. 9 is DNC. Connect GND to pin 6 and recheck

2
  • Pin 6 & 9 (physical) are both ground; this is confirmed in the gpio readall output. The black wire in the photo is connected correctly, as are the others.
    – goldilocks
    Jun 18, 2015 at 16:03
  • 1
    On early Pi schematics some pins were marked as DNC in case they had to be changed to a different type of pin. No DNCs were actually changed in purpose and there are no longer any pins marked as DNC.
    – joan
    Jun 20, 2015 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.