Definitely working, but the display isn’t working at the moment. Which is odd because I know it works as I tested it with the Pimoroni sample code. I guess something else must be wrong or I’ve wired it up just correctly enough to make all the sensors work, but fail on the display.
No code works on the display or just the examples work?
It very much looks like a wiring issue at this point. I just tried the Pimoroni example python script and the screen didn’t even flinch. So back to the spaghetti monster.
I feel a bit more on familiar ground with physical hardware issues at least.
The Enviro+ display uses SPI0 and CE1, as far as I know.
SPI0
GPIO 7, Pin 26, CE1
GPIO 8, Pin 24, CE0
GPIO 9, Pin 21, MISO
GPIO 10, Pin 19, MOSI
GPIO 11, Pin 23, SCLK
SPI1
GPIO 16, Pin 36, CE2
GPIO 17, Pin 11, CE1
GPIO 18, Pin 12, CE0
GPIO 19, Pin 35, MISO
GPIO 20, Pin 38, MOSI
GPIO 21, Pin 40, SCLK
/boot/config.txt
dtparam=spi=on
dtoverlay=spi1-1cs #1 chip select
dtoverlay=spi1-2cs #2 chip select
dtoverlay=spi1-3cs #3 chip select
SCLK - Serial CLocK
CE - Chip Enable (often called Chip Select)
MOSI - Master Out Slave In
MISO - Master In Slave Out
MOMI - Master Out Master In
It was as I suspected, I had switched two of the wires in the harness into the wrong position.
Unfortunately though, I think I may have cooked the screen which is disappointing. Initially (before my first post here) when I was using it, I was using a pre-manufactured ribbon from Adafruit, but nothing was working right. Then I noticed that the ribbon cable to the screen was ridiculously hot so I disconnected everything. Outside of getting hot and baking off some of the ribbon coating it looked okay, so I put some kapton tape over the damage and tried it again with my own wiring and it worked fine with the Pimoroni code.
The Adafruit ribbon seems to have the rows reversed somehow.
Today though, once I fixed the wiring, I tried the Pimoroni example code again since I know that’s worked in the past. Once it started running I noted the the screen was having some issues with obvious rendering problems. Then when I tried the “enviro-monitor” code the screen flickered briefly, but nothing came on. Now, it doesn’t seem to work at all. I see a brief flicker from the backlight, then nothing. So I’m worried maybe I did do some serious damage when I cooked the display.
For the rest though, all the sensors appear to be working, I’m not 100% certain they’re sending all the data to the appropriate destination, but I’m going to try to figure out the screen first.
Yeah, I’m almost 100% certain the screen is dead. I’m not sure how else to test it, but the things that worked before aren’t anymore.
I’ll get this thing all in it’s enclosure though and show it off. Maybe I’ll buy another (ugh) Enviro+ because I really did want the screen to work.
Male to female ribbon cable or female to female?
It was a female/female ribbon. I found a post on Adafruit’s forum where someone tried the same thing with another device.
Ah, I had a feeling you would say that. People have tried putting male pins in one end to change the gender. If you do that and then plug it into the Hat of phat from the bottom it reverses the rows.
With the cable in front of you both connectors facing down its as follows.
2,4,6,8…
1,3,5,7…
cable
2,4,6,8…
1,3,5,7…
As soon as you turn one end facing up it switches to
1,3,5,7…
2,4,6,8…
So pin 2 on the Pi is connected to pin 1 on your hat, etc. That basically swaps your 5V and 3.3V around. Sort of kind of as the grounds get misaligned. Anyway, usually bad things happen and you let the magic blue smoke out.
This will work though, 40-pin GPIO extension cable for HATs and Mini HATs – Pimoroni
I use a lot of the mini hacker and phat stacks.
Mini Black HAT Hack3r – Pimoroni
pHAT Stack – Pimoroni
I put female 90 headers on a Pi Zero and just plug them in without the ribbon cable.
Ops, looks like I’m repeating myself. I already posted a pic of my phat stack breakout garden setup above.
If you take this, Pico HAT Hacker – Pimoroni
And solder two male headers both facing up, it will safely switch one end of a female to female ribbon to male. It’s the equivalent to the first two headers on a Mini hack3r or the pHat Stack.
That’s probably what I needed. I should get a few of them for the now somewhat useless ribbon cables I have on hand.
Thew new wiring harness I put together is working fine now. My layout plans for the enclosure however had to have some adhoc changes.