# Enviro Indoor VOC readings

**URL:** <https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118>\
**Category:** Support\
**Created:** [August 24, 2022, 3:39pm UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118 "2022-08-24T15:39:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![GingerDownUnder](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gingerdownunder/32/8959_2.png) [@GingerDownUnder](https://forums.pimoroni.com/u/GingerDownUnder)\
**Post date:** [August 24, 2022, 3:39pm UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/1 "2022-08-24T15:39:08Z")

</div>

Hi,

I bought the Enviro Indoor and based on the product page and printing on the board it should be capable of reading VOCs.

Out of the box this is not in the MQTT packet. I can’t seem to fin any information within the GIT page or anything within the files on the board.

Has anybody obtained readings from the gas scanner or know of info of where I can attack this sensor?

Thanks in advance,

Pete

---

<div class="post-metadata">

**Author:** ![tobywan-kenobi](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tobywan-kenobi](https://forums.pimoroni.com/u/tobywan-kenobi)\
**Post date:** [August 24, 2022, 8:06pm UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/2 "2022-08-24T20:06:59Z")

</div>

Was just about to post the same question. Would really appreciate an answer to this!!!

Thanks

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [August 24, 2022, 10:44pm UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/3 "2022-08-24T22:44:50Z")

</div>

One thing to try, is to reflash it with the Enviro uf2 file, with the PMS sensor connected. If it gets detected as an Enviro Urban that may fix your issue.  
[Release Version 1.19.6 · pimoroni/pimoroni-pico (github.com)](https://github.com/pimoroni/pimoroni-pico/releases/tag/v1.19.6)

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [August 24, 2022, 10:46pm UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/4 "2022-08-24T22:46:34Z")

</div>

Have a look at this, might help?  
[enviro/urban.py at main · pimoroni/enviro (github.com)](https://github.com/pimoroni/enviro/blob/main/enviro/boards/urban.py)

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [August 25, 2022, 8:40am UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/5 "2022-08-25T08:40:52Z")

</div>

Incorporating the BME688 gas sensor into the Enviro software is still on our to-do list - I don’t think there’s a Github issue about that one on the go if you wanted to open one? [Issues · pimoroni/enviro · GitHub](https://github.com/pimoroni/enviro/issues)

I think we were going to see if it was possible to pull in the Bosch drivers so we could use the official air quality algorithm, which is why we didn’t manage to implement it in time for launch.

Our current BME68X drivers do read the raw reading from the gas sensor though, so if you wanted to add some code to `indoor.py` to add that to your reporting in the meantime it should be fairly straightforward. You can read the gas element of the sensor on Enviro like this:

```auto
from breakout_bme68x import BreakoutBME68X
from enviro.board import i2c

bme688 = BreakoutBME68X(i2c, address=0x77)

data = bme688.read()
print(data[3])

```

---

<div class="post-metadata">

**Author:** ![GingerDownUnder](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gingerdownunder/32/8959_2.png) [@GingerDownUnder](https://forums.pimoroni.com/u/GingerDownUnder)\
**Post date:** [August 25, 2022, 10:55am UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/6 "2022-08-25T10:55:27Z")

</div>

Thanks all,

I was going to have a go at bringing the code across from the other boards tonight but looks like @hel has made it pretty simple for me. When I get a second I will open the GitHub issue if that helps put it on the official roadmap.

Kind Regards,

Pete

---

<div class="post-metadata">

**Author:** ![GingerDownUnder](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gingerdownunder/32/8959_2.png) [@GingerDownUnder](https://forums.pimoroni.com/u/GingerDownUnder)\
**Post date:** [August 25, 2022, 2:00pm UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/7 "2022-08-25T14:00:22Z")

</div>

So it appears that all required code is present, I was ignorant to the fact the BME688 included the “VOC” sensor. All that was required was adding to the return in the indoor.py file. For those in need simply add to the return definition near the top of the file:

```auto
  return [
    "temperature",
    "humidity",
    "pressure",
    "luminance",
    "color_temperature",
    "voc"
  ]

```

And in the return at bottom of the file as per below:

```auto
return {
    "temperature": round(data[0], 2),
    "humidity": round(data[2], 2),
    "pressure": round(data[1] / 100.0, 2),
    "luminance": lux_from_rgbc(r, g, b, c),
    "color_temperature": colour_temperature_from_rgbc(r, g, b, c),
    "voc": round(data[3], 2)
  }

```

According to the data sheet this returns a resistance in Ohms and not a particle count, but at least is a metric. You can create your own Indoor Air Quality index, see the following GitHub page on how others have done this previously:

[G6EJD - BME680-Example](https://github.com/G6EJD/BME680-Example)

Thanks for the help on this one!

Pete

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [August 25, 2022, 6:23pm UTC](https://forums.pimoroni.com/t/enviro-indoor-voc-readings/20118/8 "2022-08-25T18:23:11Z")

</div>

I’ll be playing around with some of this once my just recently placed order arrives. It’s going by snail mail so may be a week or more before I get it.
