Grove - TDS Sensor
It supports 3.3 / 5V input voltage and 0 ~ 2.3V Output Voltage making it easy to be compatible with all Arduino Boards. The sensor also provides a waterproof probe, making the testing process much easier to handle.
Feature
- Analog Signal, easy to implement
- Support 3.3 / 5V Input Voltage
- Good Arduino Compatibility, where 0 ~ 2.3V Output Voltage can be easily implemented in 3.3 / 5V control system
- Waterproof TDS Probe
Specification
Parameter | Value |
---|---|
Input voltage | 3.3V / 5V |
Output Voltage | 0 ~ 2.3V |
Working Current | 3 ~ 6 mA |
TDS Measurement Range | 0 ~ 1000ppm |
Connection Interface | Grove 4-Pin / XHB 2.54mm 2P |
Interface | Analog |
Cable Length | 60cm |
Connection Interface | XHB 2.54mm 2P |
Hardware Overview
Platforms Supported
Arduino | Raspberry Pi |
---|---|
Getting Started
Play With Arduino
Materials required
Seeeduino V4.2 | Base Shield | Grove - TDS Sensor |
---|---|---|
Get ONE Now | Get ONE Now | Get ONE Now |
In addition, you can consider our new Seeeduino Lotus M0+, which is equivalent to the combination of Seeeduino V4.2 and Baseshield.
Hardware Connection
Step 1. Plug Grove - TDS Sensor to A0 port of Grove - Base Shield.
Step 2. Plug Grove - Base Shield into Seeeduino.
Step 3. Connect Seeeduino to a PC via a USB cable.
If this is the first time you work with Arduino, we strongly recommend you to see [Getting Started with Arduino](https://wiki.seeedstudio.com/Getting_Started_with_Arduino/) before the start.
- Step 1. Open the Arduino IDE and create a new file, then copy the following code into the new file.
#define SERIAL Serial
#define sensorPin A0
int sensorValue = 0;
float tdsValue = 0;
float Voltage = 0;
void setup() {
SERIAL.begin(9600);
}
void loop() {
sensorValue = analogRead(sensorPin);
Voltage = sensorValue*5/1024.0; //Convert analog reading to Voltage
tdsValue=(133.42/Voltage*Voltage*Voltage - 255.86*Voltage*Voltage + 857.39*Voltage)*0.5; //Convert voltage value to TDS value
SERIAL.print("TDS Value = ");
SERIAL.print(tdsValue);
SERIAL.println(" ppm");
delay(1000);
}
Step 3. Upload the demo. If you do not know how to upload the code, please check How to upload code.
Step 4. Open the Serial Monitor of Arduino IDE by click Tool-> Serial Monitor. Or tap the ++ctrl+shift+m++ key at the same time. Set the baud rate to 9600.
Step 5. The result should be like this when the probe is in water:
Play With Raspberry Pi
Materials required
Raspberry Pi | Grove Base Hat for RasPi | Grove - TDS Sensor |
---|---|---|
Get ONE Now | Get ONE Now | Get ONE Now |
Step 2. Plug the Grove Base Hat into Raspberry Pi.
Step 3. Connect the Grove - TDS sensor to port A0 of the Base Hat.
Software
Step 1. Follow Setting Software to configure the development environment.
Step 2. Download the source file by cloning the grove python library.
cd ~
git clone https://github.com/Seeed-Studio/grove.py
- Step 3. Execute below commands to create the python code.
cd grove.py/grove/
nano TDS.py
- Step 4. Copy the following code into the file:
import math
import sys
import time
from grove.adc import ADC
class GroveTDS:
def __init__(self, channel):
self.channel = channel
self.adc = ADC()
@property
def TDS(self):
value = self.adc.read(self.channel)
if value != 0:
voltage = value*5/1024.0
tdsValue = (133.42/voltage*voltage*voltage-255.86*voltage*voltage+857.39*voltage)*0.5
return tdsValue
else:
return 0
Grove = GroveTDS
def main():
if len(sys.argv) < 2:
print('Usage: {} adc_channel'.format(sys.argv[0]))
sys.exit(1)
sensor = GroveTDS(int(sys.argv[1]))
print('Detecting TDS...')
while True:
print('TDS Value: {0}'.format(sensor.TDS))
time.sleep(1)
if __name__ == '__main__':
main()
Step 5. Use Ctrl+O to save and Ctrl+X to quit.
Step 6. Run the following to execute:
python TDS.py 0
!!!Success If everything goes well, you will be able to see the following result:
pi@raspberrypi:~/grove.py/grove$ python TDS.py 0
Detecting TDS...
TDS Value: 0
TDS Value: 0
TDS Value: 0
TDS Value: 0
TDS Value: 2.41591963768
TDS Value: 28.5884239197
TDS Value: 33.2677587509
TDS Value: 30.9311414242
TDS Value: 30.9311414242
FAQ
Q1# Limitations of Grove - TDS Sensor/Meter For Water Quality (Total Dissolved Solids)?
A1: Limitations are as followed:
- The Waterproof TDS probe cannot be used in water above 70°C.
- The sensor cannot be used to measure flowing water.
- The sensor cannot be used to measure water with high pollution concentration.
- The Grove sensor itself is not waterproof.
Schematic Online Viewer
Resources
- [ZIP] Grove - TDS Sensor/Meter For Water Quality (Total Dissolved Solids) Schematic file
- [PDF] LMV324 Datasheet
- [PDF] CD4060BM Datasheet
Tech Support
Please submit any technical issue into our forum.
Upgradable to Industrial Sensors
With the SenseCAP S2110 controller and S2100 data logger, you can easily turn the Grove into a LoRaWAN® sensor. Seeed not only helps you with prototyping but also offers you the possibility to expand your project with the SenseCAP series of robust industrial sensors.
The IP66 housing, Bluetooth configuration, compatibility with the global LoRaWAN® network, built-in 19 Ah battery, and powerful support from APP make the SenseCAP S210x the best choice for industrial applications. The series includes sensors for soil moisture, air temperature and humidity, light intensity, CO2, EC, and an 8-in-1 weather station. Try the latest SenseCAP S210x for your next successful industrial project.