EC / Salinity device: automatic measurement, setup and calibration

Reading time: ~10 minutes ยท Execution time: ~30 minutes (hardware excluded) + 5 minutes of calibration ยท Audience: anyone who wants their tank's salinity measured continuously on the portal, without a refractometer at hand

๐Ÿ”ต Advanced guide โ€” not part of the 01-08 onboarding path. Tackle it only if you have already set up your tank and sensors (guide 04).


1. What you are about to do

In JoyReef, salinity is measured with a dedicated device: a small standalone board (type ec, name ec-XXXXXX) with its own ESP board, its own ADS1115 module and a conductivity (EC) probe designed for marine water. It's the twin of the pH device (guide 18): you flash it, connect it to WiFi, it appears on the portal as "EC / Salinity probe", you assign it to a tank โ€” and from that moment salinity is a live tank metric, with historical chart and dashboard widget.

How it works: the probe measures the water's electrical conductivity (EC, in mS/cm), which in marine water is directly related to salinity. The firmware compensates for temperature and converts the value to ppt (parts per thousand): the classic 35 ppt of ocean water. Everything on board: the portal receives the value ready to use.

In this guide:

โš ๏ธ The EC device and the pH device must never share a power supply. The EC probe injects a small electrical signal into the tank: if the EC device and the pH device share power or ground (same powered USB hub, same multi-port power supply), the pH reading gets disturbed. Use two separate USB power supplies, each in its own outlet. This is why EC and pH are two separate devices and not a single board.


2. What you need (hardware)

๐Ÿ’ก "Clean" build: if you want to mount everything in a 3D-printed box with a perfboard (like the original JoyReef devices), the perfboard and wiring diagrams are in the project repo. To get started, though, the modules and a few dupont wires are enough.


3. Assembly

The chain is: EC probe โ†’ DFR0300-H board โ†’ ADS1115 โ†’ ESP board. The DFR0300-H board has its own 3-wire cable (Gravity connector): signal, power and ground.

EC board โ†’ ADS1115 / board

Gravity wire (DFR0300-H) Goes to Notes
Blue (signal) A0 of the ADS1115 0-3.2 V analog signal
Red (VCC) 3V3 of the board everything at 3.3 V
Black (GND) GND of the board

ADS1115 โ†’ ESP board (I2C, 2 wires)

ADS1115 ESP board Notes
VDD 3V3 power
GND GND ground
SDA board's SDA pin I2C data
SCL board's SCL pin I2C clock

The I2C pins are the same as the pH device: SDA = GPIO0 (D3), SCL = GPIO2 (D4).

๐Ÿ”˜ Factory reset button (optional). It goes on D0 (GPIO16), wired to 3V3 โ€” not on GPIO2, which here is the ADS1115's I2C clock. Held for 8 seconds it erases WiFi and configuration.

EC device wiring diagram: D1 mini, ADS1115 via I2C and DFR0300-H board

