How to turn ILI9488 MAR3953 TFT LCD backlight off

@david_prentice
I'm wondering if I can turn the backlight of one of these displays backlights off either in the software or using a transistor?
I am using the MCUFRIEND library.

Here is a routine I use to blank the screen.

void fScreenBlanking( void *pvParameters )
{
  int       TimeOfPause = 10000 * 1000;
  uint64_t  PauseStartTime = esp_timer_get_time();
  bool      Pause = false;
  const int brightness = 250;
  int       countUpDown = brightness;
  for ( ;; )
  {
    if (!Pause )
    {
      //if motion detect then show display otherwise blank display
      if ( !(gpio_get_level( GPIO_NUM_27)) )
      {
        for ( countUpDown; countUpDown-- > 0; )
        {
          ledcWrite( 4, countUpDown ); // write to channel number 4, dim backlight
          vTaskDelay( 7 );
        }
      } else {
        Pause = true;
        PauseStartTime = esp_timer_get_time();
        ledcWrite( 4, brightness );
        countUpDown = brightness;
      }
    } else {
      // still detecting movement reset blanking pause time
      if ( gpio_get_level( GPIO_NUM_27) )
      {
        PauseStartTime = esp_timer_get_time(); // extend pause blanking time
      }
      if ( (esp_timer_get_time() - PauseStartTime) >= TimeOfPause )
      {
        Pause = false;
      }
    }
    vTaskDelay( 250 );
  }
  vTaskDelete( NULL );
} //void fScreenBlanking( void *pvParameters )

A Microwave Motion Detector is used to wake the screen up and after a time, the screen automatically goes back to sleep. Hope the code gives a few clues.

@Idahowalker
What kind of screen are you using?

I am using a display that has a backlight that can use PWM to brighten and dim the screen.

Is it a ILI9488?

Look at the pinout printed on the pcb.

There is no pin for controlling the backlight.

If you want to control the backlight on a TFT buy a shield with the specific hardware.
Waveshare make 240x320 Shields with software control of the backlight.
Waveshare makes a Blue 320x480 abortion e.g. https://www.waveshare.com/3.5inch-tft-touch-shield.htm but I don't support it.

There are several 3.3V SPI boards with Touch, SD and backlight control.
But this means that you have to use level-shifters with your 5V Mega2560.

Be realistic. If you are using a TFT you will probably power via USB.
It is not practical to use batteries.

David.

@david_prentice
If I unplug the 5v pins from my screen, it turns the backlight off, but the display itself is still on and displaying things. Can I not just turn power off to the 5v pins using digitalWrite or a transistor?

A Adafruit_ST7789.

I don't think mine works like yours does, but thanks anyway mate.

No, this is not a good idea. The ILI9488 controller spec is seriously violated.
I am fairly certain that the 5V powers the AMS1117-33 regulator chip. The electronics are powered from the AMS1117-33.

It would be ok if the 5V only powered the backlight. And the controller is powered by permanent 3.3V from the Arduino.

@david_prentice
Oh, okay. That's a shame.
Can you give me a link for a good 4 inch super high res screen for arduino that I CAN turn off via software, and is easy to use with your MCUFRIEND library?

@david_prentice
So what screen will work on a mega (as in not a uno shield)??

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.