
The EC sensor is used to measure Salinity in the reef tank. keeping the salinity stable is probably the most important value to monitor. The sensor generally has a small PCB which is mounted in the sensor module and a probe for the tank water.
The EC sensor is a analog sensor and can only be conected to one of the ports on the sensor module.
​
Here is how to set one up...
EC Sensor
Analog sensor
An EC (Electrical Conductivity) sensor measures the salinity of reef aquarium water by detecting how well it conducts electricity. It has two or more electrodes that pass a small electrical current through the water. The amount of current flow varies with the concentration of dissolved salts, allowing the sensor to calculate conductivity, which is then converted to salinity. Maintaining stable salinity is crucial for coral and marine life health in reef tanks.
Hardware conection
How its conected
The EC sensor needs to be connected to one of the analog ports in the sensor module, each port can supply either 5v or 3,3v to power the sensor. For the signal there is a 3 port teminal, the center port is Ground then either side are the Signal pins. Signal can either be sent directly (DIR) to the ESP32 or via a voltage divider (DIV). The ESP32 can only read analog volages up to 3v so if you have a sensor that outputs more then you will need to use the divider.
​
You may 3d print a custom cradle to mount the sensor into the port spot and the removeable piece of the case can be drilled to allow the cable to pass through.
​
Here is an example of how to use the divider:
5v analog output form sensor reduced to 3v for the esp32. R1 = ?Ohm R2=?Ohm
Software setup
Checking the Code
Analog sensors require a little more setup on the Software side, you will have to enter a few details and do some calibrations to get it working corectly.
Setup the code:
​
​
Calibrateion:
Links
Here are a few links to where you can purchase your sensors, click the link depending on your location.
​
Worldwide link generally takes longer to be delivered but is a little cheaper. Better if you want to bulk order.
Full disclosure: some of these links are affiliate links, clicking them and purchasing though my links helps me support the project.
Worldwide
Worldwide Link
USA
USA Link
UK
UK Link
Europe
Europe Link