DHT11 TO EEPROM

Hello,

I'd like my arduino to take temperature readings every hour for a period (which will depend on my battery life I suppose). Given the readings will be taken every hour, can they be written to EEPROM, as opposed to saving to an SD card?

This my code

#include <SimpleDHT.h>
#include <LiquidCrystal.h>
const int pinDHT11 = 6;
SimpleDHT11 dht11;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {

lcd.begin(16, 2);

lcd.print("Startup OK!");
delay(1000);

lcd.clear();
}

void loop() {
byte temperature = 0;
byte humidity = 0;
int x , y ;

dht11.read(pinDHT11, &temperature, &humidity, NULL);

Serial.begin(9600);

Serial.println ("temperature");
Serial.println (temperature);
Serial.println ("humidity");
Serial.println ( humidity);

lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(round(temperature));
lcd.print("C / ");

lcd.print(round(temperature * 1.8 + 32));
lcd.print("F ");
lcd.setCursor(0,1);
lcd.print("Humidity: ");
lcd.print(humidity);
lcd.print("% ");

delay(30000);

}

Yes, you could write your data to EEPROM. On an Uno, there's 1K available, so at 2 bytes of data per hour, you've got 512 hours of readings or ~21 days.

You might want to use the first couple of bytes to tell you where the next reading is to be stored so you can recover if there's a power issue.

Presumably you'll need something in your sketch to extract that data, sending it to the serial port perhaps.

as opposed to saving to an SD card

SD card makes a lot more sense to me.

What will you do with the saved data? Presumably you're saving it for a reason, perhaps taking to the pc to examine in a spreadsheet, graph and print etc etc. Or you just want to look at it in a year's time to compare. Well nigh impossible to do that from eeprom, but a doddle with an sd card.

wildbill:
Yes, you could write your data to EEPROM. On an Uno, there's 1K available, so at 2 bytes of data per hour, you've got 512 hours of readings or ~21 days.

You might want to use the first couple of bytes to tell you where the next reading is to be stored so you can recover if there's a power issue.

Presumably you'll need something in your sketch to extract that data, sending it to the serial port perhaps.

21 days very good
but how i can make the code i tried many but could not

Post your best attempt.