# Enviro+ screen - turning it off

**URL:** <https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107>\
**Category:** Support\
**Created:** [June 1, 2020, 5:02pm UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107 "2020-06-01T17:02:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![umbongo](https://avatars.discourse-cdn.com/v4/letter/u/d26b3c/32.png) [@umbongo](https://forums.pimoroni.com/u/umbongo)\
**Post date:** [June 1, 2020, 5:02pm UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/1 "2020-06-01T17:02:15Z")

</div>

Hello and good afternoon!

I have a humble question about the Enviro+ HAT that I recently bought. I’ve followed the excellent tutorial here

[https://learn.pimoroni.com/tutorial/sandyj/enviro-plus-and-luftdaten-air-quality-station](https://learn.pimoroni.com/tutorial/sandyj/enviro-plus-and-luftdaten-air-quality-station)

But my question is: is there anyway to turn off the LCD screen on the Enviro+ please?

I run my PiZero-Enviro+ setup indoors and in my bedroom (as I want to monitor the air quality and particulate matter in the area where I sleep). However the LCD screen on the Enviro+ puts emits a lot of light and this makes it difficult to keep the room dark.

If you could provide the commands (Python or Bash) that would turn off the screen permanently (or until reversed as desired) that would be a great help! I’m happy at the Command Line for controlling the unit.

Thank you kindly

---

<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:** [June 1, 2020, 6:07pm UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/2 "2020-06-01T18:07:25Z")

</div>

BCM 12 is used for the backlight for the screen. I would think you could turn it off via that pin. You just have to figure out if you need to pull it low or high.

> **[Enviro Plus at Raspberry Pi GPIO Pinout](https://pinout.xyz/pinout/enviro_plus)**
>
> A package of environmental sensors for IoT projects

---

<div class="post-metadata">

**Author:** ![umbongo](https://avatars.discourse-cdn.com/v4/letter/u/d26b3c/32.png) [@umbongo](https://forums.pimoroni.com/u/umbongo)\
**Post date:** [June 2, 2020, 7:37am UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/3 "2020-06-02T07:37:15Z")

</div>

Is there no Python/Bash command to do that please?

---

<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:** [June 2, 2020, 8:48am UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/4 "2020-06-02T08:48:40Z")

</div>

I do believe it is this screen.

> **[0.96" SPI Colour LCD (160x80) Breakout – Pimoroni Store](https://shop.pimoroni.com/products/0-96-spi-colour-lcd-160x80-breakout)**
>
> A handy lil' LCD to add readouts to your projects. This 0.96" SPI LCD has a 2:1 widescreen aspect ratio, has great viewing angles (IPS), and works with Raspberry Pi or Arduino.

Which uses this python library

> **[pimoroni/st7735-python](https://github.com/pimoroni/st7735-python)**
>
> Python library to control an ST7735 TFT LCD display. Allows simple drawing on the display without installing a kernel module. - pimoroni/st7735-python

If you look through the examples you may be able to make up some code to turn it all black. Puling the backlight pin high or low should only take a couple of lines of python code. I’ll post something latter on when I get a chance, I’m just about to go out the door for an appointment.  
I don’t own an Enviro, but I do have one of those screens on the way. When it arrives, and I get a chance to play with it I’ll see if I can figure something out.

---

<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:** [June 2, 2020, 11:35am UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/5 "2020-06-02T11:35:51Z")

</div>

Have a look see here.  
[https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md](https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md)  
One of these two should turn it off on boot up. Not sure if the Enviro software will overide it though.  
gpio=12=op,dh  
gpio=12=op,dl

Another possible way to do it.  
[http://wiringpi.com/the-gpio-utility/](http://wiringpi.com/the-gpio-utility/)  
From command line it would “I think” be something like this.  
gpio -g mode 12 out  
gpio -g write 12 1  
or  
gpio -g write 12 0

If you wanted to get really fancy you could code it so its off in a dark room, and on if the lights are on. Using values from the light sensor.

---

<div class="post-metadata">

**Author:** ![sharpred](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/sharpred/32/5790_2.png) [@sharpred](https://forums.pimoroni.com/u/sharpred)\
**Post date:** [June 2, 2020, 12:55pm UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/6 "2020-06-02T12:55:48Z")

</div>

if you are using the enviroplus-python library from [Pimoroni’s github page](https://github.com/pimoroni/enviroplus-python) you can just do

```
 disp.set_backlight(0)

```

After doing something like this to initialise it :-)

```
# Create LCD instance
disp = ST7735.ST7735(
  port=0,
  cs=1,
  dc=9,
  backlight=12,
  spi_speed_hz=10000000
)

# Initialize display
disp.begin()
```

---

<div class="post-metadata">

**Author:** ![umbongo](https://avatars.discourse-cdn.com/v4/letter/u/d26b3c/32.png) [@umbongo](https://forums.pimoroni.com/u/umbongo)\
**Post date:** [June 4, 2020, 8:15am UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/7 "2020-06-04T08:15:41Z")

</div>

Ah thanks a lot sharpred, much appreciated for your help!

Yes, I inserted the line

`disp.set_backlight(0)`

just after the Initialize Display line in the luftdaten.py script. Whilst I’m running it the display is now off… and I can sleep in the dark again :-))))))

Anyway thanks a lot.

---

<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:** [June 4, 2020, 8:55am UTC](https://forums.pimoroni.com/t/enviro-screen-turning-it-off/14107/8 "2020-06-04T08:55:32Z")

</div>

Yes thank you @sharpred. Clip and pasted it to a text file for future use. I just got my 0.96 SPI LCD yesterday. I have it plugged into my Mini Breakout garden. That’s about as far as I got though. Going to play around with it today sometime.
