HATs, I2C stackable?


I would like to use both the Enviro pHAT and the Explorer HAT for a project. And I would like to superpose them on a Pi. I am quite sure this is possible as they both communicate with I2C. However, I have no idea how/where to change the communication address.

Can someone guide me please?

Many thanks for your help.


There’s no need to change the address unless you’ve got a fairly old Enviro pHAT. The ADC address should be different on both.

Each I2C device has its own fixed address, and as long as the devices you want to use together don’t have conflicting addresses they will be fine. We keep conflicts to a minimum across our HATs and pHATs.

You can check which addres(es) a HAT or pHAT uses by putting it on your Pi and running sudo i2cdetedct -y 1


Sorry to be the annoying person but I have an old enviro phat and explorer phat which i would like to use in tandem on a robot to read sensors. Is there a way to change the i2c address of either phat to allow for them to work together for 8 ADC channels.


It’s possible, but not easy. The ADC has 4 possible addresses, as seen in the datasheet http://www.ti.com/lit/ds/symlink/ads1114-q1.pdf:


The addresses are set by physically wiring the address pin to one of the pins listed above.

Explorer HAT Pro / pHAT and the earlier Enviro pHAT have this pin tied to Ground, for addr: 0b1001000 or 0x48.

The newer Enviro pHAT has this pin tied to VCC, for addr: 0b1001001 or 0x49.

So you’ve got a choice of SDA or SCL left.

The trouble is, you’re going to have to very carefully de-solder the ADDR pin and lift it up so it’s sticking into the air. Then you will have to bodge a wire onto that lifted up pin, and jump it over to either SDA or SCL making sure your modification doesn’t disrupt i2c communications.


Many thanks for this answer.

Now I have a new issue: I am using the enviro pHAT but I need to use a pressure sensor that is independent from the board. The one I bought has the I2C address “77” which is the same as the one on the pHAT.
Since I do not need the pressure sensor on the pHAT, I was wondering if it is possible to “turn off” the I2C communication of the pressure sensor on the pHAT and then keep the address 77 available for my independent sensor.

When I say “turn off” I mean deactivate the com addressee in in software.


Does your sensor have any pads to change the i2c address?

If not then you will probably have to permanently disable the enviro phat pressure sensor by cutting the traces.


No the sensor does not have any pad. I tried to modify the init.py file by commenting the “weather (pressure sensor) library” so that the sensor is not used anymore. However the sensor is still physically connected to adr 77, which is a problem.

I like your idea of disconnecting the power of the sensor on the pHAT. Any idea which trace should I cut? Would be helpful to have the plan of the PCB.


The 3.3v power supply going into the “BARO/TEMP” (as marked on Enviro pHAT) is made reasonably obvious by the decoupling capacitor that it passes through. If you carefully cut the tiny trace between the decoupling capacitor and adjacent pin ( toward the bottom edge of the pHAT, away from the text ) then power to the IC will be cut.

BEWARE! however that these types of IC have such low power requirements that they sometimes run quite happily parasitically. That’s probably less likely if you have multiple devices on the bus, but it’s possible that cutting the power trace wont be enough to prevent it from running.

The i2c Data and Clock traces are on the top right side of the IC as you’re looking from the top of Enviro pHAT with the text facing the right way up.

The thicker blue trace in the image is the 3.3v power trace on bottom side of Enviro pHAT, which passes up through a via (turning red to indicate top side) and then through the decoupling capacitor into the power supply pins of the IC.

If you could somehow connect the SDO pin on the Barometer to ground - it’s the bottom right pin on the IC, connected by a very small trace to the adjacent VDDIO pin on its left- then the i2C address of the BMP280 would change to 0x76.


Waaahhhaaaa! It works!!!
Thank you so much! Your explanation was really helpful! :)

In case someone else is interested to know how to do it, this is what I did:

Cutting the 3.3v trace does NOT allow disconnecting the I2C adrress. I tried but did not work so I had to resolder the trace.

  1. Remove the BMP280 by heating it. (Works very well with a hot air gun)
  2. Cut the trace between the pin SDO and VDDIO. The trace is actually quit easy to remove, using a sharp scalpel.
  3. Scratch the PCB just under the pin SDO, so that you have access to the copper layer (GND). Then make a small point of solder, connecting the pin SDO to the GND.
  4. Place back the BMP280 and heat it to connect it to the PCB.

To see if it works use the following command: sudo i2cdetect -y 1

Then you just have to modify the I2C address of the BMP280 in the library:
cd /usr/lib/python2.7/dist-packages/envirophat
sudo nano bmp280.py
Replace the line ADDR = 0x77 by ADDR = 0x76
"Crtl + o" , then “Enter” then “Crtl + x”


Wow! Hat tip to your electrical tinkering skills. The BMP280 is not fun to hot air off and on again. Glad you’re up and running!