Measuring Salt Content with Arduino

Hello, I want to build a simple Arduino circuit to measure the salt content in water.

This is my idea: I hold one cathode and one anode with a defined distance into the water and measure the resistance with this circuit (the unknown resistor is the water):

Also I connect a temperature sensor to the arduino and hold it into the water.

My Question: Is it possible to calculate the salt content with resistance and temperature? And if yes, how could I calculate it?

Won't work like that - you need to use AC, 1 kHz - 1 MHz, best is 3-300 kHz. Otherwise you will get electrolyses. If you do it your way you will see the resistance increase very fast over the first 0.5-1 seconds, after which it stabilises. That's because the salt ions migrate.

See this project of mine, schematic in the code: https://github.com/wvmarle/Arduino_ECSensor

A few resistors and a capacitor for measurement. This works for an EC of 0.01-5 mS/cm, above that it becomes unreliable. That's a NaCl content of up to about 2,500 ppm. (NaCl 500 ppm in water is almost exactly 1 mS/cm at 25°C). I'm using this for measuring nutrient levels in hydroponics.

Temperature correction is needed - about 2% per °C.

I have built different circuits that can do 0.01-100 mS/cm, that includes sea water.

Use stainless steel or carbon electrodes. Measure for a brief period only to prevent electrolysis, even so polarization is likely to happen, which is why AC measurements are preferred. You can only measure conductivity, and only if the water is electrically isolated from your circuit (other than via the two electrodes).

Conductivity is a function of dissolved ions and of temperature, so you’ll need to correct for temperature perhaps?

If using AC you can actually use two capacitors to isolate your probe (one for each wire, probe in between the capacitors).