Home > Tech Article Categories > Temperature Measurement > Temperature Logging with R3aktor M0 Core
The onboard SD card, LiPo battery support, and QWIIC connector make the R3aktor M0 Logger ideal for quick and portable data acquisition projects. In this example a SEN-30011 shield is used to monitor the temperature of four thermocouples and then log their values to a SD card.
This example represents a 'from scratch' solution, where you have complete control of the software running on the R3aktor. For a more complete solution, check out R3aktor Core and Control Center. R3aktor Core combines a temperature measurement shield and a M0 Logger into a single product and includes free firmware and PC software!
For this project, you will need:
Connect the 4 thermocouples to the SEN-30011 breakout board. Connect the SEN-30011 to the R3aktor board with the qwiic connector cable. Your setup should look like the image below.
Connect the R3aktor board to your computer with the USB-C cable.
Open the Arduino IDE. For this project, you will need to install the PWFusion MCP906X library. Open the library manager by selecting the library icon on the left or by selecting Tools -> Manage Libraries…
In the library manager panel, type pwfusion in the search box and locate the MCP906X library. Select install and wait for the installation process to complete.
You will also need to install the Arduino SD card interface library. Repeat the above process but instead, type sd in the search box, set the type filter to Arduino, and then locate and install the library called SD by Arduino, SparkFun.
Wait for the installation process to complete.
Copy and paste this code into a new Arduino IDE sketch:
Before uploading the code, insert the micro-SD card into the R3aktor board’s micro-SD card slot.
Make sure to select the correct board and COM port number and select upload.
Open the serial monitor by selecting the serial monitor icon in the upper right corner or by selecting Tools -> Serial Monitor
You will see a string of numbers separated by commas. This is exactly how the data from the thermocouples is being recorded in the .csv file.
Wait 1000 seconds for the logging to complete.
A message will appear in the serial monitor when the logging process is complete.
When this happens, remove the micro-SD card form the R3aktor board and insert it into your computer. Navigate to the micro-SD card folder location and open the file named temp.csv in a spreadsheet application like Microsoft Excel.
As you can see, the output is almost identical to the output in the serial monitor of the Arduino IDE.
There are many applications for logging data in a .csv format, such as making the utilization of the data much easier. Below is a graph of the data for visualization purposes.