Envirophat on Pi3?


#1

Hi, just briefly, should the envirophat (and standard zero code) run on a Pi3? I get the following error. I’ve checked soldering-good. I can’t see any address listed using i2cdetect so wonder if this is the problem. 12c is enabled. Newbie!..cheers

pi@raspberrypi:~/Pimoroni/envirophat/examples $ python all.pyTraceback (most recent call last):
File “all.py”, line 6, in
from envirophat import light, weather, motion, analog
File “/usr/local/lib/python2.7/dist-packages/envirophat/init.py”, line 10, in
light = tcs3472(bus)
File “/usr/local/lib/python2.7/dist-packages/envirophat/tcs3472.py”, line 37, in init
self.i2c_bus.write_byte_data(ADDR, REG_ENABLE, REG_ENABLE_RGBC | REG_ENABLE_POWER)
IOError: [Errno 5] Input/output error


#2

Could you possibly post a picture of your setup? Enviro pHAT should absolutely work on the Pi3, and you should see 4 devices in i2c-detect - the ADC, Barometer, Colour Sensor and Accelerometer/Magnetometer.

An IOError of the sort you’re seeing suggests all the software is set up correctly, but the board is either not soldered correctly ( paying close attention to physical pins 2 and 3 which are the I2C bus it uses: http://pinout.xyz/pinout/i2c ) or possibly not on the header correctly ( really easy to do! )


#3

Many thanks, here’s the screenshot of pinout, plus a pic of pcb. Apologies for messy post. I had already resoldered so I’m pretty confident this is OK, however I will re-run over the pins on the hat and on the pi itself. Also I will measure voltage on pins, I assume we should see+3.3 or 5 due to pull-ups?
cheers JR

.


#4

Arrrh!!! I know the answer already. I’ve put the connector on the wrong side of PCB! Plonker! In my defence (poor) I saw the component layout of the connector so put it on that side. But now I see you need to be able to access the colour detector so the parts must be visible. I’ll try to reflow, but may have killed the thing I guess. Sorry to bother you! cheers


#5

Easy mistake to make with a pHAT, although granted it’s not one I’ve seen before! Gave me a chuckle anyway!

I could pour over the schematic to figure out exactly what damage you might have caused, but it’s a heck of a mind bender.

I think the pHAT “ground” plane will have been at 3v3, and 3v3 at “ground” which if I had used 3v3 power on Enviro pHAT would have meant possible doom. But good ol’ tradition means I put a 3v3 regulator onboard ( we often do this, despite it not always being necessary for use on modern Pi’s ) so the whole board would have been unpowered since the 5v power from the Pi would have gone into two unconnected pins on the pHAT, doing nothing.

The board only uses pins BCM 2, BCM 3 and BCM 4, which would have been transposed harmlessly to BCM 26 19 and 13 retrospectively. No harm done there, either.

Without even needing to replace the header, if you have some Male->Female jumper jerky, you should be able to manually connect 5v power and the relevant pins. See here for details: http://pinout.xyz/pinout/enviro_phat

Just be careful and double check before sticking 5v anywhere you might regret it :D


#6

Good news! The header came off easily with hot air. Swapped around and all sweet, goes fine. Oh well I learnt a few Linux things…Thanks!


#7

I looked at your picture and then at my hat and thought… its the wrong way around. Very easily done.