Miceuz / soil-moisture-sensor-analog

Analog soil moisture sensor
Apache License 2.0
14 stars 3 forks source link

Some minor Q's #1

Open tj000b opened 9 years ago

tj000b commented 9 years ago

Hello Miceuz

I am looking at your wonderful project analog project because I would like to avoid the AtTiny which is on the chirp sensor I already own.

Looking through the BOM list i am confused about resistor values for R2, R4, R9 and R10. Maybe you could shed some light on this?

Also i figure that "OUT" is an analog voltage between 0 and VCC(?) somehow proportional to soil moisture content, right?

Also what is the lower limiting factor for operation voltage, if its the LM324 with its 3V minimum then maybe if I swap it for i.e. a LMV324M (min voltage 2.7V) then i might be able to get readings supplying only 2.75V?

I know its alot of questions, I hop you will find time to reply :)

Miceuz commented 9 years ago

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Hi!

R2 might be needed, might be not, depends on how successful is the oscillator to start and how much ringing does it produce. Note that resistor is marked zero ohms for now, it's just a place-holder.

R4 will have to be selected by experimentation. It depends on frequency and capacitance of sensor track. This is a new board I'm still waiting from PCB house, so I don't know the value yet.

R9, R10, R11, R12 should be high tolerance resistors of the same value. Something like 10k should work.

Yes, OUT is a voltage proportional to soil moisture. Regarding the operating voltage, frankly I didn't give much thought to it. There are two active devices - LMV324 and NC7WZU04. NC7WZU04 works down to 1.65V but it's not clear if the oscillator will start properly (it should, but "don't assume anything") then it's the main opamp, so basically you might be right. Note, that you can replace LMV324 to any quad opamp of better performance if you want, LMV324 is selscted as the best from the worst for low price point.

Good luck and let me know how it goes, I should get the boards in couple of weeks and try them myself.

On 03/11/2015 04:27 PM, tj000b wrote:

Hello Miceuz

I am looking at your wonderful project analog project because I would like to avoid the AtTiny which is on the chirp sensor I already own.

Looking through the BOM list i am confused about resistor values for R2, R4, R9 and R10. Maybe you could shed some light on this?

Also i figure that "OUT" is an analog voltage between 0 and VCC(?) somehow proportional to soil moisture content, right?

Also what is the lower limiting factor for operation voltage, if its the LM324 with its 3V minimum then maybe if I swap it for i.e. a LMV324M (min voltage 2.7V) then i might be able to get readings supplying only 2.75V?

I know its alot of questions, I hop you will find time to reply :)

— Reply to this email directly or view it on GitHub https://github.com/Miceuz/soil-moisture-sensor-analog/issues/1.


Albertas Mickėnas

http://technariumas.lt http://wemakethings.net https://www.tindie.com/stores/miceuz/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1

iEYEARECAAYFAlUAblUACgkQJ2lgtwRRHqEDWQCfZb6bbZyAwroSuSLcCd2873Ef 7nIAnjgZ4WeUpYGtEUdiOXAVQuk4lkdR =GNpF -----END PGP SIGNATURE-----

tj000b commented 9 years ago

Hi and thanks for the reply. Very useful!! Interesting that you are getting the boards, looking forward to seeing what happens, i am excited to find out if they work properly :). I will report back when i know more about min operating voltage, however unfortunately i think it will be atleast a couple of weeks before i have the hardware ready. For now I will order some more of the i2c versions while working on my concept

tj000b commented 9 years ago

Hi again I am just about to order some of the boards. However i noticed that you have removed the differential opAmp and have replaced the "OUT" with SENSE_HIGH_OUT and SENSE_LOW_OUT.

I am going to use it with a microcontroller. Can you shed some light on how to read and convert SENSE_HIGH_OUT and SENSE_LOW_OUT to soil moisture? And maybe tell why you removed the differential opAmp? :)

Have a nice day!

Miceuz commented 9 years ago

Check the diff amp branch - https://github.com/Miceuz/soil-moisture-sensor-analog/tree/feature-diff-amp the diff amp is back. I was thinking about transmitting differential signal over the wire, but then thought it's a bit awkward.

tj000b commented 9 years ago

Hi Miceuz, thanks for the comment! I know you have a day time job now, but I am glad that you still have your chirp hobby! :D

I was trying to hack one of my v2.5 i2c version of the plant watering alarm today. I wanted to remove the ATTiny and just use pins from another uC (electric imp), running 3.3V. I desoldered the ATTiny and put my 1Mhz PWM pin directly to CLK_OUT and one of my ADC in pins to CAPACITANCE_V.

However my readings are somewhat unsteady doing it like this, so I was wondering if you where doing some signal processing, averaging or something, I am not quite able to fully understand your readADC1 function?

Also I get low ADC values when i put the sensor in water and high when i leave it in free air. Does that make sense? [edit] Ok looks from your code that this is also what you do, but you take 1023-result to reverse it :).

Cheers! tj000b

Miceuz commented 9 years ago

Its not a hobby any more ,)

Hm, its strange you have unstable readings. Maybe high output impedance of excitarion signal? Long wires? Im not doing anything extra to the signal.

Low values in water is normal as capacitance becomes bigger, so square wave is filtered more and peaks are getting lower. Im subtracting from 255 in my original firmware to return bigger number for more water.

On May 7, 2015 9:47:19 PM EEST, tj000b notifications@github.com wrote:

Hi Miceuz, thanks for the comment! I know you have a day time job now, but I am glad that you still have your chirp hobby! :D

I was trying to hack one of my v2.5 i2c version of the plant watering alarm today. I wanted to remove the ATTiny and just use pins from another uC (electric imp), running 3.3V. I desoldered the ATTiny and put my 1Mhz PWM pin directly to CLK_OUT and one of my ADC in pins to CAPACITANCE_V.

However my readings are somewhat unsteady doing it like this, so I was wondering if you where doing some signal processing?

Also I get low ADC values when i put the sensor in water and high when i leave it in free air. Does that make sense?

Cheers! tj000b


Reply to this email directly or view it on GitHub: https://github.com/Miceuz/soil-moisture-sensor-analog/issues/1#issuecomment-99975019

Sent from my Android device with K-9 Mail. Please excuse my brevity.

tj000b commented 9 years ago

Im glad to here you are making some money of this stuff. Its good work! :)

I am not sure about the output impedance of the GPIO pin on my uC. I do however have a few centermeters of wire from pins on my uC to the chirp, so maybe they are screwing things up, acting as antennas or something.

I will draw up and order some PCBs, that way I can see if the long floating wires are the cause of the problem :)

Adjusting dutycyle of the excitation signal also plays a role.

My readings are not all that unsteady, but once in a while a strange one sneaks in: 2015-05-08 10:19:27 UTC+2 [Device] 18276 2015-05-08 10:19:31 UTC+2 [Device] 20485 2015-05-08 10:19:35 UTC+2 [Device] 18116 2015-05-08 10:19:39 UTC+2 [Device] 18148 2015-05-08 10:19:43 UTC+2 [Device] 24918 2015-05-08 10:19:47 UTC+2 [Device] 18164 2015-05-08 10:19:51 UTC+2 [Device] 18308

BTW Do you think reliability or accuracy of readings is best on your analog sensor or the i2c sensor?