Setting a pin high when going to sleep.

My current project is running great and I am getting months of use ( mostly sleep) out of a single 2400ma Li Ion cell.

I want to add a OLED display(16x2 Newhaven) and apparently the display will draw about 5ma of current when it is turned off via code. This will kill my battery life.

An option is to power it via a P channel MOSFET controlled by a D pin. As it is now all my pins are driven low when asleep. But to power the display I will need to drive the pin low when awake and hi when asleep. Will this draw more power?

I have tried powering the OLED directly via a D pin ( even tried 2 paralleled D pins) but this resulted in strange readings on A pins.

Should I use the D pin to drive a N channel FET that drives a P channel FET that supplies 3.7v to the OLED?

What other options do I have?

Thanks.

Should I use the D pin to drive a N channel FET that drives a P channel FET that supplies 3.7v to the OLED?

Yes.

What other options do I have?

Not a lot because this processor does not maintain the logic levels on a pin when going to sleep.

Thanks. By the way its a Sanguino 644 if that makes any difference. Would using transistors or a transistor and a FET be any better in any way?

Grumpy_Mike:
Not a lot because this processor does not maintain the logic levels on a pin when going to sleep.

Empirical tests do not support this theory.

#include <avr/sleep.h>

const byte LED = 8;

void setup () 
  {
  pinMode (LED, OUTPUT);
  }  // end of setup

void loop () 
{
  // flash
  digitalWrite (LED, HIGH);
  delay (100);
  digitalWrite (LED, LOW);
  delay (100);

  // turn back on
  digitalWrite (LED, HIGH);
  
  set_sleep_mode (SLEEP_MODE_PWR_DOWN);  
  sleep_mode ();  
  
  } // end of loop

The LED stays on.

this processor does not maintain the logic levels on a pin when going to sleep.

It does indeed hold the levels. I have a remote control, it wakes up when a button is pressed. I had a hard time getting an interrupt generated when coding it because the columns for the keypad are programmed High when it is not being scannned. I had to drive them low so Diode And between column pins and Interrupt pin (with internal pullup) would work. It sleeps in Power Down Sleep Mode (the deepest sleep) and the levels are held.