The SOIL SENSOR 4IN1 RS485 THCPH-S is a versatile and high-precision soil sensor designed to measure four critical soil parameters: moisture, temperature, pH, and electrical conductivity (EC). It utilizes RS485 communication for robust and reliable data transmission, making it suitable for a wide range of agricultural, horticultural, and environmental monitoring applications.
The following table outlines the key technical details of the SOIL SENSOR 4IN1 RS485 THCPH-S:
Parameter | Specification |
---|---|
Manufacturer | SOIL SENSOR |
Part ID | THCPH-S |
Communication Protocol | RS485 |
Power Supply Voltage | 9V to 24V DC |
Power Consumption | ≤ 0.5W |
Measurement Parameters | Soil Moisture, Temperature, pH, EC |
Moisture Range | 0% to 100% |
Temperature Range | -40°C to 80°C |
pH Range | 3.0 to 9.0 |
EC Range | 0 to 20 mS/cm |
Accuracy | ±2% (Moisture), ±0.5°C (Temperature), ±0.1 (pH), ±2% (EC) |
Output Format | Modbus RTU |
Cable Length | 2 meters (extendable) |
Waterproof Rating | IP68 |
The sensor has a 4-wire interface for power and communication. The pin configuration is as follows:
Pin | Wire Color | Description |
---|---|---|
1 | Red | Power Supply (9V to 24V DC) |
2 | Black | Ground (GND) |
3 | Yellow | RS485-A (Data Line A) |
4 | Blue | RS485-B (Data Line B) |
Below is an example of how to interface the SOIL SENSOR 4IN1 RS485 THCPH-S with an Arduino UNO using an RS485 module:
#include <ModbusMaster.h>
// Instantiate ModbusMaster object
ModbusMaster node;
// RS485 communication pins
#define RE_DE_PIN 2 // Pin to control RS485 module (RE/DE)
// Function to control RS485 module direction
void preTransmission() {
digitalWrite(RE_DE_PIN, HIGH); // Enable transmission
}
void postTransmission() {
digitalWrite(RE_DE_PIN, LOW); // Enable reception
}
void setup() {
// Initialize serial communication
Serial.begin(9600);
Serial.println("SOIL SENSOR 4IN1 RS485 THCPH-S");
// Initialize RS485 control pin
pinMode(RE_DE_PIN, OUTPUT);
digitalWrite(RE_DE_PIN, LOW);
// Initialize Modbus communication
node.begin(1, Serial); // Sensor Modbus ID is 1
node.preTransmission(preTransmission);
node.postTransmission(postTransmission);
}
void loop() {
uint8_t result;
uint16_t data[4];
// Read 4 registers starting from address 0x0000
result = node.readInputRegisters(0x0000, 4);
if (result == node.ku8MBSuccess) {
// Store the data
data[0] = node.getResponseBuffer(0); // Moisture
data[1] = node.getResponseBuffer(1); // Temperature
data[2] = node.getResponseBuffer(2); // pH
data[3] = node.getResponseBuffer(3); // EC
// Print the data
Serial.print("Moisture: ");
Serial.print(data[0]);
Serial.println("%");
Serial.print("Temperature: ");
Serial.print(data[1] / 10.0); // Convert to °C
Serial.println("°C");
Serial.print("pH: ");
Serial.print(data[2] / 10.0); // Convert to pH
Serial.println();
Serial.print("EC: ");
Serial.print(data[3] / 100.0); // Convert to mS/cm
Serial.println(" mS/cm");
} else {
Serial.print("Error reading sensor: ");
Serial.println(result, HEX);
}
delay(2000); // Wait 2 seconds before next reading
}
No Data Received from the Sensor
Inaccurate Measurements
Communication Errors
Q: Can the sensor be used underwater?
A: Yes, the sensor is IP68-rated and can be submerged in water, but it is designed primarily for soil applications.
Q: How often should the sensor be calibrated?
A: Calibration frequency depends on usage, but it is recommended to calibrate the pH and EC measurements every 6 months for optimal accuracy.
Q: Can the sensor be used with other microcontrollers?
A: Yes, the sensor can be used with any microcontroller that supports RS485 communication and Modbus RTU protocol.