DIY DIY - Affordable? Soil NPK, pH & EC sensor (NPKPHC-S)

NPKPHC-S Sensor

Bob's Auto's

On a breeding journey...
Cultivators Club
Joined
Jun 18, 2020
Messages
6,240
Reputation
5,445
Reaction score
25,724
Points
0
Currently Smoking
The current harvest
Hey fellow DIY's :toke:


As you might have guessed from the title, I would like to talk about the NPKPHC-S sensor.
I found this one while window shopping on Ali yesterday and although pricey, it was still 'cheap' considering what it's suppose to be able to measure...
NPKPHC-S.jpg


And it's got an RS485 output. I'm not going into the technical specifics in this introductory post, but let's say one could have the sensor at half a mile away and still communicate with it over 2 wires. This is why it's the most commonly used protocol in PLC's and industrial machines.
This also means I can interface this sensor with an Arduino or even better a NodeMCU or other ESP series WiFi enabled device. Oh, the possibilities are giving me goosebumps :yay:

The idea is to have this sensor semi wireless. Meaning it still needs to be connected to a power supply. But this can be a USB battery pack as these devices have a USB connection. The device will output the measured values to my Blynk server. And then I can connect to it with my Blynk app on my phone.

I've already made a rudimentary 'test' app on the phone...
Screenshot_blynk.jpg


And...spent half of the night coding some test-programs for when the sensor arrives... And this my friends, will be the hard part...Waiting until everything arrives...:shrug:
So, this thread will record the voyage in building this Soil monitor and evaluating if it's any good.


Regards,

Bob :toke:
 
Neat! I've seen those before but it seemed like too much for me to get working. Very curious to see how you get them going.
I'll tag along :toke: :pop:always like the tech sh*t....
Oh...you guys are in for a ride!!!
Let me show you what I've been coding in Arduino IDE and made in the Blynk App.
Momentarily I can read out the following devices:
  • NPKPHC-S Sensor = NPK, pH & EC
  • DS18B20 = High resolution Soil temperature probe
  • DHT44 = High resolution Temp & Humidity probe
  • Capacitive Soil Moisture Sensor Module V1.2
  • TSL2561 = Light sensor
1668294590182 _small.jpg


Next tab, we have all sorts of diagrams...
1668294590176 _small.jpg


And third tab is full on in development!

But I did code in two digital 10K potmeters so I can adjust the speed of the extraction fan and the intensity of the TS-1000 light, which is fully adjustably via the CH2 RJ11 port. That way I have a way to automate the climate inside the tent.
I still have a 4-channel relay lying around which I'll use to switch four small 5V pumps. Each will be connected to a pot and each pot will receive a capacitive moisture sensor.
1668294590173 _small.jpg



Ok, I'll admit...I've gone overboard...But what do you guys think? Am I missing something? Maybe CO2 sensor while I'm at it?...:shrug:
 
Schematic
Well, I did order myself a CO² sensor, but it more then worth it...I guess :shrug::haha:

After coding all sorts of test programs and coming to the conclusion that an ESP32 would have run out of pins way before I installed half the sensors...I decided on a combination of something old and proven and something new, as it has to be able to connect to the WiFi.

Let me introduce you to the Arduino Mega with WiFi!! Oh yes, all the input and output pins that the Mega has, Wifi thanks to the esp chip on board and loads of hardware upgrades which makes me want to connect as many sensors as I possibly can onto it.
Sensor Schema_large.png


Hope this is clear for you guys as much as for myself as by the time all the parts arrive I've probably forgotten which device connects to which pin...:coffee2:
 
Hey DIY'ers :wiz:

Had some free time this morning and before I knew it, it was 10 O'clock...
Oh well, I've got the following sensors working and updating my Blynk app...The ones crossed out are still in transit with some slow boat :sleeping:
I'm also able to control the two digital potentiometers and will be testfitting these on the weekend...Fingers crossed I don't blow a fuse :drunks:
1668460823563 _small.jpg


These are the sensors, digital pots and a sepperate temperature/humidity meter for control.
1668460823570 _small.jpg
 
Really cool project. I'm impressed with how much data you are going to get.
Came onto a snag already. The CO² sensor I had lying around works perfectly, tested it on a separate board. But when I add it to the existing setup and run the new code the Arduino Mega reboots whenever the CO² code is called. Now, I seem to remember having some issues between I2C and OneWire librarys in the past. So in the worst case I divide the amount of sensors and transplant some of those onto another board. I know, lame of me, but my programming skills are what they are :shrug:
 
Hey fellow DIY's :toke:


As you might have guessed from the title, I would like to talk about the NPKPHC-S sensor.
I found this one while window shopping on Ali yesterday and although pricey, it was still 'cheap' considering what it's suppose to be able to measure...
NPKPHC-S.jpg


And it's got an RS485 output. I'm not going into the technical specifics in this introductory post, but let's say one could have the sensor at half a mile away and still communicate with it over 2 wires. This is why it's the most commonly used protocol in PLC's and industrial machines.
This also means I can interface this sensor with an Arduino or even better a NodeMCU or other ESP series WiFi enabled device. Oh, the possibilities are giving me goosebumps :yay:

The idea is to have this sensor semi wireless. Meaning it still needs to be connected to a power supply. But this can be a USB battery pack as these devices have a USB connection. The device will output the measured values to my Blynk server. And then I can connect to it with my Blynk app on my phone.

I've already made a rudimentary 'test' app on the phone...
View attachment 1537326

And...spent half of the night coding some test-programs for when the sensor arrives... And this my friends, will be the hard part...Waiting until everything arrives...:shrug:
So, this thread will record the voyage in building this Soil monitor and evaluating if it's any good.


Regards,

Bob :toke:
Love this idea
 
Back
Top