Temperature Data logger

Hi I would like to construct a datalogger using Arduino

In my project, I need to monitor the temperature of water in a container. I need to place 4 thermocouples on the outside of the container and place 2 thermocouples inside the container filled with water (the thermocouples will be immersed in water/ice) and another to monitor the atmosphere/surrounding temperature. I will then place the container in the refrigerator and monitor the water’s behavior as it changes the temperature with respect to time.

I want to assemble this logger using Arduino components since they are inexpensive, using k-type thermocouples or others that are recommended. I am confused because the youtube videos I watch use components such as amplifiers. Or alternatively, I can use a Raspberry Pi

can I ask for assistance on which components to order for this?

Hi bongi,

Welcome to the Tech Forum!

The reason you are seeing amplifiers in those thermocouple circuits is that thermocouple signals are in the micro-volt range. An Arduino can’t resolve such small voltages directly. Measuring thermocouples are very tricky without the proper signal conditioning.

Fortunately, several manufacturers make IC’s designed to take care of the difficult parts of dealing with thermocouples. For instance, Maxim makes a nice chip called the MAX31856 which can handle many types of thermocouples and outputs a digital signal via SPI, which interfaces nicely with an Arduino.

Since you are planning to use several thermocouples, you will need several of these chips. However, with SPI, you can use the same Arduino MISO, MOSI, and clock lines to communicate with all of the MAX31856 chips and use one extra I/O pin for each “Chip Select” pin of the chip you wish to communicate with.

Adafruit makes a breakout board for the MAX31856 which allows one to prototype without having to spin a board, shown here:

image

Hi David.

I decided to get this amplifier

image

now i am struggling to code the Raspberry Pi to measure the temperature. Can you steer me in the right direction for this

Thank you for contacting us again. what is the part number you are using?

Looks like the 1597-1693-ND. It uses the Grove connection system and communicates via I2C. We’ll take a look.

Hi bongi,

One problem I see right away with this sensor board is that you are limited to no more than 2 addresses for this sensor (0x60 and 0x67), which means it will be very difficult to connect to more than two of these on the same bus. SPI gets around this problem by using a separate “Chip Select” pin for each device.

Grove_Piezo_Vibration_Sensor_Web.pdf (644.4 KB)
I was hoping to do this. Just using Thermocouples
I already purchased, the Raspberry Pi, Groove Hat Plus, 4 Amplifiers, and 4 Thermocouples.

Now I can’t even understand the code well to substitute the vibrations sensors for thermocouples.

My aim is to measure temperature over time.

Hi bongi,

These two devices are very different from each other. Your vibration sensor outputs a logic “High” when it detects vibration (simply holds voltage high on one pin), whereas the thermocouple board communicates via the I2C serial protocol (bi-directional string of high’s and low’s following a standard) – very different.

You would need to at least start with an example of I2C protocol for the RPi to have a chance. There is standard I2C instructional content out there, such as this, this, and this.

However, as I stated above, you will not be able to use more than two of these with your Pi without some very complicated maneuvers which are not suitable for anyone other than very advanced users. The reason for this is that with I2C, each end device (sensor, in this case) has to have a unique address in order for the host to communicate with a particular end device. The sensor board you have selected can be configured for one of two addresses, which allows two of them to be placed on the same bus. You cannot put more than two on any one bus.

The RPi’s default setup uses only one I2C bus. It looks like one can enable a second bus, giving you up to four sensors, but this is quite complex, and involves keeping track of which bus is enabled, as well as keeping track of four different sensors with only two addresses in your code.

@bongi,

If you need more than two sensors, I strongly recommend switching to a sensor which communicates via SPI, as there is no addressing required – only a “Chip Select” pin per sensor. Additionally, I’m not sure if the RPi is well suited to more than two chip selects due to their standard library provisions. @Robert_1552 might have some insight into that. Probably easier to implement on an Arduino.

Thank you, David, I now understand.
I will view the site you recommended for me.

You have assisted me a lot, thank you.

David, lastly, can you then recommend i buy an Arduino mega, and attach the I2C amplifiers together with their thermocouple onto the Raspberry Pi, via the usb port?

Is this possible though? to run Arduino software on the Raspberry Pi and obtain results from the Pi?

Hi bongi,

It is possible to connect an Arduino to a Raspberry Pi (RPi) via USB using USB serial port emulation on both devices.

Regarding connecting the I2C-based thermocouple amp modules, most Arduinos only have one I2C hardware serial port, which would only allow communicating with two of the modules (with one module set to the 0x60 address and the other to 0x67 address).

However, we sell a part called the 1597-103020293-ND using the TCA9548A 8-to-1 I2C Multiplexer chip, which allows one to communicate with multiple I2C devices having the same address using only a single I2C port on the host device. It even comes with Grove-style connectors which mate directly with the 597-1693-ND.

We also carry Grove Shields for both the Arduino Mega and smaller Uno boards.

Thank you, David, this is the best solution in my case.
However I had already ordered these parts, I should have disclosed this at the beginning of the conversation, I apologize.

1 X Grove Base Hat Plus for Raspberry - 103010002 ( 1597-1013-ND)

1 X Raspberry Pi 4,

2 X Grove - I2C High Accuracy Temp & Humidity - 101020592 (1597-1684-ND)

4 X I2C Thermocouple Amplifi - 101020594 (1597-1693-ND)

1 X Groove I2C HUB - 103020006 (1597-1324-ND)

Can’t the I2C be connected to the Grove board for Raspberry? I am trying to avoid ordering the Arduino and now again having to learn the language to code it.

Please advice.

Hi bongi,

Two issues:

  1. Regardless of which platform you use to communicate with the Thermocouple Amplifier Module, you will still need the 1597-103020293-ND I2C Multiplexor because you cannot communicate with more than two of those modules without it. The 103020006 (1597-1324-ND) gives you more I2C connectors, but not more I2C serial ports. All of the connectors provided still go to a single I2C port. Therefore, every I2C device attached to one of those connectors must have a different I2C address.

  2. You can use the RPi to communicate with the Thermocouple Amplifier Module via its I2C port, but they do not provide any example code for that platform, so you would be on your own. I recommended still using the Arduino because they do provide example code for that platform. If you feel comfortable going without example code, then you certainly can use the RPi. See below from their wiki page:

ow I see, i didn’t know that.

David, you have been a great help. Let me follow the advice you have given me up to so far.

Thank you