Call Phone +8618073152920 Hotline: +8618073152920
Call Phone +8618073152920
English
CONTACT US/ CONTACT US
Consumer hotline +8618073152920
Changsha Zoko Link Technology Co., Ltd.

Email:Arvin@niubol.com

WhatsApp:+8615367865107

Address:Room 102, District D, Houhu Industrial Park, Yuelu District, Changsha City, Hunan Province, China

Position:Home >> Blogs >> Product knowledge

Product knowledge

TDS Sensor for Raspberry Pi: Recover Valid Records After a Restart

Time:2026-08-14 09:00:00 Popularity:234

Quick Answer: An RS485 TDS sensor for Raspberry Pi needs a suitable serial interface, separate sensor power and software that distinguishes fresh readings from cached values. After a restart or cable interruption, restore the sensor identity, scaling and time basis before accepting new records. A recovered connection alone does not establish a valid measurement.

Start with a defined EC and TDS instrument

The NiuBoL NBL-WQ-EC conductivity sensor provides conductivity, temperature and supported calculated TDS through RS485 Modbus RTU. It is not a bare analog TDS board. A USB-to-RS485 adapter is one integration route; the receiving computer still needs a compatible driver and Modbus application.

The Raspberry Pi hardware documentation describes USB peripheral connections and GPIO interfaces. An RS485 A/B pair is not a direct GPIO connection. Keep the probe's specified supply separate from the computer's power input, and choose interface isolation and field protection for the installation.

Which readings should survive an application restart?

A monitoring application may retain the last displayed value even when the acquisition process has stopped. Store the last successful acquisition time separately from the screen refresh time. On restart, label any retained value as historical until a new response has passed the instrument and decoding checks.

This matters even more in a station containing the turbidity probe pictured below. Its last valid value is not the last valid EC value. Each channel needs its own acquisition status, timestamp and mapping; one responding instrument cannot make the whole station healthy.

Separate turbidity probe requiring its own acquisition status

Range and output limits for a TDS sensor for Raspberry Pi

NBL-WQ-EC itemProduct specificationSoftware or installation implication
EC ranges0-20.00 / 0-200.0 / 0-5000 uS/cm, or 0-200.0 mS/cmIdentify the ordered range and decimal position; do not apply one scale to every version
Conductivity accuracy+/-1% FSFull-scale accuracy is not +/-1% of every reading
Temperature / compensation+/-0.3 C; Pt1000 automatic temperature compensationRecord the reporting basis used for EC comparisons
TDSCalculated from conductivity where supported; configurable coefficient, default 0.64Keep the coefficient with configuration history; it is not laboratory identification of dissolved constituents
Supply / power12-24 VDC +/-10%; 0.2 W at 12 VSize the probe supply separately from the computer and interface
Output / serial defaultsRS485 Modbus RTU; 9600, N, 8, 1Match port settings and use the ordered register map
Operating limits0-50 C; pressure below 0.6 MPaCheck actual sample conditions, not just cabinet temperature
Protection / mounting / cableIP68; immersion or 3/4 NPT; standard 5 m cableThe probe rating does not cover the computer; confirm cable jacket and wetted materials

Choose the measurement range from expected water conditions before writing alarm logic. The product lists TDS ranges of 0-10, 0-100 and 0-3000 mg/L for the three lower EC configurations; TDS support for the high-conductivity version needs confirmation. A configurable coefficient does not make unsupported ranges valid.

The ammonia-nitrogen instrument below is another separate measurement channel. Its units, calibration and response interpretation differ from EC-derived TDS. Preserve that distinction when extending the same computer to a multi-probe station.

Separate ammonia-nitrogen probe, not an EC-derived TDS channel

Use a restart sequence that cannot silently change scaling

  1. Open the intended serial adapter using a stable device mapping. Confirm it is the same interface after unplugging or rebooting.
  2. Load the approved probe address, range, register definition and coefficient record. Keep commissioning writes separate from ordinary read polling.
  3. Read a complete measurement block and validate the response before decoding values. Do not substitute zero for a timeout or an incomplete response.
  4. Apply the returned decimal positions according to the ordered protocol. Check conductivity, temperature and supported TDS against a known stable test condition.
  5. Resume publication with a new acquisition timestamp and quality state. Upload buffered older records with their original timestamps, not as new samples.