๐Ÿ’ก The EC probe is sturdy (it's a cylinder with two electrodes, no delicate membranes like pH), but the board connector isn't: secure the DFR0300-H board well in the box and leave some slack on the probe cable.


4. Firmware flash + WiFi

The EC device is flashed and connected to WiFi exactly like the other JoyReef devices:

  1. Firmware flash: follow guide 16 choosing the EC probe firmware. (For later updates: OTA from the portal, guide 17.)
  2. WiFi connection: on first boot the device creates the joyreef-XXXXXX configuration network (captive portal). Same procedure as the controller, described in guide 03b.

After a few seconds the device appears on the portal in Config โ†’ Devices with the type "EC / Salinity probe" and the name ec-XXXXXX.


5. Configuration wizard (basics + calibration)

Open the newly appeared device in Config โ†’ Devices and click "Start configuration": a 2-step wizard begins.

Step 1 โ€” Basics

Give the device a meaningful name (e.g. "Tank salinity") and assign it to a tank. Assign it to the same tank as the controller measuring the temperature: it's needed for automatic compensation.

๐Ÿ’ก Automatic temperature compensation (ATC). Conductivity depends heavily on temperature (~1.85% per ยฐC). The EC device receives the tank temperature automatically from the portal and normalises the reading to 25 ยฐC โ€” you don't have to wire any temperature probe. If no temperature arrives for more than ~10 minutes, the device falls back to 25 ยฐC until the data returns.

Step 2 โ€” Calibration

The K=10 probe leaves the factory with a generic factor: for accurate readings it must be calibrated with the 12.88 mS/cm standard solution. The wizard guides you:

  1. Rinse the probe in RO water and pat it dry
  2. Immerse it in the 12.88 mS/cm standard solution and wait 1-2 minutes for it to stabilise
  3. Enter the solution conductivity (12.88 is pre-filled) and the solution temperature (required field โ€” measure the calibration liquid, not the tank: if the bottle is at room temperature, a 4-5 ยฐC difference means an 8-9% error)
  4. Press "Calibrate now": the factor is saved on the device
๐Ÿ“ท PLACEHOLDER-EC-WIZARD-CALIBRATION

๐Ÿ–ผ๏ธ Image to insert here (EC calibration wizard): screenshot of wizard step 2 with the "Solution conductivity (mS/cm)" and "Solution temperature (ยฐC)" fields and the "Calibrate now" button.

When the wizard finishes, the portal takes you straight to the Salinity page.

๐Ÿ’ก You can skip calibration and do it later (it's also on the Salinity page): the device still measures with the default factor, but absolute accuracy is not guaranteed. The "Restore factory calibration" button undoes a bad calibration at any time.

โš ๏ธ Recalibrate every 2-3 months, or whenever the value doesn't match your refractometer: electrodes get dirty (films, limescale) and the factor drifts. Clean the probe with RO water before recalibrating.


6. The Salinity page

You'll find it under Monitoring โ†’ Salinity (URL portal.joy-reef.com/sensors/salinity), or via the "Details โ†’" link on the dashboard widget. It shows:

๐Ÿ“ท PLACEHOLDER-SALINITY-PAGE

๐Ÿ–ผ๏ธ Image to insert here (Salinity page): screenshot of the Monitoring โ†’ Salinity page with the current value in ppt, Live badge, 28-42 scale with the 34-36 target zone highlighted and the EC Calibration section.

On the dashboard, salinity has its own widget: current value, last-24-hours chart and 24h average.

๐Ÿ’ก The journal benefits too: when you create a journal entry, the salinity field comes pre-filled with the EC device's reading ("Automatic detection") โ€” no more manual transcriptions from the refractometer.


7. If something goes wrong

Symptom Probable cause What to do
Salinity missing / "No EC device assigned" Device not assigned to the tank Config โ†’ Devices โ†’ open the device โ†’ Tank field
EC device offline WiFi/MQTT down Check power and WiFi (repeat the captive portal of guide 03b if you changed network)
ADS1115 not detected Wrong I2C pins or wiring Verify SDA/SCL (GPIO0/GPIO2) and VDD/GND
Obviously wrong readings (e.g. 20 or 50 ppt with a healthy tank) Missing/bad calibration Recalibrate (sec. 5) measuring the solution temperature; in extreme cases "Restore factory calibration" and recalibrate
"Jumpy" readings Air bubbles on the electrodes or probe near pumps Gently shake the probe to free the bubbles; move it to an area with moderate flow
The value doesn't match the refractometer Probe drift or uncalibrated refractometer Calibrate the refractometer with its solution, then recalibrate the EC device
Salinity "frozen" while temperature changes No temperature arriving โ†’ ATC on 25 ยฐC fallback Assign the EC device to the same tank as the controller with the temperature probe
pH went crazy since the EC device arrived Shared EC/pH power supply Two separate USB power supplies, never the same powered hub (sec. 1)

JoyReef guide ยท v1.0 ยท Questions? Write to supporto@joy-reef.com