Temparature logger

Hi Everyone.

I'm fully new to the Arduino language and having a large difficulty getting to create my code.

I have an UNO board with an LCD 16x2 keypad shield. I also have a DS1307 and a micro SD card module.

I'm trying to compile a code that reads the temperature from 2 or more NTC 100 sensors, display the result on the screen along with the time and date and most importantly register the readings onto the SD card.

I was able to find codes for each function apart and got them to work, but I can seem to merge all into one, and i'm running out of time fast.

Hope someone can help me with that.

Thanks in advance.

How about you post the code you have, using the code tags, so that people can look at where you are at already.
When I built my datalogger I mashed together a number of coding examples, it works but is so ugly and long winded. There are a number of examples online which will help.
Are you using the keypad to enter data?

dear Kiwi

this is my code, which is not working and have a lot of problems.

#include <SPI.h> //for the SD card module
#include <SD.h> // for the SD card
#include <LiquidCrystal.h>
#include <RTClib.h> // for the RTC

// change this to match your SD shield or module;
// Arduino Ethernet shield and modules: pin 4
// Data loggin SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
const int chipSelect = 4;

int ThermistorPin = 1;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

// Create a file to store the data
File myFile;

// RTC
RTC_DS1307 rtc;

void setup() {
//initializing Serial monitor
Serial.begin(9600);

// setup for the RTC
while(!Serial); // for Leonardo/Micro/Zero
if(! rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
else {
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(F(DATE), F(TIME)));
}
if(! rtc.isrunning()) {
Serial.println("RTC is NOT running!");
}

// setup for the SD card
Serial.print("Initializing SD card...");

if(!SD.begin(chipSelect)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");

//open file
myFile=SD.open("DATA.txt", FILE_WRITE);

// if the file opened ok, write to it:
if (myFile) {
Serial.println("File opened ok");
// print the headings for our data
myFile.println("Date,Time,Temperature ºC");
}
myFile.close();
}

void loggingTime() {
DateTime now = rtc.now();
myFile = SD.open("DATA.txt", FILE_WRITE);
if (myFile) {
myFile.print(now.year(), DEC);
myFile.print('/');
myFile.print(now.month(), DEC);
myFile.print('/');
myFile.print(now.day(), DEC);
myFile.print(',');
myFile.print(now.hour(), DEC);
myFile.print(':');
myFile.print(now.minute(), DEC);
myFile.print(':');
myFile.print(now.second(), DEC);
myFile.print(",");
}
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.println(now.day(), DEC);
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.println(now.second(), DEC);
myFile.close();
delay(1000);
}

void loop() {

Vo = analogRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2logR2 + c3logR2logR2logR2));
T = T - 273.15;

//debugging purposes
Serial.print("Temperature: ");
Serial.print(t);
Serial.println(" *C");
//Serial.print(f);
//Serial.println(" *F\t");

myFile = SD.open("DATA.txt", FILE_WRITE);
if (myFile) {
Serial.println("open with success");
myFile.print(t);
myFile.println(",");
}
myFile.close();
}

void loop() {
loggingTime();
loggingTemperature();
delay(5000);
}

one more thing, I still need to make a measurement for at least 3 NTC sensors.

Whats not working?
What are the problems?

For 3 Sensors you need to read each one and store separately but that is also simple, I was recording temp and humidity as two values, once you get one sensor working adding the other two is reasonably simple.

this is my code, which is not working and have a lot of problems.

That's a long sentence that says nothing.

Please remember to use code tags when posing code.

Could I just point out that this thread was moved here from a section which has the following thread title posted in bold as the very first topic :

PLEASE DON'T POST YOUR QUESTIONS HERE IN "Introduction".

Would it be impertinent to ask why you ignored it?

Sorry guys. As i said earlier, I’m new to this.
As to what I’m looking for is for someone to pickup this code above and fix it if possible so it can work (i really have no idea what’s wrong). Please with my ignorance

jacques77:
I'm trying to compile a code that reads the temperature from 2 or more NTC 100 sensors...

NTC-100 sensors are 100ohm at 25C.
Code seems to be for a 10kohm thermistor.
What is the value of your fixed resistor (should also be 100ohm if you're interrested in room temp measurements).
Leo..

Dear Leo,
The thermistor is an ntc 100k not 100 (i missed the “k” earlier)

The code for that alone is correct, i tried it.

The problem is the compilation of all features.

Anyone? Help