Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Strange AnalogInput readings


  • Please log in to reply
8 replies to this topic

#1 geodrummer55

geodrummer55

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 June 2013 - 01:04 PM

Hi,

 

I am trying to measure moisture content by creating an open circuit between 3.3V line and an Analog Pin - the idea being that the moisture content of the surface each side of the open circuit will cause a connection and a resistance can be calculated from the voltage measured. However I get a permanent reading of 3.3V from the AnalogInput.

 

Voltage across analog pin and ground is ~3.79V, voltage across 3.3V and ground is 3.3V - i'm unsure where that ~0.49V comes from.

 

Any help in getting proper voltage readings from this, or pointing out where I've gone wrong would be very much appreciated!

 

Thanks,

 

George



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 20 June 2013 - 07:42 PM

So basically, you leave the analogue input pin floating "in the rain" - I suppose that is bound to produce strange results. I once created kind of a "human body proximity sensor" consisting of 8 floating digital inputs and they all triggered when I held my hand about two inches away. I guess, in a moist environment the effect would be even stronger. I suppose you could try using a really weak pull-down resistor of several Mega Ohms but perhaps it would be better to use an actual humidity sensor?

#3 geodrummer55

geodrummer55

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 June 2013 - 09:58 PM

I guess so, I am confused why there is a voltage of ~0.49V across what is essentially a broken wire though - the ends are very separated at the minute!

 

Hmm, sounds like an interesting one, well that is the idea, is that the moisture content affects the resistance.

 

I will try pull down resistors and see how that goes, thanks. I could possibly get actual humidity sensors, but the hardware for this project is not defined by me unfortunately, so i need to try to get this to work if possible.



#4 geodrummer55

geodrummer55

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 June 2013 - 10:06 PM

I get a constant reading of 3.3V from the AnalogInput, whether the two free ends are connected or not, adding in a pull down resistor did not affect the reading.



#5 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 20 June 2013 - 10:41 PM

doesent sound good. have you ever added 5v to the analog inputs? that would have damaged it.

with a pulldown it shows 0.0v normally.



#6 geodrummer55

geodrummer55

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 June 2013 - 10:43 PM

I have not put 5V across the Analog inputs intentionally.

 

So I think I have some info on my issue - based on this thread http://forums.netdui...og-input-quirk/ (post #3) if any of the analog pins is fed over 3.3V it can cause strange readings on all pins. I am using an Adafruit Logging Shield (http://learn.adafrui...shield/overview) which has an onboard Real Time Clock I2C device, which uses analog pins 4 and 5. Disabling it causes me to get readings that are fairly sensible from the moisture sensors. So it appears that the RTC is drawing more than 3.3V - I need the RTC so I can't keep it disabled, is there a way to force it to use 3.3V?

 

Thanks



#7 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 20 June 2013 - 11:52 PM

You could try removing R1 and R2 on the shield, those are 2k2 I2C pull-up resistors to 5V. After removing them, add your own pull-ups to 3.3V externally. That should work as long as the RTC considers 3.3V as logic high, which I think it does but check the d/s first. Be careful desoldering R1 and R2 not lifting the pads in case you want to put them back in future. If you know you will never use R1 and R2, just take a sharp knife and cut the traces instead of desoldering.

#8 geodrummer55

geodrummer55

    New Member

  • Members
  • Pip
  • 7 posts

Posted 23 June 2013 - 04:18 PM

So it turns out that when I actually wire up the pull down resistors sensibly, they do indeed work.

I was reluctant to start pulling apart the hardware as its not mine, and after much prodding and poking I realised that my resistors were in the completelly wrong place.

 

Thanks for your help everybody :)



#9 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 23 June 2013 - 09:44 PM

So you mean the pull-down I suggested for the open analogue pin was the one thing that helped?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.