Enviro+ connected to an ESP32 for use with ESPHome

Hello! I want to be able to use my existing Enviro+ and particulate sensor combo with an ESP32 running ESPHome. The ESP32 is lower power usage than an RPI and less maintenance running something purpose built like ESPHome for sensor interfacing and data transmission.

Is there an electrical/circuit schematic for the Enviro+?
OR
Does the Enviro+ have pull up/down resistors for the I2C and SPI buses? or would I need to add them for use with something other than a Raspberry Pi?

I’ve managed to - via a breadboard - get the ESP32 wired up using the pinout for the Enviro+ provided on pinout.xyz. So far I’ve managed to be able to get data flowing for:

  • PM5003 via UART
  • Turning on the screen’s backlight via a simple binary switch

Unfortunately I don’t appear to be able to get the following working:

  • I2C devices like the 0x49 ADS1015, 0x76: BME280, 0x23: LTR559 - I can see the addresses from a bus scan, but communication with the devices appears to fail due to the I2C lines staying low erroneously
  • The SPI screen displays corrupt static, rather than anything I rendered that I send it

We added schematics for our newer boards earlier this week but looks like we missed this one - I’ll nudge some engineers!

1 Like

Schematic is now linked on the shop page - here’s a direct link!

Oh awesome thanks!! Do you have it for the old-school Enviro+ for Raspberry Pi too? Sorry I wasn’t aware that the new round of Enviros has an Enviro+, too - otherwise I would’ve been more specific!

Ah sorry, missed that you were after the schematic for the HAT version, will put a request in for that one too!

1 Like

@hel any chance those schematics are about? :)

Not yet, sorry - I’ve applied another nudge though!

1 Like

Sorry it took us a while, but the schematic for Enviro+ for Raspberry Pi is now linked on the shop page - here’s a direct link!

2 Likes

No worries at all. Very pleased the effort was made. Thank you muchly :)

EDIT: wow generated today even - hot off the press!

2 Likes

hi @hel is there a guide to connect up the Enviro+ for Raspberry PI to an ESP32 and an example sketch that we can use to pull the readings from all the sensor and display on the display (but using an ESP32 instead of a raspberry pi)?

hi @WebAsh were you able to successfully wire up the ESP32 and capture readings from the sensors? If so could you please share the sketch or the code for the ESP32 that you used? Thank you so much.

No, sorry - ESP32 isn’t an ecosystem we have a lot of experience with at Pimoroni Towers :(

I think RP2040/Pico is now supported in ESPHome though and it looks like some of the Enviro + sensors are supported - could be worth giving that route a try? https://esphome.io/

EDIT: Oops - just realised you’re talking about the Raspberry Pi version of Enviro - ignore the bit about Pico/RP2040!

1 Like

Hey @maucyr . Yes I’ve got a RPI version of an Enviro+ hooked up to an ESP32 running ESPHome. Haven’t worked on getting the mic or the light sensor going yet, but all others are great!

I basically just used pinouts.xyz to map the Enviro+ to the ESP32 equivalent via a breadboard. I do need to redo it without the breadboard as a simple harness instead but haven’t got round to it.

I managed to get it right first time once I realised that I needed to use the espressif framework in ESPHome rather than the arduino, so that I could enable the in-built pull up resistors for the i2c interface.

Here’s my little monster

I can share my ESPHome conf if helpful!

2 Likes

Amazing! Yes please, could you also let me know which pins you mapped to the esp32 and the enviro+ raspberry pi hat?

Enviro+ RaspberryPI Pinout
from: Enviro Plus at Raspberry Pi GPIO Pinout

Envrio+ Phat ----> ESP32 Pin
Pin 2 (5V Power) ----> ??
Pin 6 (GND) ----> ??
Pin 3(GPIO 2 (I2C1 SDA)) ----> ??
Pin 5 (GPIO 3 (I2C1 SCL)) ----> ??
Pin 8 (GPIO 14 (PMS5003)) ----> ??
Pin 10 (GPIO 15 (PMS5003)) ----> ??
Pin 12 (GPIO 18 (MIc i2s clk)) ----> ??
Pin 13 (GPIO 27 PMS5003 Reset)) ----> ??
Pin 15 (GPIO 22 PMS5003 Enable)) ----> ??
Pin 16 (GPIO 23 (ADS1015 Alert)) ----> ??
Pin 18 (GPIO 24 (Gas Header Enable)) ----> ??
Pin 19 (GPIO 10 (SPI0 MOSI)) ----> ??
Pin 21 (GPIO 9 (LCD/DC)) ----> ??
Pin 23 (GPIO 11 (SPI0 SCLK)) ----> ??
Pin 26 (GPIO 7 (SPI CS)) ----> ??
Pin 32 (GPIO 12 (Backlight)) ----> ??
Pin 35 (GPIO 19 (Mic i2s fs)) ----> ??
Pin 38 (GPIO 20 (Mic 12c data)) ----> ??

From what I can see from the schematic that @hel posted earlier there seems to be certain pins that can be used but I’m not sure if we can also use the Breakout Garden Pinouts to capture all the sensor data :

  • BME280 temperature, pressure, humidity sensor -->> Uses I2C Address: 0x76
  • LTR-559 light and proximity sensor → Uses I2C Address: 0x23
  • MICS6814 analog gas sensor → Appears to use the ADS1015 & Pin 18 (GPIO 24 (Gas Header Enable))?
  • ADS1015 analog to digital converter (ADC) → Uses i2c addr = 0x49
  • MEMS microphone → Uses Pin 35 (GPIO 19 (Mic i2s fs)), Pin 38 (GPIO 20 (Mic 12c data)), & Pin 12 (GPIO 18 (MIc i2s clk))
  • 0.96" colour LCD (160x80) → Not sure what pins to use (the SPI & the LCD ones?)
  • Connector for particulate matter (PM5003) sensor → Pin 8 (GPIO 14 (PMS5003)) , Pin 10 (GPIO 15 (PMS5003)) , Pin 12 (GPIO 18 (MIc i2s clk)), Pin 13 (GPIO 27 PMS5003 Reset)) , Pin 15 (GPIO 22 PMS5003 Enable))

Hi @WebAsh would you be able to share your esphome config and the pins you used on the esp32? Thank you so much.

I think there is one other user @Pineapple-Jake who was looking at connecting up an esp32