
Soil NPKPHCTH Sensor IP68 (7 in 1) RS485 Modbus NPK Sensor for Agricultural (English Manual)
In stock

Order before 12.00PM
Customer Reviews
The Soil NPK Sensor is a portable, high-precision, and low-cost solution for real-time soil fertility monitoring. Designed to measure key nutrients—Nitrogen (N), Phosphorus (P), and Potassium (K)—as well as temperature, humidity, conductivity, and pH, this sensor allows farmers, agronomists, and researchers to quickly assess soil nutrient levels. Supplied by BDTronics, it supports Modbus RS485 communication and can be integrated with Arduino or other microcontrollers for automated data acquisition.
Unlike spectral analysis methods, which may only achieve 60–70% accuracy, this sensor provides fast, highly accurate measurements with minimal preparation. Simply insert the stainless steel probe into the soil, connect to your Arduino, and get reliable readings instantly.
(This sensor comes with English manual and sample code)
Features:
-
Measures key soil fertility parameters: N, P, K, temperature, humidity, pH, and conductivity
- IP68 Waterproof sensor
-
Portable and compact design for easy field use and transport
-
Fast response time: less than 1 second for nutrient readings
-
High-accuracy measurements suitable for professional agricultural analysis
-
Durable stainless steel probe for long-term soil use
-
Minimal interference from soil-less or non-uniform areas
-
Supports RS485, 4–20mA, 0–5V, and 0–10V output options
-
Easy to integrate with Arduino, microcontrollers, or data acquisition systems
-
IP68 rated for long-term water immersion
-
Low power consumption, 0.5W at 24V DC
-
Comes with English manual and setup guide for easy operation
Specifications:
Brand: ComWinTop (CWT)
Protection: IP68 Waterproof
Temperature:
-
Measuring Range: -40℃ to 80℃
-
Accuracy: ±5℃ (at 25℃)
-
Long-term Stability: ≤0.1%℃/year
-
Response Time: ≤15s
Humidity:
-
Measuring Range: 0–100% RH
-
Accuracy: 2% (0–50%), 3% (50–100%)
-
Long-term Stability: ≤1% RH/year
-
Response Time: ≤4s
Conductivity (EC):
-
Measuring Range: 0–20000 μS/cm
-
Accuracy: ±3% (0–10000 μS/cm), ±5% (10000–20000 μS/cm)
-
Long-term Stability: ≤1 μS/cm/year
-
Response Time: ≤1s
pH:
-
Measuring Range: 3–9 pH
-
Accuracy: ±0.3 pH
-
Long-term Stability: ≤5%/year
-
Response Time: ≤10s
Nitrogen / Phosphorus / Potassium:
-
Measuring Range: 1–1999 mg/kg (mg/L)
-
Resolution: 1 mg/kg (mg/L)
-
Response Time: <1s
Basic Parameters:
-
Power Supply: DC 4.5–30V
-
Max Power Consumption: 0.5W @ 24V DC
-
Protection Class: IP68 (long-term water immersion)
-
Cable Length: Default 2m (customizable)
-
Operating Environment: -40℃ to 80℃
-
Dimensions: 45 × 15 × 123 mm
-
Output: RS485 / 4–20mA / 0–5V / 0–10V
Functions and Features:
-
Compact design ensures easy installation, operation, and maintenance
-
Stainless steel probe ensures long-term durability and reliability
-
Can be used in various soil conditions, including challenging areas
-
High measurement accuracy and reliable performance
-
Fast response and efficient data transmission for real-time monitoring
Applications:
-
Agricultural soil fertility analysis
-
Smart farming and precision agriculture
-
Fertilizer requirement assessment
-
Research and experimental soil studies
-
Integration with Arduino or automated data logging systems
-
Soil nutrient monitoring for plantations, gardens, and farms
soil npk sensor, npk sensor arduino, rs485 soil sensor, portable soil fertility sensor, nitrogen phosphorus potassium sensor, high precision soil sensor, soil ph conductivity sensor, agricultural soil monitor bangladesh, bdtronics npk sensor, portable npk measurement device, modbus rs485 soil sensor, field soil analysis sensor, arduino soil monitoring module, quick response npk sensor, durable soil probe sensor, smart farming sensor, real-time soil fertility detector
The 5-in-1 NPK Soil Sensor is a comprehensive agricultural monitoring device that measures seven critical soil parameters: Nitrogen (N), Phosphorus (P), Potassium (K), soil moisture, temperature, pH, and electrical conductivity (EC). This tutorial will guide you through interfacing this RS485-based sensor with an Arduino UNO to create a complete soil monitoring system.
This sensor is particularly useful for precision agriculture, greenhouse management, and smart farming applications. By the end of this tutorial, you'll be able to read all sensor values and display them on the Serial Monitor.
Components Required
Hardware
- Arduino UNO
- CWT 5-in-1 NPK Soil Sensor (RS485)
- MAX485 TTL to RS485 Converter Module
- Breadboard
- Jumper wires
- 5V Power supply (or use Arduino's 5V output)
Software
- Arduino IDE (version 1.8.0 or higher)
- ModbusMaster library (install via Library Manager)
Understanding the Sensor
Measured Parameters
| Parameter | Range | Accuracy | Response Time |
|---|---|---|---|
| Temperature | -40°C to 80°C | ±0.5°C | ≤15s |
| Humidity | 0-100% RH | 3-5% | ≤4s |
| Conductivity (EC) | 0-20000 μS/cm | ±3-5% | ≤1s |
| pH | 3-9 | ±0.3 | ≤10s |
| Nitrogen (N) | 1-2999 mg/kg | 1 mg/kg | <1s |
| Phosphorus (P) | 1-2999 mg/kg | 1 mg/kg | <1s |
| Potassium (K) | 1-2999 mg/kg | 1 mg/kg | <1s |
Communication Protocol
- Interface: RS485 (Modbus RTU)
- Default Address: 1
- Baud Rate: 4800 bps
- Data Format: 8N1 (8 data bits, no parity, 1 stop bit)
Register Map
- 0x0000: Humidity (0.1% RH resolution)
- 0x0001: Temperature (0.1°C resolution)
- 0x0002: Conductivity (1 μS/cm)
- 0x0003: pH (0.1 resolution)
- 0x0004: Nitrogen (1 mg/kg)
- 0x0005: Phosphorus (1 mg/kg)
- 0x0006: Potassium (1 mg/kg)
Circuit Diagram
Wiring Connections Sensor to MAX485 Module:
Sensor Wire Color → MAX485 Module
Brown (Power +) → Not connected to MAX485
Black (Power -) → Not connected to MAX485
Yellow/Green (A+) → A+
Blue (B-) → B-
MAX485 Module to Arduino UNO:
MAX485 Pin → Arduino Pin
VCC → 5V
GND → GND
DI → Pin 2 (TX)
RO → Pin 3 (RX)
DE → Pin 4
RE → Pin 4
A+ → Sensor Yellow/Green wire
B- → Sensor Blue wire
Sensor Power:
Sensor Wire → Connection
Brown (+) → 5V (from Arduino or external supply)
Black (-) → GND
Arduino Code
Install Required Library
- Open Arduino IDE
- Go to Sketch → Include Library → Manage Libraries
- Search for "ModbusMaster"
- Install the library by Doc Walker
Complete Arduino Sketch
/*
* 5-in-1 NPK Soil Sensor with Arduino UNO
*
* This sketch reads soil parameters from a CWT NPK sensor via RS485/Modbus
* Measured parameters: Temperature, Humidity, Conductivity, pH, N, P, K
*
* Hardware Connections:
* - MAX485 DE/RE to Arduino Pin 4
* - MAX485 DI to Arduino Pin 2
* - MAX485 RO to Arduino Pin 3
* - Sensor A+ to MAX485 A+
* - Sensor B- to MAX485 B-
* - Sensor power: Brown(+5V), Black(GND)
*/
#include <SoftwareSerial.h>
#include <ModbusMaster.h>
// Pin definitions
#define MAX485_DE 4 // Driver Enable pin
#define MAX485_RE_NEG 4 // Receiver Enable pin (active low, connected to DE)
#define RX_PIN 3 // Software Serial RX
#define TX_PIN 2 // Software Serial TX
// Sensor Modbus address and register definitions
#define SENSOR_ADDRESS 1 // Default sensor address
// Register addresses (from manual)
#define REG_HUMIDITY 0x0000 // Soil moisture (0.1% RH)
#define REG_TEMPERATURE 0x0001 // Soil temperature (0.1°C)
#define REG_CONDUCTIVITY 0x0002 // EC value (μS/cm)
#define REG_PH 0x0003 // pH value (0.1)
#define REG_NITROGEN 0x0004 // Nitrogen content (mg/kg)
#define REG_PHOSPHORUS 0x0005 // Phosphorus content (mg/kg)
#define REG_POTASSIUM 0x0006 // Potassium content (mg/kg)
// Create software serial port for RS485 communication
SoftwareSerial modbusSerial(RX_PIN, TX_PIN);
// Create ModbusMaster object
ModbusMaster node;
// Variables to store sensor readings
float soilMoisture = 0.0;
float soilTemperature = 0.0;
uint16_t soilConductivity = 0;
float soilPH = 0.0;
uint16_t nitrogen = 0;
uint16_t phosphorus = 0;
uint16_t potassium = 0;
/**
* Modbus pre-transmission callback
* Sets MAX485 to transmit mode
*/
void preTransmission() {
digitalWrite(MAX485_RE_NEG, HIGH); // Enable transmit mode
digitalWrite(MAX485_DE, HIGH);
}
/**
* Modbus post-transmission callback
* Sets MAX485 to receive mode
*/
void postTransmission() {
digitalWrite(MAX485_RE_NEG, LOW); // Enable receive mode
digitalWrite(MAX485_DE, LOW);
}
void setup() {
// Initialize Serial Monitor for debugging
Serial.begin(9600);
Serial.println("=== 5-in-1 NPK Soil Sensor ===");
Serial.println("Initializing...");
// Initialize DE/RE control pins
pinMode(MAX485_RE_NEG, OUTPUT);
pinMode(MAX485_DE, OUTPUT);
// Set MAX485 to receive mode initially
digitalWrite(MAX485_RE_NEG, LOW);
digitalWrite(MAX485_DE, LOW);
// Initialize software serial for Modbus communication
// Sensor default: 4800 baud, 8N1
modbusSerial.begin(4800);
// Initialize Modbus communication
node.begin(SENSOR_ADDRESS, modbusSerial);
// Set Modbus callbacks
node.preTransmission(preTransmission);
node.postTransmission(postTransmission);
Serial.println("Initialization complete!");
Serial.println("Starting measurements...\n");
delay(1000);
}
void loop() {
// Read all sensor values
bool success = readSensorData();
if (success) {
// Display readings on Serial Monitor
displaySensorData();
} else {
Serial.println("ERROR: Failed to read sensor data!");
Serial.println("Check wiring and connections.\n");
}
// Wait 5 seconds before next reading
delay(5000);
}
/**
* Read all sensor data via Modbus
* Returns true if successful, false otherwise
*/
bool readSensorData() {
uint8_t result;
// Read 7 holding registers starting from address 0x0000
// This reads: Humidity, Temperature, Conductivity, pH, N, P, K
result = node.readHoldingRegisters(REG_HUMIDITY, 7);
if (result == node.ku8MBSuccess) {
// Extract values from response buffer
// Values are stored in 16-bit registers
// Humidity (0.1% RH resolution, so divide by 10)
soilMoisture = node.getResponseBuffer(0) / 10.0;
// Temperature (0.1°C resolution, so divide by 10)
soilTemperature = node.getResponseBuffer(1) / 10.0;
// Conductivity (μS/cm, direct value)
soilConductivity = node.getResponseBuffer(2);
// pH (0.1 resolution, so divide by 10)
soilPH = node.getResponseBuffer(3) / 10.0;
// Nitrogen (mg/kg, direct value)
nitrogen = node.getResponseBuffer(4);
// Phosphorus (mg/kg, direct value)
phosphorus = node.getResponseBuffer(5);
// Potassium (mg/kg, direct value)
potassium = node.getResponseBuffer(6);
return true;
} else {
// Communication error occurred
return false;
}
}
/**
* Display sensor data on Serial Monitor
* Formatted for easy reading
*/
void displaySensorData() {
Serial.println("╔════════════════════════════════════╗");
Serial.println("║ SOIL SENSOR READINGS ║");
Serial.println("╠════════════════════════════════════╣");
// Soil moisture
Serial.print("║ Moisture: ");
Serial.print(soilMoisture, 1);
Serial.println(" % ║");
// Soil temperature
Serial.print("║ Temperature: ");
Serial.print(soilTemperature, 1);
Serial.println(" °C ║");
// Electrical conductivity
Serial.print("║ EC: ");
Serial.print(soilConductivity);
Serial.println(" μS/cm ║");
// pH level
Serial.print("║ pH: ");
Serial.print(soilPH, 1);
Serial.println(" ║");
Serial.println("╠════════════════════════════════════╣");
Serial.println("║ NPK CONTENT (mg/kg) ║");
Serial.println("╠════════════════════════════════════╣");
// Nitrogen
Serial.print("║ Nitrogen (N): ");
Serial.print(nitrogen);
Serial.println(" mg/kg ║");
// Phosphorus
Serial.print("║ Phosphorus(P):");
Serial.print(phosphorus);
Serial.println(" mg/kg ║");
// Potassium
Serial.print("║ Potassium (K):");
Serial.print(potassium);
Serial.println(" mg/kg ║");
Serial.println("╚════════════════════════════════════╝");
Serial.println();
}
Testing and Calibration
Initial Testing
- Upload the code to Arduino UNO
- Open Serial Monitor (Tools → Serial Monitor)
- Set baud rate to 9600
- Insert sensor probe into soil
- Observe readings every 5 seconds
Expected Output
=== 5-in-1 NPK Soil Sensor ===
Initializing...
Initialization complete!
Starting measurements...
╔════════════════════════════════════╗
║ SOIL SENSOR READINGS ║
╠════════════════════════════════════╣
║ Moisture: 46.4 % ║
║ Temperature: 33.2 °C ║
║ EC: 44 μS/cm ║
║ pH: 5.6 ║
╠════════════════════════════════════╣
║ NPK CONTENT (mg/kg) ║
╠════════════════════════════════════╣
║ Nitrogen (N): 32 mg/kg ║
║ Phosphorus(P):88 mg/kg ║
║ Potassium (K):104 mg/kg ║
╚════════════════════════════════════╝
NPK Calibration Note
According to the manual, the NPK measurements use a rapid detection method with inherent limitations. For critical applications:
- Measure soil samples with a laboratory-grade analyzer
- Use the write function to calibrate NPK values
- The sensor supports writing NPK data to registers 0x0004, 0x0005, and 0x0006
Advanced Features
Changing Sensor Address
To use multiple sensors on the same bus:
// Add this function to change sensor address
void changeSensorAddress(uint8_t newAddress) {
node.writeSingleRegister(0x07D0, newAddress);
delay(100);
Serial.print("Sensor address changed to: ");
Serial.println(newAddress);
}
Changing Baud Rate
To change communication speed:
// Baud rate codes: 0=2400, 1=4800, 2=9600
void changeBaudRate(uint8_t rateCode) {
node.writeSingleRegister(0x07D1, rateCode);
delay(100);
Serial.println("Baud rate changed");
}
Writing NPK Values (Calibration)
To write calibrated NPK values:
// Write nitrogen value (mg/kg)
void writeNitrogen(uint16_t value) {
node.writeSingleRegister(REG_NITROGEN, value);
}
// Write phosphorus value (mg/kg)
void writePhosphorus(uint16_t value) {
node.writeSingleRegister(REG_PHOSPHORUS, value);
}
// Write potassium value (mg/kg)
void writePotassium(uint16_t value) {
node.writeSingleRegister(REG_POTASSIUM, value);
}
Practical Applications
Smart Irrigation System
Use soil moisture readings to trigger irrigation:
if (soilMoisture < 30.0) {
// Activate irrigation pump
digitalWrite(PUMP_PIN, HIGH);
} else {
digitalWrite(PUMP_PIN, LOW);
}
This tutorial has demonstrated how to successfully interface the 5-in-1 NPK Soil Sensor with an Arduino UNO using RS485/Modbus communication. The sensor provides comprehensive soil monitoring capabilities essential for precision agriculture and smart farming applications. With this knowledge, you can now build sophisticated soil monitoring systems for agriculture, research, or hobby gardening projects. The combination of multiple parameters provides valuable insights into soil health and helps optimize growing conditions for better crop yields.
Request Stock
Recently viewed products
You might also be interested in...
Customers who bought this also bought...
General Questions
-
What is the latest price of the Soil NPKPHCTH Sensor IP68 (7 in 1) RS485 Modbus NPK Sensor for Agricultural (English Manual) in Bangladesh?
The latest price of Soil NPKPHCTH Sensor IP68 (7 in 1) RS485 Modbus NPK Sensor for Agricultural (English Manual) in Bangladesh is Special Price BDT 14,999.00 Regular Price BDT 19,580.00 . You can buy the Soil NPKPHCTH Sensor IP68 (7 in 1) RS485 Modbus NPK Sensor for Agricultural (English Manual) at the best price on BDTronics.com or contact us via phone.
-
Where to buy Soil NPKPHCTH Sensor IP68 (7 in 1) RS485 Modbus NPK Sensor for Agricultural (English Manual) in Bangladesh?
You can buy Soil NPKPHCTH Sensor IP68 (7 in 1) RS485 Modbus NPK Sensor for Agricultural (English Manual) online by ordering on BDTronics.com or directly collect by visiting our store in person. BDTronics is a trusted provider of high-quality electronics, 3D printers, solar systems, and robotics parts. We offer fast shipping across the country via courier service.
-
What are the delivery options of Soil NPKPHCTH Sensor IP68 (7 in 1) RS485 Modbus NPK Sensor for Agricultural (English Manual) in Bangladesh?
We provide home delivery service all over Bangladesh. We support Cash on Delivery, Online Bank Transfer, bKash and Credit Card (Visa/ MasterCard/ Amex) payment solutions. The delivery time usually takes 1-2 days inside Dhaka and 2-4 days outside Dhaka.
