1,8" TFT ST7735 backlight control

Dear ladies and gentlemen,

First of all thank you in advance for reading my first post on this forum!

I know this is a common topic on the internet. However, after reading many posts, I have not solved my doubts/ problems yet, so there we go:

I am working on a project involving a 1,8" TFT display with ST7735 driver (which you may find here https://www.banggood.com/1_8-Inch-TFT-LCD-Display-Module-SPI-Serial-Port-With-4-IO-Driver-p-1164351.html?p=DQ30066511122014069J&utm_campaign=educ8stv&utm_content=3216 ).

My main occupation now is to reduce power consumption, since I want this to be in a battery powered gadget. I tried first putting the arduino in sleep mode, but as you know this does not turn off the GPIOs and nor the power source for other components. Then I started focusing on the TFT, and it is where I am stuck:

  • First questions: When we refere to "turn down backlight", does this mean to turn off the display? I mean, with the backlight off, should you be able to see content in the screen (although with less contrast)?

Then, there are some solutions I have read, but they are not working on my case, let me expose:

  • Open the VCC line with a MOSFET -> if I open the VCC line (disconect the VCC wire on the breadboard), the display keeps displaying stuff, although it looks ugly (where does it takes the energy from?).

  • Open the GND line -> the displays keeps showing contect but with less contrast (looks good), but I personally do not like to have the GND of the TFT floating. (here the power consumption is reduced from 120mA to 27mA).

An finally, the last thing I do not understand, related to the backlight:

  • If I disconnect the VCC pin, the display continues showing the correct content (I have a program that changes the contect every 5s for test) and the power consumption continues around 118-120mA. However, if I disconnect LED pin, the TFT turns completely dark, and the power consumption drops to 0mA.

Any idea to explain this and how to reduce power consumption? (I have also read about feeding the LED pin with a PWM signal, but I guess that because of current limit, I have to work above 80-90% of duty to display something not very ugly, so I do not like neither).

Thank you once again,

Have a nice day!

  1. switch the LED pin e.g. with AVR pin(s) or external transistor if you have an ARM or ESP
  2. issue Sleep command to ST7735
  3. sleep Arduino MCU

Be realistic. Arduino hardware is not designed for low sleep current. Your backlight LED takes 20-40mA.
Make sure that you have a suitable series resistor.

Some displays have a switching transistor on the pcb for the LED.
Your Red ST7735 board does not have a transistor.

David.

Hi david_prentice,

Thank you! I appreciate your answer!

Just right now I was reading another post about sleep modes of the ST7735 where you also answered, but I am having compiling errors (link How to turn off a TFT display? - Displays - Arduino Forum):

I defined the commands and add the functions in the .h file (this sould not be done in the .cpp right?):

#define ST7735_SLPIN 0x10
#define ST7735_SLPOUT 0x11
void sleep(void) { writecommand(ST7735_SLPIN); }
void wake(void) { writecommand(ST7735_SLPOUT); }

But when compile the code, even without calling any of these functions, I receive the following error:

error: 'writecommand"was not declared in this scope.

Could you explain how to fix it ("I get a bit lost with public or private functions")?

Thank you!

Kind regards,

Go on. Say which library. Say which version.

Are you editing a library or your sketch?

If you give proper information, you will get a sensible answer.

If you are not a "library author" I would avoid altering the library.

You can either put a helper function in the sketch or write a "super" class that extends the current library class. When debugged, you can use it with other programs.

Helper functions are a lot easier.

David.

Hi,

You are right, I should have specified more:

library: Adafruit ST7735 and ST7789 v1.2.6 (together with Adafruit GFX v1.3.4).

I edited the the h file directly with Notepad++.

I look forward for your feedback :slight_smile:

Kind regards,

I have v1.2.4 and v1.3.4 on this desktop at the moment.

writecommand() is a protected method of the Adafuit_SPITFT class.

Adafruit_ST7735 inherits from Adafruit_ST77xx inherits from Adafuit_SPITFT inherits from Adafuit_GFX.

So you should be able to add your public sleep() method into the Adafruit_ST7735 class declaration.
And you can put the executable statements as a definition directly in the class declaration.

It looks as if this is the only way to implement your sleep().

In the old days before SPITFT you could write commands directly to the TFT registers i.e. in your sketch.

I would just add a GLUE class in the sketch. A class can access protected members. The public riffraff can't.

It all gets a little fiddly. It helps to paste/attach a minimal project.

David.

Hi David,

Thank you very much, I will work on that.

Will post results!

Kind regards,

Hi David,

Finally I succeeded to write commands (continue reading, no great results):

modifications in the .h file:

#define ST7735_SLPIN 0x10
#define ST7735_SLPOUT 0x11
#define ST7735_DISPOFF 0x28
#define ST7735_DISPON 0x29

void displayoff();
void displayon();
void displaysleep();
void displaywake(); //inside of the public class.

modifications in the .cpp file:

void Adafruit_ST7735::displayoff() {
startWrite();
writeCommand(ST7735_DISPOFF);
delay(150);
endWrite();
}
void Adafruit_ST7735::displaysleep() {
startWrite();
writeCommand(ST7735_SLPIN);
delay(150);
endWrite();
}

I tested this, and the screen goes white when write displayoff, however the power consumptions continues being 118mA. It also looks like there is no difference when applying the displaysleep.

