Welcome to this Arduino Data Logger Project video. This data logging project is very easy to build even for beginners to Arduino programming. Let’s start!

Intro to the Arduino Data Logger Project

This project reads the temperature every few minutes and stores the data in a micro SD card it is the simplest possible datalogger. It consists of an Arduino Nano, this one here a DS3231 Real time clock module, this one here, and an SD card module. This module here. The DS3231 RTC has a temperature sensor embedded so we don’t need any other components except those two modules. The cost of the project is very low. 3 Euros for the Arduino Nano, 2 Euros for the SD card module and about 1,5 Euros for the Real-Time clock. So the total cost is around 6,5 Euros.

——————–
WHERE TO BUY
——————–

1. DS3231 RTC: https://educ8s.tv/part/DS3231

2. Micro SD card module: https://educ8s.tv/part/MicroSDModule

3. Arduino Nano: https://educ8s.tv/part/ArduinoNano

4. Multimeter Mastech 8268: https://educ8s.tv/part/Multimeter

5. AA Battery holder: https://educ8s.tv/part/BatteryHolderAA

6. Small Breadboard: https://educ8s.tv/part/SmallBreadboard

7. Wires: https://educ8s.tv/part/Wires

8. Batteries: http://amzn.to/2b3Fh88

Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!

[adsense]

Let’s now see how to connect those modules together in order to build this simple data logger. I have removed all the wires in order to show you how to connect the modules. for details about each module please check our previous tutorials. We have prepared detailed tutorials for each module. So let’s start by connecting the power to each module. Vcc is connected, Vcc from each module goes to breadboard Vcc, and we have connected the breadboard Vcc to Vin on the Arduino Nano. We have connected all the Grounds to the breadboard Ground. Now, let’s connect the Real Time Clock. Pin SCL from the Real Time Clock goes to analog pin 5 on the Arduino Nano. Pin SDA from the Real Time Clock goes to analog pin 4 on the Arduino Nano. Now let’s connect the SD card module. Pin MISO goes to digital pin 12 on Arduino nano. Pin MOSI goes to digital pin 11. Pin SCK goes to digital pin 13. And lastly, pin CS goes to digital pin 10. Now we are ready to connect power to the breadboard. I have connected this power bank to the breadboard and now are ready to log data.Now let’s go to the computer and see how to program this project. This is the code the project.

The Code of Arduino Data Logger Project

In order to better understand how it works watch the tutorials DS3231 real-time clock and the SD card module. Also, note that we are using Arduino IDE 1.6 .1 the latest version available today. This code won’t work on the Arduino IDE previous than the 1.6 so update your Arduino to the latest version if you want to use this code. We are using the rodan library for the real-time clock today. The first time that we upload the program to the Arduino we have to set time if it is now already set. So we have to uncomment this line here and enter the correct time and date. So the first argument, this argument here is the year, the month, the day of the month, the day of the week, fourth day, time in hours, minutes and seconds. We upload the program once, we run it on Arduino and it sets the time. Then we comment this line here and we upload it again. If we upload the program to Arduino and open the Serial Monitor we can see that the program produces a line of data every second. This line includes that ID of the entry, the date the time and the temperature. That line is then stored on the micro SD card. You can change the time that Arduino creates a new entry by changing this variable here. The interval which represents time in milliseconds so If we want Arduino to enter an entry in the file every minute we have to make the interval 60,000 like this. If we now upload the program to Arduino it will store an entry every minute. I run this program outside for 24 hours and I stored temperature every five minutes. So I had my interval set to 300000 milliseconds.

Before we place that datalogger outside in order to log data, let’s calculate how long it can last on batteries. The current draw now is around 30mA. So, with this power bank, it stays on for around three days. Most of the power is consumed by those two LEDs that are lit all the time. If we remove them, we can reduce the power consumption and log data for more days. This time I am going to log data for only one day. So this power bank is more than enough. Let’s do it. After 24 hours we have this file stored on the SD card. It contains almost 300 entries. Each value in every entry is separated by a comma so it is very easy to import this file into Excel and plot the data. Let’s see. We open a blank workbook in Excel and we click on the Data tab. Then we select “From Text” and from there we select the file that Arduino created. We open that file and we say that it is, of course, the delimited and it is delimited by commas as we saw before, and we press finish. Then we import all the data in the existing workbook and as you can see all the data are now in an Excel file. Very easy. Now, all we have to do is to plot the data. We select the two columns that we are interested in time and temperature by holding control down and we go to insert tab and we insert a chart. That’s it! As you can see this is an easy and low-cost project. We will add more sensor to it in the future and we will try to increase its battery life with various techniques So stay tuned!

——————–
CODE
——————–

 

 

 

——————–

SUBSCRIBE ON YOUTUBE

——————–

Never miss a video: Subscribe to educ8s.tv