I want to make a temperature data logger by using Arduino.

I can read a data every 1sec and I want to store 30days data with date&Time.

In data logger, I want to write a temperature data with date&time in the .csv file and this file will be generated after I attaching USB.

So, Please suggest me Arduino board with USB compatible(working on 3V battery) and also suggest me EEPROM who able to store 30 days data.

  • Take a look at the Atmel SAMD21 xplained pro. Not an Arduino, but it's more powerful and has support for USB mass storage.
    – PhillyNJ
    Commented May 8, 2017 at 17:55
  • This sounds like a job for a Raspberry Pi
    – SDsolar
    Commented May 8, 2017 at 23:30

2 Answers 2


60 samples per minute, 60 minutes per hour, 24 hours per day, 30 days - that's 2592000 samples. At 10 bytes per sample (a very generous allocation) that's less than 30MB of data.

You could fit that many many times over on even the smallest of today's SD cards, so why mess with the complexity of USB? Any Arduino can work with an SD card.

A bigger concern of yours should not be the storage medium, which is trivial - you should instead be thinking about how you will run the board off a 3V battery for 30 days.

  • 2937600 = 60*60*24*34. 60*60*24*30 = 2592000. Commented May 8, 2017 at 14:22
  • @JamesWaldby-jwpat7 You're not wrong there. My mouse must have been operating in nonagesimal at the time...
    – Majenko
    Commented May 8, 2017 at 14:30

Despite your poor written question, I'll reply to you with a code, I used in my temperature logger 2 weeks ago. Includes LCD, temp sensor and SD card.

Delay is set for 9,1s which sums up with the calculation times of Arduino to 10 +/- 0.05 sec.
Lower it down to 100ms, if you want to be written every 1 second.

PS: The lower row, most right: There is a sign in letters, the condition of the sistem.

N = something's wrong, not inserted card/not connected SD card module
O = everything's okay, it's data logging

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <SPI.h>
#include <SD.h>
#define ONE_WIRE_BUS 6 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); LiquidCrystal lcd(8, 7, 5, 4, 3, 2);

const int chipSelect = 10;

void setup() {

  Serial.begin(9600);   Serial.println("Arduino Digital Temperature // Serial Monitor Version");   sensors.begin();
     lcd.begin(16, 2);   lcd.setCursor(0, 0);   lcd.print("Temperatura:");   //*********************************************
    while (!Serial) {   }   lcd.setCursor(15, 1);   lcd.print("??");   Serial.print("??");

  if (!SD.begin(chipSelect)) {
      lcd.setCursor(15, 1);
    return;   }   else   {   lcd.setCursor(15, 1);   lcd.print("OK");   Serial.println("OK");   }   //********************************************* }

void loop() {

  String dataString = "";

  float abc;

  sensors.requestTemperatures();     Serial.print("Temperature is: "); Serial.println(sensors.getTempCByIndex(0));   lcd.setCursor(0, 1);   lcd.print(sensors.getTempCByIndex(0));

  File dataFile = SD.open("datalog.txt", FILE_WRITE);

    if (dataFile) {
    dataFile.close();    Serial.println(sensors.getTempCByIndex(0));
       else {
    Serial.println("error opening datalog.txt");   }  

  //delay(9100);    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.