EnviroPhat Questions

I recently picked up an EnviroPhat. So I have a few questions:

  1. Can one use a ribbon cable to distance the phat from the Pi, to avoid thermal washout from the Pi CPU?

  2. Can the sensors on the Phat be read in real time from another Pi on the LAN and populated into a web page on the 2nd Pi without getting too complicated?

  3. The Envirophat will be going inside a robot, so I want to be able to read the following from by remote:

-Compass heading

-Humidity (analog)

Thanks in advance,

  1. Yes, I’m doing that now with my envirophat. I’ve use the Pimoroni Black Hack3r, and also my own home-made cable (parallel IDE cable if you must know). Moving it a few inches away definitely helps with the CPU heat. Even using a Pi Zero, I’m surprised at the heat given off.

  2. Yes, in real-time, but not sure about over the network. One of the example python routine provided with the envirophat download. The routine updates all signals once/second. If that’s fast enough, it’s real time. But real-time to a remote computer/robot? Hmmmm.

  3. I’d say the sensor values can be transferred to a server, which could be the rPi on the robot. I’m thinking the robot rPi can be the MQTT server receiving all the envirophat signals from the other rPi which is the MQTT client. It’s a fast protocol, and all data can be transferred by wifi.

1 Like

If you use a ribbon cable, double check that Pin 1 on the Pi GPIO is in fact going to Pin 1 on the pHat. And just having the stripe (marker) on the right side isn’t a guarantee its correct. If you end up with Pin 1 connected to Pin 2 and Pin 2 connected to Pin 1, bad things can happen and you’ll let out the magic blue smoke. This is if you just use a ribbon cable with no Black hat hacker board etc. If you use the Black hat hack3r, connected the way they show it, it should all be fine.
Also, do not use the 40 pin 80 wire IDE cables, the new ones. They have some pins grounded for drive select. The older 40 pin 40 wire ones are fine though.

1 Like

I did the one line install and all went well.
Anything I try in Python, I get the following error:

from envirophat import weather
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/dist-packages/envirophat/bmp280.py”, line 134, in temperature
File “/usr/lib/python2.7/dist-packages/envirophat/bmp280.py”, line 169, in update
if self._read_byte(REGISTER_CHIPID) == 0x58: # check sensor id 0x58=BMP280
File “/usr/lib/python2.7/dist-packages/envirophat/bmp280.py”, line 116, in _read_byte
return self.i2c_bus.read_byte_data(self.addr, register)
IOError: [Errno 121] Remote I/O error

from envirophat import motion
x, y, z = motion.accelerometer()
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/dist-packages/envirophat/lsm303d.py”, line 161, in accelerometer
File “/usr/lib/python2.7/dist-packages/envirophat/lsm303d.py”, line 127, in setup
whoami = self.i2c_bus.read_byte_data(self.addr, WHO_AM_I)
IOError: [Errno 121] Remote I/O error
print(x, y, z)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘x’ is not defined

I think I would run sudo i2cdetect -y 1 and look for the appropriate addresses.

1 Like


That’s what I see…

This is the setup:
Red to Pin 2, 5volt
Brown to pin 3 SDA
Orange to Pin 5 SLC
Yellow to pin 7, LED’s

That i2c detect looks Ok, The pinout page lists 0x49, 0x29, 0x1d, and 0x77. I think you might be missing some ground connections. Pin 6, 9, 14, 20, 25, 30, 34 and 39. They have the black markers as being used on the pinout page. It they weren’t needed they wouldn’t have the black borders / backgrounds. It would be green background like all the other unused pins.


Just to clarify, the grounds are all linked together and common “on the Pi”. That’s not always the case with the add on boards though. They count on it actually being plugged into the PI with a 40 pin header. On the actual add in board they may be wired to the various ground pins, but not actually all linked together. Doing that can make the board design harder and complicate track layout. The pinouts are actually pretty good at showing you when you need more than the one ground wired up if your not using a 40 pin header etc.

1 Like

Thank you. Good catch! I added a wire to pin 9, ground, and everything started working.
Curious if I need to wire all of the ground pins?

You’d have to ask Phil @gadgetoid My interpretation of that pinout is those other grounds are used. If you look at the pinout for the led shim, for example, https://pinout.xyz/pinout/led_shim# pins 6 and 20 have the black marker. The other ground pins don’t. My assumption is pin 6 and 20 are needed to be connected for it to work.

1 Like

I’m getting numbers from the accelerometer. But I don’t know what unit of measure they correspond to?

I would think it would be “g”?