Coming back to the origins, how can we explain that if opening the VCC line (no voltage in the LED pin nor on the VCC pin) the display keeps showing content (and changing, so processing) although with bad quality, whereas when opening only the LED pin, the displays goes off and power consumption goes 0mA?

Finally, some manufacturers (i.e. Afafruit) propose to connect everything without serial resistors. Where would you add resistors? LED pin only?

Thank you,

Kind regards,

It makes little difference to overall current when you sleep the TFT controller.
The backlight takes the significant current. Make sure that you have an appropriate series resistor.

I am running a 3.3V Red 128x160 display on a 3.3V Uno clone. 40mA current as measured by a USB dongle. It still says 40mA when I sleep the controller.

I can run the same program on a 3.3V Blue 240x240 display on a 3.3V Uno clone. 10-20mA but of course it is a smaller screen. Not only can I sleep the ST7789 but I can switch the LED off completely.

Regarding sketches.

#include <Adafruit_ST7735.h>

class GLUEAdafruit_ST7735 : public Adafruit_ST7735
{
    public:
        GLUEAdafruit_ST7735(uint8_t CS, uint8_t RS, uint8_t SID, uint8_t SCLK, uint8_t RST) : Adafruit_ST7735(CS, RS, SID, SCLK, RST) {}
        GLUEAdafruit_ST7735(uint8_t CS, uint8_t RS, uint8_t RST) : Adafruit_ST7735(CS, RS, RST) {}
        void sleep(void) { startWrite();writeCommand(0x10);endWrite();}
        void wake(void) { startWrite();writeCommand(0x11);endWrite();}
    
};

GLUEAdafruit_ST7735 tft(10, 9, 8);

The "super" class inherits everything that Adafruit_ST7735 can do.

In theory it should be able to do every GFX method. It compiles ok with drawRGBBitmap() but fails on the link. However other GFX methods like drawCircle() link ok.

You can switch a 40mA LED with two AVR GPIO pins. 114mA sounds like a very bright LED.

David.

Edit. Links ok now.

Adafruit_super.zip (21.7 KB)

Hi david,

Big thanks again. Let's try this.

Kind regards,

Since there are lot of discussions about the backlight and power consumption of the 1,8" display I want to share my experience in this topic. (It's the most recent I could find)

I also was wondering why 33% of the people say they need around 2mA, the next 33% measure 40mA and the others 100-120mA.

I build a lot of devices which are battery powered (900mAh eneloop pro) and needed to last at least 8 hours incl. a Nano and a nrf24.
Of course, this was absolutely not possible when the display light is fully turned on.
I started to do somes test and figured out that there must be some kind of high impedance in the LED curcuit. So I drew out the circuit diagram under the microscope.
All should be clear now, see picture.

5mA current consumption of the display is high enough to have a good quality and readable screen. Except when you use only the natural colors red and blue. For them, the light is too weak and it must be increased to 15mA. My displays draws 59mA when fully turned on via PWM 255.

1,8 TFT scematics.pdf (306 KB)

Why would you bother with PWM?

Just select a suitable series resistor for bright display. (probably 20mA - 40mA)

Use a GPIO pin to switch the backlight off. (two PORT pins if you want > 40mA)
Use a software command to SLEEP the controller.

But the obvious "power-saving" decision would be to run the display at 3.3V (or even 2.8V)

David.

Hi David,

did you look at my pdf? I guess not!
Why i use PWM? Because i can.
For what i should use a sleep mode? I need the display to show stuff all the time, but i do not need it with full light. In my opinion this sleep mode is completely nonsense if there is only 800µA when backlight is off (PWM=0)
full light = 59mA. good visible = 5mA. Guess what i have chosen :wink:
And yes. For sure I use 3,3V and shorted out this inefficient LDO.

br,

Ok, I can understand different backlight levels for different ambient levels.

I would not think that TFT is practical for continuous battery operation.
Transreflective LCD would be more appropriate.

But some form of sleep-inactivity would give you the best of both worlds. Vibrant colour when required with low battery consumption i.e. just like your mobile phone.

Anyway, it is your project. Your design decisions.
What do you think the NRF24L01 does?

David.

sry David,

my post was just to help other guys out when they have the same issue and need lower current consumption for THIS TYPE of tfts for whatever and how they will use it. After checking google & co. i saw that there is some missing information people(beginners) need.

Your first answer was completely useless because you did not even looked to the pdf. Just wrote something. Maybe you needed attention. I dont know. Hopefully your 6708 other posts in "DISPLAYS" are more useful.

In you second answer you try to tell me what i want and what i should do for a project you do not even know anything about. This is not your business and it's not the topic here. I just wanted to help others.

forget it please and stop answering me here.
I do not want to mess up an informal thread.

br,

Thank you very much Roman.. different David here :slight_smile:
Just a quick question, any new suggestion on how to reduce the power even further? Looking to use a ESP32 (using BLE only) with the 1.8'' or 2.2'' display and some buttons, do you think a configuration like that could last a week or more? New to all of this and trying to get some idea to see which parts make more sense to buy.
The device wouldn't need to be on 24x7, just for 4-8h per day and would be basically like a stopwatch with some extra numbers that communicates with a phone via BLE.
Thanks in advance!