So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By empereuri
#72316 Hi all! newbe here.... Project on nodemcu v3
I would need to build a capacitor meter ta can read capacitor between 10pF and 100pF
I started the project with an arduino, and it was quite simple, just plug in A0 and A2 fill the code and ta dam! (see third exemple in link)
but obviously, only on A0 on nodemcu. I tryed method 1 but the capacitor is way to small so it does not work. Solution #2 seem to have some specific code working only on arduino (and anyway, would measure in the range of nF) http://www.circuitbasics.com/how-to-mak ... nce-meter/

So... do you have any idea of how I could do on the nodemcu?? I used google, but no specific solution and for arduino all seem to use specific pin on arduino so I don't think they are exportable...

My project as a whole is for a (REALLY) cheap automatic watering system. The nodemcu mesure capacitance on a probe (build with aluminium can to do a capacitor) when the capacitance drop, it activate a servo motor to open a valve on a gravity drive tube to water the plant. I switch to nodemcu to log the data from the probe.

Any help much much apreciated! :mrgreen:
User avatar
By empereuri
#72366
empereuri wrote:Hi all! newbe here.... Project on nodemcu v3
I started the project with an arduino, and it was quite simple, just plug in A0 and A2 fill the code and ta dam! (see third exemple in link)
but obviously, only on A0 on nodemcu. :mrgreen:

So i went i little bit farter on the theory of the simple methode, and it seem you only need onI e Analog pin, the other one just need to be a constant Voltage... so i did simply plug capacitor betwen v3.3 and A0 and look at the reading... they actually change went i change de capcitor... but it does not make any sens... for 100pF the mean reading was like 3,5 for 100nF it was 6,8 for no capacitor it was 5,2 and for my probe (around 20pF as tester on arduino) it was around 10 (or 20 when in water) I have no clue as to what to do with those result...
Any way to port the simple simple capitor meter A0-A2 to nodemcu?

The other way I went, building an oscillator with capacitor and resistor and then extrapolating with the frequency. i built it on arduino and it worked, now I need to port it to the 3,3V nodemecu but once i got it working.... How can you mesure reliably a frequency with nodemcu? I saw the pulseIN fonction but it seem to be really flaky... any other way? To mesure a difference of maybe 30pF (10-20 to 50-60) would i need a more precise method?

(her a pictor of the oscillator, i did not had the Mosfet schmitt inverter, so i build one with transistor!)
You do not have the required permissions to view the files attached to this post.
User avatar
By empereuri
#72367 So finally found a sollution base on the simple arduino one... The stray capacitance of the nodemcu is way to low, so i just need to ad a capacitor (I put a 100pF) betwen A0 and ground, then put mi TESTcapacitor between A0 and D4 and thats it! I still need to calibrate (but not really since all i need is the change) but so far, if put in paralle the reading divide by two and in serie they ad up.
it dosent seem to be really stable, but if i take en average over a few value should be way sufficient!

So thanks to the person who read my post...

and just a comment to the host on the Forum... needing approval for every post is a bit of a killer no?(especially when it take more then 12h) I was wondering reading the other post why everybody was solving the problem themselves... now I know!
User avatar
By Magin
#72475 Very interesing! I'm making a watering system too. The resistive method is not working very well and I was searching for capacitive methods. The first result for "esp as capacitance meter" was this post.

I'm using a naked ESP12F as its smaller and easier to put in the solar garden lamp I plan to use, so i will see if I can adapt this method. The NodeMCU has a voltage divider in A0 with 2 resistances of about 200k if i remember well, it does not affect your readings?