Cwt-soil npk sensor in nodemcu not work

that's a bug, return value should be unsigned..
should be (uint16_t) instead of (int16_t)..
not the issue, just saying..

sorry.. ~q

I fixed the writing error, but it's still the same, I'll try to connect to an external source

leave the moist on broadcast until you start seeing a response..

should be working..

~q

I'm still testing the power supply via USB, I'm only testing the moisture, it started to show different results, but 0 bytes revcd
image

and the sensor is in a glass of water

still no bytes received, means no response..
check your connections..
did you try flipping A and B??

this is where a usb 485 dongle for your pc is priceless..

~q

1 Like

I will buy the usb 485, do you know any model?

really shouldn't matter..
look for something with a FTDI chip in it..
maybe something like..
DTech USB 485 Adapater..

i've used these successfully before too..
RS485 Adapter Module Arduino..

~q

The Vcc to Vin connection looks strange. Vin is an input pin, not an output. What, or if, that controller provides anything there is beyond my knowledge.

I'm from Brazil, I wouldn't like to import. I have these options that would arrive in 2 days:

or

https://www.google.com.br/shopping/product/1?q=usb+485&client=safari&sca_esv=592286207&hl=pt-br&biw=414&bih=715&tbs=vw:l&prmd=sivbnmtz&prds=num:1,of:1,eto:1370473908579156926_0,prmr:1,rsk:LO_1370473908579156926,pid:1370473908579156926,cs:1&sa=X&ved=0ahUKEwjd-cf2oZyDAxVNq5UCHZ8YAkgQgjYI8Ak

like i said, really shouldn't matter..
first link looks fine, second, wont open..

you know, always thinking..
last one i help with baud rate was at 4800, might want to try different bauds..

~q

never worked with a NodeMcu before..
here's a nice write up on them..
and like i was first thinking it's a 3.3v device, its IO pins won't tolerate 5v.

watched that a vid quite a few times, i don't see link to the adapter but i do read in the comments someone asking about it like i am with no answer..

the one i linked too does 3.3 or 5, make sure your screen is 3.3v compatible too..
if you're making the exact as vid or everything has to be level shifted..
i hope im wrong but i don't think i am..

~q

It's a quack device, it is impossible for a device that just has five metal prongs to what it claims to be doing. Don't waste more time and definitely not more money on it - it's utter and entire BS what they're pretending to measure.

I've seen this very device come by several times on this forum over the past few weeks. If you want to know why this is device is quack, please do a quick search and read those threads. Not going to explain it again.

Really sorry to hear that they found yet another victim in you... My dead serious recommendation: if possible, return it to the seller and claim your money back.

@antoniobt123 I think one of your issues may be related to your choice of RS485 transceiver module.

@qubits-us queried this way back in post #2.

I'm not familiar with NodeMCU other than it's a 3.3V device.

Where have you connected the VCC on the RS485
module to? Is it to a 5V supply pin on that expansion module, or a 3.3V supply pin?

O rs485, está conectado na placa expansora do nodemcu, no 5v

It's literally the same as this video:

After switching to Youtube to watch the above video (big mistake - I had to sit through nearly 3min of mindless adverts without the option to skip any of them), the author shows this image:

The main problem I see here is that the RS485 module is powered from 5V, which means that the RO signal will also be between 0V and 5V. Is your NodeMCU a 5V tolerant device? If it isn't, then you might well damage it by connecting RO as shown in the video.

You could use a couple of resistors as a potential divider to bring the 5V down to 3.3V.


I bought and installed the usb adapter, could you help me?

Ok, so your sensor is responding to modbus requests.

The screenshot shows that your sensor address is 02. Does the PC software have the facility to change that address to 01?

If it doesn't, then you will need to recalculate the CRC16 checksums for the canned modbus messages.

You also need to change the baud rate of your modbus serial channel to 4800 baud.

When I try to change it to 01 it goes back to 02.
How do I recalculate?