Powering off Adafruit_TFTLCD

I am trying to find a way to power these off should I wish to conserve battery power.

First thing I did was stick a switch in between the LCD shield GND pin and the GND pin of the arduino.

However, when the switch is turned off, there is a bit of leakage current going such the the LCD screen remains dimly lit.

Next thing I tried was adding powerOn() and powerOff() functions to the class Adafruit_TFTLCD. However there is still leakage current happening such the the screen remains dimly lit with the switch off.

Any suggestions on where else the current might be leaking through?
Has anyone attempted powering down these screens when not in use?

void Adafruit_TFTLCD::powerOff()
{
	#ifdef USE_ADAFRUIT_SHIELD_PINOUT
	  pinMode(A4, INPUT_PULLUP);
	  pinMode(A3, INPUT_PULLUP);
	  pinMode(A2, INPUT_PULLUP);
	  pinMode(A1, INPUT_PULLUP);
	  pinMode(A0, INPUT_PULLUP);

	  pinMode( 2, INPUT_PULLUP);
	  pinMode( 3, INPUT_PULLUP);
	  pinMode( 4, INPUT_PULLUP);
	  pinMode( 5, INPUT_PULLUP);
	  pinMode( 6, INPUT_PULLUP);
	  pinMode( 7, INPUT_PULLUP);
	  pinMode( 8, INPUT_PULLUP);
	  pinMode( 9, INPUT_PULLUP);

	  pinMode(cs, INPUT_PULLUP);
	  pinMode(cd, INPUT_PULLUP);
	  pinMode(wr, INPUT_PULLUP);
	  pinMode(rd, INPUT_PULLUP);
	  pinMode(reset, INPUT_PULLUP);
	#endif
}

void Adafruit_TFTLCD::powerOn()
{
	init();
}

First thing I did was stick a switch in between the LCD shield GND pin and the GND pin of the arduino.

?

boylesg:
Any suggestions on where else the current might be leaking through?

i recon the touchscreen has an X,Y & Z parameter that read resistance via powering one pin and reading the voltage on the other.

boylesg:
Has anyone attempted powering down these screens when not in use?

Me not.

Never mind I nutted it out by experimenting with all the stuff in the Adafruit_TFTLCD::begin() function.

This completely shuts off the display and the backlight and then turns it on again in combination with my physical switch.

Just a matter of setting up some code to detect when the physical switch is thrown.

void Adafruit_TFTLCD::displayOff(void) 
{ 
	setReadDir();
    writeRegister8(ILI9341_DISPLAYOFF, 0);
}

void Adafruit_TFTLCD::displayOn(void) 
{ 
	begin();
}

boylesg:
Never mind I nutted it out by experimenting with all the stuff in the Adafruit_TFTLCD::begin() function.

This completely shuts off the display and the backlight and then turns it on again in combination with my physical switch.

Just a matter of setting up some code to detect when the physical switch is thrown.

void Adafruit_TFTLCD::displayOff(void) 

{
setReadDir();
    writeRegister8(ILI9341_DISPLAYOFF, 0);
}

void Adafruit_TFTLCD::displayOn(void)
{
begin();
}

Bugger. False alarm. The above code only works if the physical switch is turned off then the device starts up.

For crying out loud there must be a way to turn the damn back light off at will!

The datasheet tells me it can be turned off through command 'Write CTRL Display (53h)'

But I just don't comprehend how to do it practically in code.

AWOL:
?

I believe what AWOL is getting at here is that it is a totally wrong and bad idea to power down a peripheral device by interrupting the ground lead.

Try interrupting the power lead! And you may still get some fair current through the I/O lines, make those lines INPUT during the shutdown. Or you can limit current by placing a resistor in series with the output lines, that will reduce the ability of a HIGH output to power the device.

a7

alto777:
I believe what AWOL is getting at here is that it is a totally wrong and bad idea to power down a peripheral device by interrupting the ground lead.

Try interrupting the power lead! And you may still get some fair current through the I/O lines, make those lines INPUT during the shutdown. Or you can limit current by placing a resistor in series with the output lines, that will reduce the ability of a HIGH output to power the device.

a7

Interrupting the Vcc lead doesn’t seem to shut it down at all as long as all the other leads are connected.
Think it might be a case of for any device using one of these TFTLCD shields, battery power is just not an option.

You need to prevent parasitic powering via all the other lines. Every signal that is an input on the shield needs to be 'cut'.

I think you need to look at tristate buffers (bit tricky with a shields to add them :wink: ).

The OP I see now does put all the lines into the input mode.

Why doesn't that work to end the supply of parasitic power from the arduino to the LCC?

Did he miss a few or is something subverting his intentions? I've seen this used in other cases far away, not shields.

a7

No idea

Minimum Rpu is 20k (328P); roughly 20 in parallell would make it 1k so 5mA can be delivered by the Arduino @5V. Making them just INPUT (and writing them LOW) instead of INPUT_PULLUP might do the trick.

I did see the INPUT_PULLUP but did not pay attention to it :frowning:

Use two transistors / MOSFET's, minding the power draw of the LCD, to switch on/off both VCC and GND to the LCD. When the display is off set all data pins to INPUT (activating the pullup will consume slightly more current). This should effectively prevent the LCD from drawing any current when it is not used.

alto777:
I believe what AWOL is getting at here is that it is a totally wrong and bad idea to power down a peripheral device by interrupting the ground lead.

Why? I am doing that to different peripherals (radio's, sensors etc.) in some of my gizmo's and it works perfectly with less power draw than had I used the low power mode of the peripherals. In this case - with the LCD - it may not be a viable sollution due to the nature of the display, but I do not think that it is a "totally wrong and bad idea" in general :slight_smile:

Danois90:

Why? I am doing that to different peripherals (radio's, sensors etc.) in some of my gizmo's and it works perfectly with less power draw than had I used the low power mode of the peripherals. In this case - with the LCD - it may not be a viable sollution due to the nature of the display, but I do not think that it is a "totally wrong and bad idea" in general :slight_smile:

Suit yourself. You know more than I do. But if I see a bomb, Imma still going to cut the red wire.

a7

Danois90:
Use two transistors / MOSFET's, minding the power draw of the LCD, to switch on/off both VCC and GND to the LCD. When the display is off set all data pins to INPUT (activating the pullup will consume slightly more current). This should effectively prevent the LCD from drawing any current when it is not used.

Why? I am doing that to different peripherals (radio's, sensors etc.) in some of my gizmo's and it works perfectly with less power draw than had I used the low power mode of the peripherals. In this case - with the LCD - it may not be a viable sollution due to the nature of the display, but I do not think that it is a "totally wrong and bad idea" in general :slight_smile:

That hadn't occurred to me, i.e. to try a double gang switch on both Vcc and GDN.
Thanks for the idea will give it a try.