Temprature sensor suggestion.

Hello !

I want to learn how to use arduino with 3 other peripheral devices. The first is a Real Time Clock the second is a temperature sensor and the third is an SD card reader/writer.

What better way than build a project with all of them huh ?

So im thinking to build an arduino that will read the temeprature from the sensor and record it on the SD card together with the time stamp that the reading was taken.

I have arduino uno and mega boards also i have a DS1307Z real time clock module thet talks through I2C and a micro SD module that i think talks through SPI.

What i dont have is a temperature sensor. I am not sure what kind of sensor would be better to use. An analog one or a digital one (im not even sure if digital sensors exist).

So could you suggest me a temperature sensor to get started with ?

THANK YOU !

You can measure either digital or analog temperature, or both, it's really your choice.

There are many digital temp sensors to choose from, three of the common ones are DHT11, DHT22, and DS18B20. The DHT22 is a more accurate (and probably more expensive) version of the DTH11, both of which also measure humidity. Lots of tutorials online on how to use them with Arduino. Adafruit probably has tutorials for all of them given that they sell all of them.

A common analog temp sensor is the LM335.

Thank you for the suggestions.

I might try both analogue and digital sensors.

The analog sensor gets used, obviously, with an analog input pin. Here's a good general page on using the LM335:

http://web.mit.edu/rec/www/workshop/lm335.html

If yo have WiFi near, then a WeMos D1 mini with DS18B20 is all you need. No other parts needed if you pull NTP time of the net (like your laptop/PC) and store temp/timestamps on the internal 4MB flash (SPIFFS). Code example on this guide. Leo..

I am working on a similar project (2 thermocouples, microSD, LCD) using a Leonardo, but no RTC. https://www.adafruit.com/product/269 They work with software SPI. The K-type thermocouple is $10 extra.

MK1888: The analog sensor gets used, obviously, with an analog input pin. Here's a good general page on using the LM335: http://web.mit.edu/rec/www/workshop/lm335.html

Thats a good start Thank you.

Wawa: If yo have WiFi near, then a WeMos D1 mini with DS18B20 is all you need. No other parts needed if you pull NTP time of the net (like your laptop/PC) and store temp/timestamps on the internal 4MB flash (SPIFFS). Code example on this guide. Leo..

Thanks. I actually want to get to know how to use each peripheral as "standalone" system with the microcontroller. I dont really need to get temperature readings or anything :) The whole project is just an idea so that ill get to know how to program them.

runaway_pancake: I am working on a similar project (2 thermocouples, microSD, LCD) using a Leonardo, but no RTC. https://www.adafruit.com/product/269 They work with software SPI. The K-type thermocouple is $10 extra.

I will take a look. Thank you !

P.S. Now that you mentioned the term thermocouple. I do have some pices of those ANALOG DEVICES 2B52A THERMOCOUPLE TRANSMITTER 2B52A-1-K-06 Type K.

Regarding the choice of temperature sensor, it depends on what you're measuring.

If you're measuring the temperature in a kiln then none of the sensors suggested by MK1888 will work because they will catch on fire!

If you're measuring ambient air temperature then a thermocouple is a poor choice.

LM75 is another digital thermometer which uses I2C. May be more convenient to use together with the RTC. There is soooo many ways to measure temperature. Thermocouple, thermistor, RTD, contactless, analog or digital IC. Measuring forward voltage drop of any diode (or even a LED) may be used to measure its temperature. It depends on your requirements - cost, precision, current consumption, temperature range, voltage range... Arduino Uno has already a temperature sensor built in. I guess Mega has it too.

Good point pert.

For the time being i want to learn how to program and measure ambient air temp. Maybe in the future i will experiment in measuring temperatures on heatsinked semiconductors.

Smajdalf: LM75 is another digital thermometer which uses I2C. May be more convenient to use together with the RTC. There is soooo many ways to measure temperature. Thermocouple, thermistor, RTD, contactless, analog or digital IC. Measuring forward voltage drop of any diode (or even a LED) may be used to measure its temperature. It depends on your requirements - cost, precision, current consumption, temperature range, voltage range... Arduino Uno has already a temperature sensor built in. I guess Mega has it too.

I had no idea. Never seen it written

Here's a tutorial on the internal temperature sensor on your Uno: https://playground.arduino.cc/Main/InternalTemperatureSensor/

Note this is measuring the temperature inside the ATmega328P, which will be significantly higher than ambient temperature due to the heat produced by the IC.

Unfortunately, the ATmega2560 microcontroller on your Mega does not have the internal temperature sensor.

pert: Note this is measuring the temperature inside the ATmega328P, which will be significantly higher than ambient temperature due to the heat produced by the IC.

Unless you sleep to let it cool down before measuring... In fact any sensor needs lot of care to measure the true temperature. Many are self-heating. IIRC DS18B20 increases its temperature by 1 or 2 °C if you measure continuously and constantly poll for a new result. OTOH connecting wires to a thermocouple leads some heat away so it is a bit cooler than the measured something. Measuring any temperature is very interesting topic with a lot of surprises.

Smajdalf: Measuring any temperature is very interesting topic with a lot of surprises.

I guess :)

pert: Here's a tutorial on the internal temperature sensor on your Uno: https://playground.arduino.cc/Main/InternalTemperatureSensor/

Note this is measuring the temperature inside the ATmega328P, which will be significantly higher than ambient temperature due to the heat produced by the IC.

Unfortunately, the ATmega2560 microcontroller on your Mega does not have the internal temperature sensor.

An internal temp sensor is a very good feature for projects in hot environments. Too bad the Mega board does not support it.