Hello I was wondering something. I have a project using the Arduino pro mini, With the Nokia 5110 LCD and the Temperature/ Humidity Sensor the BME280. I got everything working and looks good. But i want to use it on Battery. So The key thing is to put the Arduino into sleep mode. I haven't tried sleep mode yet but i have saw others do it and I think i can do it But one problem remains The BME280 if powering it down and Also Powering the Nokia 5110 LCD down then reapplying Power to it the BME280 takes a while to Settle. So while that is happening I'm thinking that the Arduino will go back to sleep. From what I'm reading from Bosh website where the BME280 comes from the Datasheet says it takes anywhere from 1.8 to 3.6 Nano amps to run it. Now it could be more but that is Very low Power. I'm thinking of maybe Keeping the BME280 fully Power up. Also the Nokia LCD Fully power up from what I'm reading from a few websites the Nokia LCD It's all over the Place on what the Current is But it also looks like in the nano amps range So maybe Keep that running as well. But which leads me to the Reset pin when Trigger Low or High it resets the LCD. So not sure how to program it to make it keep the Last status of the BME280 displayed on the LCD.
This is my Sketch below. I need help to figure out how to keep it from Resetting. If anyone has any idea's please let me know? Thank you
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
#include <Adafruit_BME280.h>
#include <Wire.h>
Adafruit_BME280 bme; // I2C
#define bme_ADDRESS 0x76
// SDA - A4 (D18)
// SCL - A5 (D19)
Adafruit_PCD8544 lcd = Adafruit_PCD8544(6, 5, 4, 3, 2);
// D7 - Serial clock out (CLK)
// D6 - Serial data out (DIN)
// D5 - Data/Command select (DC)
// D4 - LCD chip select (CE)
// D3 - LCD reset (RST)
float Temperature;
int Pressure, Humidity;
void setup() {
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
digitalWrite(9, LOW);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
lcd.begin();
lcd.setContrast(30);
lcd.clearDisplay();
Wire.begin();
bme.begin();
delay(1000);
set_sleep_mode (SLEEP_MODE_PWR_DOWN);
sleep_enable();
sleep_cpu ();
}
void loop(void) {
lcd.clearDisplay();
lcd.setTextSize(1);
lcd.setCursor(0,0);
lcd.print(bme.readPressure()/1.333);lcd.print(" MMHG");
lcd.setCursor(0,10);
lcd.setTextSize(2);
lcd.print(bme.readTemperature(),1);lcd.print("c");
lcd.setCursor(0,30);
lcd.print(bme.readHumidity());lcd.print("%");
set_text(60,40,"",BLACK);
delay(1000);
}
void set_text(int x,int y,String text,int color){
lcd.setTextColor(color);
lcd.setCursor(x,y);
lcd.println(text);
lcd.display();
}
Looking at Nickgammon site about sleep i did mange to get it sleeping But I'm a little confused on how to wake it up after 2 minutes and Refresh stuff what is displayed with the newest information.