About: Founded in 2005, Atlas Scientific specializes in building laboratory grade sensing equipment for robots, appliances, and industrial control systems. Thousands of Atlas Scientific sensors can be found in a wi...

In this project, we will be automatically temperature compensating the salinity sensor from Atlas Scientific. Temperature changes have an impact on the conductivity/total dissolved solids/salinity of fluids and by compensating for it, we are ensuring that our reading is what it actually is at that specific temperature. Atlas's temperature sensor is used.

The temperature readings are passed to the salinity sensor after which the compensated salinity readings are outputted. Operation is via I2C protocol and readings are displayed on the Arduino serial plotter or monitor.


  • The temperature is automatically accounted for, enabling accurate conductivity readings.
  • Real-time conductivity and temperature output
  • Can be expanded to include more EZO sensors such as the pH and dissolved oxygen
  • Minimum programming required unless you plan on modifying the project



a) Calibrate the sensors: Each sensor has a unique calibration process. Refer to the following: salinity calibration, temperature calibration. If you are using other sensors refer to their respective datasheet which can be found on the Atlas Scientific website.

b) Set sensors' protocol to I2C and assign a unique I2C address to each sensor. In accordance with the sample code for this project, the following addresses are used: salinity sensor address is 100 and temperature sensor address is 102. For information on how to change between protocols, refer to this LINK.

The calibration and the switch to I2C MUST be done before implementing the sensors into this project.


Connect the hardware as shown in the schematic.

You can use either an Arduino UNO or a STEMTera board. The STEMTera board was used in this project for its compact design where the Arduino is combined with the breadboard.



The code for this project makes use of a customized library and header file for the EZO circuits in I2C mode. You will have to add them to your Arduino IDE in order to use the code. The steps below include the process of making this addition to the IDE.

a) Download Ezo_I2c_lib, a zip folder from GitHub onto your computer.

b) On your computer, open the Arduino IDE (You can download the IDE from HERE if you do not have it). If you would like to use the serial plotter be sure to download the most recent version of the IDE.

c) In the IDE, go to Sketch -> Include Library -> Add .ZIP LIbrary -> Select the Ezo_I2c_lib folder you just downloaded. The appropriate files are now included.

There are two sample codes which will work for this project. You can choose either.

d) Copy the code from temp_comp_example or temp_comp_rt_example onto your IDE work panel. You can also access them from the Ezo_I2c_lib zip folder downloaded above.

The "temp_comp_example" code works by setting the temperature in the EC sensor and then take a reading. As for the "temp_comp_rt_example" code, the temperature is set and a reading is taken in one shot. Both will give the same result.

e) Compile and upload temp_comp_example or temp_comp_rt_example to your Arduino Uno or STEMTera board.

f) In your IDE, go to Tools -> Serial Plotter or press Ctrl+Shift+L on your keyboard. The plotter window will open. Set the baud rate to 9600. The real-time graphing should now begin.

h) To use the serial monitor, go to Tools -> Serial Monitor or press Ctrl+Shift+M on your keyboard. The monitor will open. Set the baud rate to 9600 and select "Carriage return". The EC and temperature readings should display.


Summary of the experiment shown in the video:

Part 1: No temperature compensation

Initially, the water is at a temperature of about 30°C. It is then heated to about 65°C while the conductivity (green graph) and temperature (red graph) readings are observed on the serial plotter. (For Arduino sample code that permits the reading of multiple circuits without automatic temperature compensation refer to this LINK).

Part 2: Temperature compensation

The Arduino code that accounts for automatic temperature compensation is uploaded to the board. See this LINK for the code. Once more, the starting point of the water is around 30°C. It is gradually raised to about 65°C while the conductivity (green graph) and temperature (red graph) readings are observed on the serial plotter.

Be the First to Share


    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020
    • Maps Challenge

      Maps Challenge