The documented measurement block starts at 0x0000 and contains six 16-bit registers: EC value and decimal position, temperature value and decimal position, then TDS value and decimal position. Use the ordered protocol for signed temperature handling and other decoding details. A successful function-03 response with the wrong interpretation can still produce plausible but incorrect numbers.

For an optical dissolved-oxygen channel, restarting the host similarly does not prove that the probe has a representative, stable sample. Keep acquisition readiness separate from physical measurement readiness. Record cleaning, calibration or removal from the water as service events rather than apparent process changes.

Optical dissolved oxygen probe with channel-specific measurement checks

Test the faults that happen after commissioning

Run four controlled checks: restart the application, restart the computer, disconnect the serial adapter, and interrupt sensor power. Perform them in a safe test setup. For each, verify that the interface recovers to the correct probe, missing data stay visibly missing, and the first accepted value has a valid timestamp and scale.

Then interrupt only the network. Local acquisition and remote upload are separate functions; whether records survive depends on the application's storage design, not the RS485 label. Check that reconnection does not duplicate buffered samples or overwrite historical times. If alarms operate equipment, test communication-failure behavior independently of water-quality thresholds.

A COD probe, such as the separate instrument shown below, needs its own acceptance checks. Reusing the EC decoder for an optical channel can produce wrong units even when the same serial bus is electrically functional.

Optical COD probe requiring its own register interpretation

Project Decision FAQ

Q1. Can this TDS sensor connect directly to Raspberry Pi pins?

The NBL-WQ-EC provides RS485, not a GPIO-level signal. Use a suitable RS485 interface and the specified external sensor supply. Verify the exact wiring before applying power.

Q2. Should the application write all settings every time it boots?

Routine acquisition should not depend on uncontrolled configuration writes. Keep approved address, scaling and coefficient settings traceable; perform intentional changes through a separate commissioning procedure and verify the result.

Q3. Why does the old TDS value remain after disconnecting the probe?

The display may be showing a cached last value. Show its acquisition time and mark it stale. A new display refresh is not a new sensor measurement, and a timeout must not be recorded as zero TDS.

Q4. Can one probe's response prove that every station channel is working?

No. Track each instrument separately. An EC response does not verify a turbidity, ammonia, dissolved-oxygen or COD probe, even when all devices share the same host.

Q5. Is calculated TDS suitable for identifying a specific contaminant?

No. Conductivity-derived TDS estimates dissolved-solids concentration using a coefficient. It cannot identify individual chemicals, and similar conductivity values can occur with different dissolved compositions.

Q6. What should an integration enquiry contain?

Send the expected EC/TDS range, liquid conditions, interface type, required record interval, restart tests and local-storage requirement. Ask NiuBoL to confirm the probe configuration and protocol; computer software, remote services and enclosure provision must be defined separately.

NBL-WQ-EC conductivity probe with supported calculated TDS output

Summary

A TDS sensor for Raspberry Pi becomes useful for unattended monitoring when recovery is as trustworthy as the first successful reading. Choose the right NBL-WQ-EC range, keep configuration changes controlled, and test freshness, timestamps and missing-data handling through realistic interruptions before relying on the records.

Related recommendations

Sensors & Weather Stations Catalog

Agriculture Sensors and Weather Stations Catalog-NiuBoL.pdf

Weather Stations Catalog-NiuBoL.pdf

Agriculture Sensors Catalog-NiuBoL.pdf

Water Quality Sensor Catalog-NiuBoL.pdf

Related products

Tell us your requirements, Let's discuss more about your project.we can do more.

Name*

Tel*

Email*

Company*

Country*

Message


online
Contacts
Email
Top
XTDS Sensor for Raspberry Pi: Recover Valid Records After a Restart-Product knowledge-Automatic Weather Stations_Industrial, Agricultural, Water & Environmental IoT Monitoring Solutions—NiuBoL

Screenshot, WhatsApp to identify the QR code

WhatsApp number:+8615367865107

(Click on WhatsApp to copy and add friends)

Open WhatsApp

The WhatsApp ID has been copied, please open WhatsApp to add consultation details!
WhatsApp