The soil nutrient content can be easily measured using NPK Soil Sensor & Arduino. Measurement of soil content N (nitrogen), P (phosphorus), and K (potassium) is necessary to determine how much additional nutrient content is to be added to soil to increase crop fertility. The soil fertility is detected using NPK sensors.
A major component of soil fertilizer is nitrogen, phosphorus, and potassium. The knowledge of the soil nutrient concentration can help us to learn about nutritional deficiency or abundance in soils used to endorse plant production.
There are multiple methods of measuring the soil nutrient content using some optical sensors or using a spectrometer. But the spectral analysis method is not convenient and the drawback is the data are only 60-70% correct. While comparing the spectral analysis method with traditional wet chemistry methods, the accuracy of the products is yet to be fully resolved, given the paucity of data in that regard.
This NPK sensor does not automatically provide accurate readings—it must first be calibrated. To ensure proper use of the NPK storage system, soil samples must be collected and measured using a nationally standardized measuring instrument.
After obtaining accurate nitrogen (N), phosphorus (P), and potassium (K) values, these results must be written into the device using the 485 communication protocol.
Once the calibration data is uploaded, the sensor will begin displaying real-time NPK values. This calibration step is mandatory and must be completed before relying on any measurements from the system.
The Soil NPK sensor is a low-cost, quick responsive, high precision & portable Sensor that works with Modbus RS485. The advantage of this sensor over a traditional detection method is that it gives very fast measurement & data are highly accurate. All you need is to insert its probe into the soil and get the reading using Arduino. Featured By RoboticsBD.
Product Images are shown for illustrative purposes only and may differ from the actual product.
Note: Product images/ Components brand may vary from actual product as our stock rotates.
Connect the NPK Sensor's Yellow and Blue wires to USB's A and B terminals RS485.
Connect the Brown and Black wires from the NPK Sensor to the + and - terminals on the Barrel Connector.
Now power the sensor and connect the USB RS485 to the Windows 10 PC.
Please check your device manager to ensure which COM port is detected.
Download CAS
MODBUS SCANNER and add a device (
https://store.chipkin.com/products/tools/cas-modbus-scanner)
Use Baud Rate: 4800
Device ID: 1
Read Holding Register from from 40001 for 100RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD
RoboticsBD RoboticsBD
Technical features:
This sensor does not require any chemical components, This sensor has Modbus communication port where we cannot connect it with microcontrollers directly but by using an intermediate Modbus module. We can connect it to most of the microcontrollers like Arduino, ESP32 and measure the Nitrogen, Phosphorus and Potassium values in Realtime, just by inserting the probes in the soil. This sensor also detects the type of the soils like Acidic soil, Alkaline soil. You need an external Modbus module such as RS485/MAX485 to connect the senor with microcontrollers.
0This sensor works with voltage range of 5v-30V with maximum power consumption less than 0.15watts. which works in the temperature range of 5-45 Celsius. Many microcontrollers such as Arduino, PIC microcontrollers, 8051 microcontrollers family, ESP etc. support this soil NPK sensor as they have baud rates of 2400,4800 and 9600. This soil NPK sensor is said to have a high precision measurements with an accuracy of ±2%, with measuring resolution of 1mg/Kg(mg/liter) and can measure the Nitrogen, phosphorus and Potassium in the range between 0 to 1999mg/kg(mg/liter).
RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD
Applications
- Can be used in Agricultural smart farming
- Can be used in high value commercial plants placed in pots.
Features:
- Simple to use, few operation steps, fast measurement, no reagents, unlimited detection times.
- High measurement accuracy, fast response speed, and good interchangeability.
- The electrode is made of specially treated alloy material, which can withstand strong external impact and is not easy to damage.
- Completely sealed, resistant to acid and alkali corrosion, and can be buried in soil for long-term dynamic testing.
- The probe plug-in design ensures accurate measurement and reliable performance.
RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD
| General Specification |
| DC power supply (default) |
DC 5-30V |
| Maximum power consumption |
≤0.15W (@12V DC, 25℃) |
| Operating temperature |
0℃~55℃ |
| Nitrogen phosphorus potassium |
range: 1-1999 mg/kg (mg/L); resolution rate: 1 mg / kg (mg / L), accuracy of: ± 2% FS |
| Response time |
<1S |
| Protection |
IP68 |
| Probe materials |
stainless steel |
| Sealing material |
black flame-retardant epoxy resin |
| Cable default length |
1 m |
| Dimensions |
45*15*123mm |
| Output signal |
RS485 (Modbus protocol) |
| Shipment Weight |
0.140 kg |
| Shipment Dimensions |
15 × 11 × 5 cm |
Please allow 5% measuring deviation due to manual measurement.
Documentation:
You can find the source code and Interfacing Tutorial in the link below (Ask for permission with your ORDER ID)

- Interfacing Soil NPK sensor with Arduino Nano and OLED display
Connection

Using Method
RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD

RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD
Errors with Solutions:
Getting 255 for all NPK values:
- Check with connection between sensor and MAX485
- Increase the delay to allow response bytes to be received!
- Maybe there is error in your code.
Getting no response from sensor data
- Check the baud rate with the sensor manufacturer and try different baud rates
- May be due to sensor or the Modbus module malfunctioning or not working.
Important Notes:
After analysis we found that this sensor is not completely accurate but works at an acceptable accuracy. Please try to find the sensor manufacturer datasheet to get the working enquiry frame data. Calibrating this sensor is still a dreamy hope for many users. This sensor is purely for soil only, measuring it in water gives foul results.
RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD RoboticsBD
Package Includes:
1 x Soil NPK Sensor Agricultural RS485/Modbus