Hello, thanks lots for your efficient video's. Could you please send me its Gerber File. With The Best Regards, Dr. Manoochehr Farboodi. faboodi@gmail.com
Hello, i recently tested a similar npk-meter and found that it responded to any salt regardless if it contained any N, P, K. or not. Normal Kichen salt for example consists just of NaCl and no Nitrogen, Phosporous and Potassium (K). It still leads to high values of N,P and K if applyed to the soil. Did you precisely check if your npk-meter is really Ion-selektive or if it maybe also just responds to the conductivity of the solution???
Can you provide details on how you connect the brown wire of NPK sensor to the 9v power supply? Do you need any adapter to do so? Any link on what kinds of power supply should I buy and adapter if needed. Thanks!
Hi! Nice Video, Do you know how to read If I have a sensor with 6 parameters? Like Humidity, Temperature, PH, Nitrogen, Phosphorus and Potassium. I have the frame from manufacturer, but then I do not know how to read each of them because it is only one frame, not for every parameter like yours. So the resulted frame will be like 17 bytes I think.. PS: looks like your first const byte called NPK, but mine contains another 3
Hello, I have verified all connections between Arduino Uno, 485 and NPK sensor, also made sure NPK sensor's power wire is connect to 12V DC power source, the code also looks correct with the same address value as in the manual, but it still always gives 255 value for All N, P K values. Any suggestion how I could resolve it?
Can you suggest me or tell me how to construct the device like we do with blood testing ...how we are knowing that bilirubin is less .....I wanna know it
Hello, I am trying to replicate the project with an Arduino MKR GSM 1400 and I get pure values of 255, however when I tap the RE and DE pins I get values as random, because they are very different. I hope you can help me, thank you very much :)
Hi, how does the sensor work? Does it have ion selective probes, because how else would it know specific values of the elements? Please tell me how it works its driving me crazy, I can't find anything on it. Thanks!
There is no info about it internal circuitry even from the manufacturer. No data-sheet no internal architecture reference. Just you need to know it works well.
You intend to READ the other nutrients that are missing, such as: Calcium, Magnesium, Sulfur, Boron, Iron, Manganese, Copper, Zinc , Molybdenum, Nickel and Silicon that the sensor inserted directly into the soil.
@@HowtoElectronics Kindly friend, you could ask the manufacturer of this sensor if you could read Calcium, Magnesium and Sulfur or the other nutrients in the soil because they are of extra importance in agriculture. Oh in case you want to send me the name of the manufacturer. I thank you for your attention and I await your response.
Hello Sir/Maam, I would like to ask, if the sensor detect this example value: N: 40 mg/kg P: 90 mg/kg K: 100 mg/kg What is the threshold of Low, Medium Low, Medium High, High, and Very High? And I ask too let say Nitrogen is Low how many amount of nitrogen need? Is the soil need 120, 100, 80, 60, 40, 30 nitrogen and so on?
Hi! Have you tried it? I'm doing research on electronic measurements of NPK on soil, but a lot of people are skeptical of the measurements these sensors return.
Hello! I'm facing a problem. When I use the same code that howtoelectronics has provided for the NPK sensor, the Max485 to TTL converter / Modbus we're using simply returns FFFFFF, and thus just constantly outputs 255, 255, 255 for the values. Any idea on why this might be happening?
Hiii, Have a query regarding this meter.. Does it give total or available NPK... Can we use it for all types of land uses? And how to convert the values of different parameters given by it.. Also how to save and transfer data in it...
I was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
Can you connect the sensor without knowing the values at 7:12? I have the same sensor that uses rs-485, but it has only 8 bits and one stop bit, the address values are not shown in instruction manual. It is really supposed to show only one value - dew point, so can i use your code without those values? Also, can you send commands to the sensor? Mine is supposed to have those, and it is supposed to show its detailed information, but i can't seem to connect it properly ;-; Thanks
Hi. I have the same problem using Arduino UNO. It replays with FFFFFFFFFFF for N,P, and K. is there any development regarding using Arduino UNO with NPK sensor?
Give the NPK sensor with separate power (mine-12V),i.e donot connecte the gnd to nano and 485 board. (From HK)Give the NPK sensor with separate power (mine-12V),i.e donot connecte the gnd to nano and 485 board. (From HK)
Pointless! Just because you get conductivity and the values vary doesn't mean you are measuring NPK values. If there's no calibration procedure this is complete dookey
I was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
@@HowtoElectronicsI was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
Hi, i have a soil multi-parameter sensor 7-1, and i want to print all the sensor, and i have problems to do that. if i use the npk code, it always prints 255 in some sensor. How can i use it with all sensors? i don't know if the answer is the number of bits or something. Please i need help
I was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
@@hector2742 hello I used an arduino nano and the connections are same in the video. May I know how you solved your problem? I have the 6 in 1 multi-parameter sensor
Hi nice video, i was buy the sensor and try to implement this, at the first time i got the right value and always change, but now the output value constant 255,255,255, do you know what could it be the problem ?
@@HowtoElectronics I need to program Arduino for a soil NPK server, it is a sensor to measure the amount of Nitrogen, phosphorus and poitium in the soil
Hi, when I write the same code as your in esp8266 it just displays me 255mg/kg all the time rather the sensor is in or out the soil it display me the same reading, why??
I tried making it work with both ESP8266 & ESP32 but the sensor didn't work at all. Everytime I got 255 as output. So made a alternative method to upload the data to server using NRF24LO1 module and ESP32 gateway. You can check my other video.
Thanks for the nice video...its guiding however, I've done everything but the values are 255, 255, 255 for all the N P and K.. what could be the problem?
I spent all night to find out the solution. In my case the sensor default boundrate was 4800 instead of 9800 so, modbus initialization now looks like that: mod.begin(4800). I also had to add two 4k7 resistors to pull up I2C bus to start display working
@@rajatvatwani7104 I had to add two resistors between +5V and data lines (SDA and SCL) so now both data lines are connected to power supply via 4k7 resistor. Good luck 👍
is your data is verified? with the lab data? Bcoz put conducting probes in soil and readings passes through comparator/amplifier then it shows data on the screen. It is natural. that might be analog values... and 2nd thing that is Chinese products no trust. Many big companies (e.g. one Swiss and France company) finding a way to determine NPK, so this 100$ sensor does that. Might be something wrong with this JXCT sensor. (Bcoz NPK are chemical elements ) I m not sure, maybe I m wrong but technically 50-50 chance
I have the same concern as Varnit because of the quality of mainland China products. Can you post the name of the Russian lab if it's possible? Thank you and Merry Christmas.
I also have doubts on the accuracy of this sensor. It seems that this sensor is some how implementing an electrolysis of soil to measure the nutrients and I haven't been able to find any research material related to successful implementation of this method. It would be very helpful if you can share some data which compares the results of this sensor with lab data
Hey, I did the implementation exactly the way mentioned in the tutorial, I just used Serial monitor in place of OLED display. But I find the value of N, P, K to be 255 when the NPK sensor is plugged to 9-24v power supply and even if it is not connected. Can you please get me out of this i.e finally getting the exact NPK values you got in the video. Please 🙏
@@sulaimantriarjo8097 Do search for NPK sensor not working in Arduino forum. I found some leads there but first to understand whether your sensor is working or not I used Rs485 Converter and a PC using CAS Modbus Scanner Software.
@@sulaimantriarjo8097 Another Point to note is that the Jxct NPK sensor might not be reading the correct NPK values as we observed some linear trendline between N, P, K form the data of many samples. So, basically our conclusion was that the NPK sensor was only reading the Electrical conductivity and then trying to use some algorithm (which might be close to the linear I mentioned above)to give us the N, P, K values i.e., We found the NPK values shown by the sensor are not trust worthy.
I spent all night to find out the solution. In my case the sensor default boundrate was 4800 instead of 9800 so, modbus initialization now looks like that: mod.begin(4800). I also had to add two 4k7 resistors to pull up I2C bus to start display working
*NPK Sensor Purchase Link:* _amzn.to/3rEHI8r_
Hello, thanks lots for your efficient video's. Could you please send me its Gerber File.
With The Best Regards,
Dr. Manoochehr Farboodi.
faboodi@gmail.com
@@mahsamini2022 Sorry for the ignorance of my question, but what would the Gerber Files be.
Best regards,
Dr. Manoochehr Farboodi.
code is running but the output values are 255 255 255 how to overcome this issue
@@SoilMaster-4u use 4800 for serial baud rate
@@SoilMaster-4u same problem
Did you found how to solve the problem
Searching This Video on Whole TH-cam And Finally Got Over Here 👍👍👍👍👍👍👍👍👍👍
Hello, i recently tested a similar npk-meter and found that it responded to any salt regardless if it contained any N, P, K. or not. Normal Kichen salt for example consists just of NaCl and no Nitrogen, Phosporous and Potassium (K). It still leads to high values of N,P and K if applyed to the soil. Did you precisely check if your npk-meter is really Ion-selektive or if it maybe also just responds to the conductivity of the solution???
Hi, i was going to buy one but you always have the same problem?
@@HeadFlux I sent it back because it was absolutely useless for my purposes. It may indicate coductivity but it had nothing to do with npk!
@@go4minrakulyx Yes i found the same, it's bs...
@@HeadFluxthe sensor was bs or the whole connection?
@@shafuimcoming5151 the sensor
Your all projects are very informative and nice way of presentations too.
Can you provide details on how you connect the brown wire of NPK sensor to the 9v power supply? Do you need any adapter to do so? Any link on what kinds of power supply should I buy and adapter if needed. Thanks!
Yes use a 9-12V DC Adapter.
Can we do connection in pcb or directly on the nano and screen
Hi! Nice Video, Do you know how to read If I have a sensor with 6 parameters? Like Humidity, Temperature, PH, Nitrogen, Phosphorus and Potassium.
I have the frame from manufacturer, but then I do not know how to read each of them because it is only one frame, not for every parameter like yours. So the resulted frame will be like 17 bytes I think..
PS: looks like your first const byte called NPK, but mine contains another 3
How is the measure from the soil or the solution?
And how do you calibrate?
Hello, I have verified all connections between Arduino Uno, 485 and NPK sensor, also made sure NPK sensor's power wire is connect to 12V DC power source, the code also looks correct with the same address value as in the manual, but it still always gives 255 value for All N, P K values. Any suggestion how I could resolve it?
Check the inquiry frame. Confirm with the manufacturer. Find datasheet and check what could be the inquiry frame.
Didn't know they made these sensors. I wonder if this would work in hydro, or if there are NPK sensors made for testing water.
Hey! Did you found out any sensor which works on hydro?
Hi. I tried to follow your steps but it is not working. What could be the problem.
Small doubt how did u connect npk brown n black wire to dc power in a breadboard ??
nice work bro, i saw your post on face book and i followed you here. am really happy to see such video
Thanks bro. Keep supporting pur entire team.
Can you use the NPK sensor in water and not in soil?
How did it go?
Can you suggest me or tell me how to construct the device like we do with blood testing ...how we are knowing that bilirubin is less .....I wanna know it
Thank you for making this project I really loved this project and I am waiting for your next project.
hello , i have a problem, even thou i dint put my sensor into the soil it keeps giving me a random data
Hello, I am trying to replicate the project with an Arduino MKR GSM 1400 and I get pure values of 255, however when I tap the RE and DE pins I get values as random, because they are very different. I hope you can help me, thank you very much :)
Is this fake then? I was wondering how it differentiates between electrolytes
Hello, can you tell me if I can submerge a sensor in a rice plant? or it will burn... would you have a tip for that?
You can submerge
Grate thing man ! Have u its contrasting data with lab-tested soil NPKs ? please help me
I created this, i am getting npk value but it's changing every second... How to fix it
hello can it be calibrated even without the oled display?
Hi, how does the sensor work? Does it have ion selective probes, because how else would it know specific values of the elements? Please tell me how it works its driving me crazy, I can't find anything on it. Thanks!
There is no info about it internal circuitry even from the manufacturer. No data-sheet no internal architecture reference. Just you need to know it works well.
@@HowtoElectronics how did you test for accuracy?
I fear the answer is that it does not, in fact, work...
I read somewhere that it might use FDR (Frequency Domain Reflectometer). But it might also just be some BS sensor.
How long will it take for the sensor to process and output data?
Thanks, I have a project for electronic diploma where I have to make a soil quality measuring device. This is really helpful.
Please study the sensor before u take !
You intend to READ the other nutrients that are missing, such as: Calcium, Magnesium, Sulfur, Boron, Iron, Manganese, Copper, Zinc , Molybdenum, Nickel and Silicon that the sensor inserted directly into the soil.
Most of the sensors are not available.
@@HowtoElectronics Kindly friend, you could ask the manufacturer of this sensor if you could read Calcium, Magnesium and Sulfur or the other nutrients in the soil because they are of extra importance in agriculture. Oh in case you want to send me the name of the manufacturer.
I thank you for your attention and I await your response.
Contact JXCTIOT china
Could you please share how to connect NPK sensor(RS485) to Raspberry pi. Thanks.
In display npk value is varying continuing... How to solve it
Apart from NPK , is there any other sensors available to determine other soil elements.
Only laboratory method or lab test is available which is very expensive
Hello Sir/Maam, I would like to ask, if the sensor detect this example value:
N: 40 mg/kg
P: 90 mg/kg
K: 100 mg/kg
What is the threshold of Low, Medium Low, Medium High, High, and Very High? And I ask too let say Nitrogen is Low how many amount of nitrogen need? Is the soil need 120, 100, 80, 60, 40, 30 nitrogen and so on?
Does this sensor work when used in a body of water. When used in a small bucket of water that I added NPK
This sensor is designed for soil not for water
How much Reliable is this Chinese Sensor?
Any Dicumentation?
It's Seriously Costly it costs more than $150
Hi! Have you tried it? I'm doing research on electronic measurements of NPK on soil, but a lot of people are skeptical of the measurements these sensors return.
@@newenv3770 Really?
Hello! I'm facing a problem. When I use the same code that howtoelectronics has provided for the NPK sensor, the Max485 to TTL converter / Modbus we're using simply returns FFFFFF, and thus just constantly outputs 255, 255, 255 for the values. Any idea on why this might be happening?
Check the frame bit and compare with instruction manual. If the address are correct the sensor will return correct values.
Hi there Satriya, did your NPK worked after that?
Give the NPK sensor with separate power (mine-12V),i.e donot connecte the gnd to nano and 485 board. (From HK)
Kasus nya sama bang
Udah terpecah kan blm masalah dmn
dah dapat solusinya mas ?
Please explain about protocol connection between npk and aurdino nano
Hiii,
Have a query regarding this meter..
Does it give total or available NPK...
Can we use it for all types of land uses?
And how to convert the values of different parameters given by it..
Also how to save and transfer data in it...
How do you calibrate the sensor?
I was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
code running but the output for N P K is 255 how to overcome with this
Does the sensor work for fertilizer?
Yes it does
I'll use npk sensor, arduino uno ch340g, rs485 module,oled will it work?
can we connect this to DE-10 nano fpga cyclone V
You cold say the list of the elements needed for this assembly. Thankes.
Your videos are nice and very entertaining. I just wish you would buy a new microphone so I could clearly hear and understand them!
hi video is useful but when connected all the things it produce output 255
Can you connect the sensor without knowing the values at 7:12? I have the same sensor that uses rs-485, but it has only 8 bits and one stop bit, the address values are not shown in instruction manual. It is really supposed to show only one value - dew point, so can i use your code without those values? Also, can you send commands to the sensor? Mine is supposed to have those, and it is supposed to show its detailed information, but i can't seem to connect it properly ;-; Thanks
I need the paper where i can find inquiry frame for THC sensor temperature humidity and conductivity
Hi.
I have the same problem using Arduino UNO. It replays with FFFFFFFFFFF for N,P, and K. is there any development regarding using Arduino UNO with NPK sensor?
Give the NPK sensor with separate power (mine-12V),i.e donot connecte the gnd to nano and 485 board. (From HK)Give the NPK sensor with separate power (mine-12V),i.e donot connecte the gnd to nano and 485 board. (From HK)
Can you explain how to separate Nitrogen, Phosphorous and Potassium signals using electromagnetic field, resistance, etc?
They are using the hex address inside the code
Plz Let me know why the value is obtained only in moist condition and fluctuate with addition of Water
hello sir, ur problem is also mine so please help me when u fix it
Can i apply this sensor for water ? For hydroponic project
This is only for Soil
Pointless! Just because you get conductivity and the values vary doesn't mean you are measuring NPK values. If there's no calibration procedure this is complete dookey
Hi, For an Arduino Uno would they be the same connections?
Yes the connection remains same
what is the schematic for Arduino Uno ?????
This info is missing: Is it accurate? does it work ok? thanks!
Not accurate. Thats the reason why manufacturer has stopped manufacturing it.
Hi, excellent video, can I read the 3 values in output voltage mode???
Not at all
@@HowtoElectronics so I can??
Everything is similar to ..
How to Mechatronics
I need NPK sensor .What is the cost of NPK sensor
Hi !! Can this NPK meter be used in water which have soluble npk in it?
Please reply.
This is made for soil not for water
I was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
@@HowtoElectronicsI was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
How can i collect this sensor. Please give me the link.
How to get npk sensor? I need that
hello sir , I appreciate u much , also please replays the soil properties those may factor to its output signal fluctuation(display NPK).
Thank you so much for this video sir🔥🔥😍
Does it work in water?
Results are not impressive in water.
the 3 values of N,P and K remains fixed at 255
they do not want to change
How can i fix it
same problem please help
Can we connect npk sensor and soil mositure sensor in a single nodemcu
Yes you can connect. But i guess NPK sensor doesn’t work with nodemcu.
@@HowtoElectronics then in arduino uno ?
i could not find the link for buy sensor
What's the cost for buying an NPK sensor.
60$ on Aliexpress
sir what is the cost of this project if we want to buy you
What about just adapting it to USB and use it with a laptop?🤔
It won’t work as it requires power supply more than 9V
Hi, i have a soil multi-parameter sensor 7-1, and i want to print all the sensor, and i have problems to do that. if i use the npk code, it always prints 255 in some sensor. How can i use it with all sensors? i don't know if the answer is the number of bits or something. Please i need help
I was wondering if this was a fake, typically it would make sense that a semipermeable and selective membrane (each to potassium, nitrogen, and phosphorous) would be needed to keep out other dissolved electrolytes. I'm hearing nothing like that here and it probably is fake and will just spit out random numbers. If you want to dissolve NaCl in water and see what happens, if it reads nothing, then try some potassium chloride solution, and see if it only reads a potassium level. Do the same with nitrogen and phosphorous. If you really want to see how accurate it is after that you can do a little math and see if the concentration is accurate. I did not see that level of scrutiny here in this video and would not waste my money on this product.
@@jonesmatthew7511 I solved it, Thanks
@@hector2742 hey buddy, can you let me know how you solved this FFFFFFFF 255 issue?
@@luqmanafridi3952 What's microcontroller do you use?
@@hector2742 hello I used an arduino nano and the connections are same in the video. May I know how you solved your problem? I have the 6 in 1 multi-parameter sensor
Sir how to convert npk value to string?
Thank you i need this
Can you give the link of the sensor ?
Can't download code kindly guide
Hi mam, How to order this NPK sensor from india
where you got this sensor?Please share the link
Check the website article for the link
Great video
Hi nice video, i was buy the sensor and try to implement this, at the first time i got the right value and always change, but now the output value constant 255,255,255, do you know what could it be the problem ?
just dip the sensor in water, tea or soil that will show the result, 255 seams to be idle value
can i have source code for this one
Any alternatives for jxct soil sensor?(20k😱) Please let me know
No alternative bro. There is another sensor which is more expensive AS7265x, which measure NPK value by spectral analysis method.
I love your voice
Please can you help me with a problem I have with the arduino code?
What is your problem bro?
@@HowtoElectronics I need to program Arduino for a soil NPK server, it is a sensor to measure the amount of Nitrogen, phosphorus and poitium in the soil
There is already another video with the server.
Hi, when I write the same code as your in esp8266 it just displays me 255mg/kg all the time rather the sensor is in or out the soil it display me the same reading, why??
I tried making it work with both ESP8266 & ESP32 but the sensor didn't work at all. Everytime I got 255 as output. So made a alternative method to upload the data to server using NRF24LO1 module and ESP32 gateway. You can check my other video.
@@HowtoElectronics means this sensor only works with arduino??
No idea bro. I just couldn’t get the output using ESP8266 & ESP32. You may try and let us know.
@hamza ali in Pakistan from where you get it and in how much
@@abdulcute this sensor is not available in Pakistan, I buy it online from aliexpress in 12000Rs
Thanks for the nice video...its guiding however, I've done everything but the values are 255, 255, 255 for all the N P and K.. what could be the problem?
just dip the sensor in water, tea or soil that will show the result, 255 seams to be idle value
Components name in detail
I do not know what I have done wrong, I only get:
nitrogenValue 250 mg / kg
PhosphoroValue 250 mg / Kg
PotassiumValue: 250 mg / kg
Same
I'm also having the same problem
I like this video!
How to use with ESP8266 ?
Same code or not same code.
It doesn't work with esp8266
@@HowtoElectronics en ESP32
HardwareSerial sensor(2);
#include
#include
#include
////////////////////////////////////////////////////////////////////////
// Definimos las constantes
//#define COLS 20 // Columnas del LCD
//#define ROWS 4 // Filas del LCD
#define RS 13
#define EN 12
#define D4 14
#define D5 27
#define D6 26
#define D7 25
#define DE 23
#define RE 22
LiquidCrystal lcd(RS ,EN,D4,D5,D6,D7);
////////////////////////////////////////////////////////////////////////
TaskHandle_t Task1;
TaskHandle_t Task2;
TaskHandle_t Task3;
WiFiServer *Servidor;
WiFiClient client;
String cadena;
boolean cliente=false;
//byte NPK[]= {0x01,0x03,0x00,0x01e,0x00,0x03,0x34,0x0D};
byte NITROGENO[]={0x01,0x03,0x00,0x01e,0x00,0x01,0xe4,0x0c};
byte FOSFORO[]= {0x01,0x03,0x00,0x01f,0x00,0x01,0xb5,0xcc};
byte POTASIO[]= {0x01,0x03,0x00,0x020,0x00,0x01,0x85,0xc0};
////////////////////////////////////////////////////////////////////////
void MENU(void *pvParameter);
void SERVIDOR(void *pvParameter);
void LECTURAS(void *pvParameter);
int lectura( byte trama[]);
byte getch();
int Nitrogeno,Fosforo,Potasio;
/////////////////////////////////////////////////////////////////////////
// Create An LCD Object. Signals: [ RS, EN, D4, D5, D6, D7 ]
void setup()
{
pinMode(RE, OUTPUT);
pinMode(DE, OUTPUT);
Servidor=new WiFiServer(25);
Serial.begin(9600);
sensor.begin(9600, SERIAL_8N1);////////sensor
WiFi.mode(WIFI_AP);
WiFi.softAP(String("AGROLINK").c_str(),String("12345678").c_str());
Servidor[0].begin();
lcd.begin(20,4);
lcd.clear();
lcd.setCursor(1,0);
lcd.printf(" BIENVENIDOS A ");
lcd.setCursor(1,1);
lcd.printf(" AGROLINK SCOPE");
IPAddress IP = WiFi.softAPIP();
// xTaskCreate(MENU,"MENU",5024,NULL,2,&Task1);
xTaskCreate(SERVIDOR,"SERVIDOR",5024,NULL,2,&Task2);
delay(3000);
}
void loop()
{
}
///////////////////////////////////////////////////////////////////////////
/*void MENU(void *pvParameter)
{
while(true)
{
delay(1);
}
}*/
///////////////////////////////////////////////////////////////////////////
void SERVIDOR(void *pvParameter)
{
while(true)
{
client = Servidor[0].available();
if(client)
{
//Serial.println("New Client.");
while (client.connected())
{
if (client.available())
{
cadena=client.readStringUntil('
');
if(cadena.equals("ESCANEAR"))
{
cliente=true;
if(Task3==NULL)
xTaskCreate(LECTURAS,"LECTURAS",5024,NULL,2,&Task3);
delay(200);
}
else if(cadena.equals("STOP"))
{
cliente=false;
lcd.clear();
lcd.setCursor(1,0);
lcd.printf(" BIENVENIDOS A ");
lcd.setCursor(1,1);
lcd.printf(" AGROLINK SCOPE");
}
client.flush();
cadena="";
}
}
}
delay(1);
}
}
///////////////////////////////////////////////////////////////////////////////////
void LECTURAS(void *pvParameter)
{
while(true)
{
if(cliente)
{
Nitrogeno=lectura(NITROGENO);
delay(250);
Fosforo=lectura(FOSFORO);
delay(250);
Potasio=lectura(POTASIO);
delay(250);
client.println("N:"+String(Nitrogeno)+"mg/kg,K:"+String(Potasio)+"mg/kg,P:"+String(Fosforo)+"p/m,PH:0,T:0");
lcd.clear();
lcd.setCursor(0,0);
lcd.printf("N:%umg/kg",Nitrogeno);
lcd.setCursor(0,1);
lcd.printf("K:%umg/kg",Potasio);
lcd.setCursor(0,2);
lcd.printf("P:%umg/kg",Fosforo);
lcd.setCursor(0,3);
lcd.printf("PH:0,Temp:0");
delay(1000);
}
delay(1);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int lectura( byte trama[])
{
int dato=0x00000000;
int len=0;
byte arreglo[12]={0,0,0,0,0,0,0,0,0,0,0,0},aux=0;
digitalWrite(DE,HIGH);
digitalWrite(RE,HIGH);
len=sensor.write(trama,8);
delay(10);
if(len==8)
{
digitalWrite(DE,LOW);
digitalWrite(RE,LOW);
for(byte i=0;i 0)
{
aux=(byte)sensor.read();
arreglo[i]=aux;
}
}
for(byte i=0;i
@@jesusarmandocamachofelix can you share in english, it's work on esp32?
I wish to buy a npk ph probe with arduino bluetooth for my village to help the farmers cut fertilizer usage. Can you help me
Nice project
Awesome Thank you
Anyone please tell me which protocal used to connect aurdino nano with npk sensor
RS485
@@HowtoElectronics but rs485 is a device name
Rs485 is protocol
Max485 is device name.
Use google to learn.
@@HowtoElectronics but in google the communication between max485 and aurdino is modbus RTU protocol
Hi, I followed this tutorial, but it always marks me 255 and in hex FFFFFFFFFFFFFF... I'm sure the links are right, and the program is the same
hi, I have the same problem. is there any development?
Me too
Do you fixe it
I spent all night to find out the solution. In my case the sensor default boundrate was 4800 instead of 9800 so, modbus initialization now looks like that: mod.begin(4800). I also had to add two 4k7 resistors to pull up I2C bus to start display working
@@michapacholak9559 could you please tell where you added two 4.7 k resistors in the circuit?
@@rajatvatwani7104 I had to add two resistors between +5V and data lines (SDA and SCL) so now both data lines are connected to power supply via 4k7 resistor. Good luck 👍
is your data is verified? with the lab data?
Bcoz put conducting probes in soil and readings passes through comparator/amplifier then it shows data on the screen. It is natural. that might be analog values...
and 2nd thing that is Chinese products no trust.
Many big companies (e.g. one Swiss and France company) finding a way to determine NPK, so this 100$ sensor does that.
Might be something wrong with this JXCT sensor. (Bcoz NPK are chemical elements )
I m not sure, maybe I m wrong but technically 50-50 chance
@@HowtoElectronics oky. Great!!
Can you please give me the name of that Russian R&D lab?
Great!! if this technology build-in India.
I have the same concern as Varnit because of the quality of mainland China products. Can you post the name of the Russian lab if it's possible? Thank you and Merry Christmas.
I also have doubts on the accuracy of this sensor. It seems that this sensor is some how implementing an electrolysis of soil to measure the nutrients and I haven't been able to find any research material related to successful implementation of this method. It would be very helpful if you can share some data which compares the results of this sensor with lab data
@@HowtoElectronics Tem previsão de quando vai ser lançado?
👏👏👏
Thr website link went down
It is fixed now
@@HowtoElectronics much appreciated
Good
Hey, I did the implementation exactly the way mentioned in the tutorial, I just used Serial monitor in place of OLED display. But I find the value of N, P, K to be 255 when the NPK sensor is plugged to 9-24v power supply and even if it is not connected. Can you please get me out of this i.e finally getting the exact NPK values you got in the video. Please 🙏
I got same problem too. do you have any development?
@@sulaimantriarjo8097 Do search for NPK sensor not working in Arduino forum. I found some leads there but first to understand whether your sensor is working or not I used Rs485 Converter and a PC using CAS Modbus Scanner Software.
@@akulavamsi4832 usb to rs485 converter? thanks. very appreciated
@@sulaimantriarjo8097 yes
@@sulaimantriarjo8097 Another Point to note is that the Jxct NPK sensor might not be reading the correct NPK values as we observed some linear trendline between N, P, K form the data of many samples. So, basically our conclusion was that the NPK sensor was only reading the Electrical conductivity and then trying to use some algorithm (which might be close to the linear I mentioned above)to give us the N, P, K values i.e., We found the NPK values shown by the sensor are not trust worthy.
where we buy npk sensor
Read my website article. The link for buying NPK sensor is already given.
👍👍👍
Bro who much cost npk sensor is
50-60$ from the manufacturer
@@HowtoElectronics how to buy that it not available in amazon
Buy from aliexpress. Or any other chinese sites.
I do not know what I have done wrong, I only get:
nitrogen value 255 mg / kg
PhosphoroValue 255 mg / Kg
PotassiumValue: 255 mg / kg
I'm also having the same problem
I spent all night to find out the solution. In my case the sensor default boundrate was 4800 instead of 9800 so, modbus initialization now looks like that: mod.begin(4800). I also had to add two 4k7 resistors to pull up I2C bus to start display working