A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By anana1
#78639 Hi!

First of all, I've been googling all around to find a good solution but it either requires lots of electronics knowledge (which I don't have) or other hardware.

Now, my question is how to connect moisture sensor (that operates on 5V) to A0 on NodeMCU with Arduino core (which is suitable for input ranging 0-1V)?
I've been looking into this ADC but can't seem to grasp how that would work or if it even would. To me, this seems like a good idea because digital pins operate on 3.3V.

Also I've read that moisture sensor like this requires high impedance and therefore its source needs to be from Arduino. Because of this, I wonder is it even possible to power this sensor from a universal power supply AC-DC adapter for it to work properly for a long time? I've tried this and it gives me max 3.7V out when sensor is fully covered in water.

As you can see, my electronics knowledge is seriously lacking so some tips where to start would be nice. Also, can you please give me some advice on how to connect it or tell me what I'm not understanding properly?

Thanks,
Ana
User avatar
By Bonzo
#78641 You can use a voltage divider: https://learn.sparkfun.com/tutorials/vo ... viders/all. Whatever ratio you reduce the voltage to you then need to multiply the output in your code.
I had to this at work a while ago to reduce a 10V signal to less than 5V for an Arduino - I took it down to 4.7 to be on the safe side. The electronics bods at work recommended I then used an amplifier for some reason I can not remember why now!

I also used 1% resistors as they were not a lot more expensive and I am not sure if it was required.
User avatar
By btidey
#78654 Most of those resistive mosture sensors will work fine on a 3.3V supply.

The analogue output can go up to Vcc (i.e. 3.3V) so you would need a 3.3:1 resistive divider if going into the AO pin. You can use fairly high resistors (100K -> 1M) as A0 is high impedance.

Note that some boards like NodeMCU already have a 200K:100K divider built in so you can connect straight on to the external pin.
User avatar
By anana1
#78655
btidey wrote:Most of those resistive mosture sensors will work fine on a 3.3V supply.

The analogue output can go up to Vcc (i.e. 3.3V) so you would need a 3.3:1 resistive divider if going into the AO pin. You can use fairly high resistors (100K -> 1M) as A0 is high impedance.

Note that some boards like NodeMCU already have a 200K:100K divider built in so you can connect straight on to the external pin.


Thank you for answer. I will do that