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

Analog Input help...


  • Please log in to reply
25 replies to this topic

#1 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 08 November 2010 - 08:26 PM

Hello, I want to use the analog input pins but I don't know how it works ! I'm a newbie in electronics....some documentation on Netduino analog input ? Thanks, Paolo

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?


#2 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 08 November 2010 - 09:19 PM

Hello,
I want to use the analog input pins but I don't know how it works ! I'm a newbie in electronics....some documentation on Netduino analog input ?

Thanks,
Paolo


Hello! I plan on making a tutorial on that this weekend. If you need help right away, I'll be glad to help you. What kind of analog sensor are you using? A link if you have one, would be helpful.

#3 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 08 November 2010 - 09:21 PM

Hello! I plan on making a tutorial on that this weekend. If you need help right away, I'll be glad to help you. What kind of analog sensor are you using? A link if you have one, would be helpful.


I'm using temperature sensor LM335Z (http://www.national....f/LM/LM335.html) but I don't know how connect it to Netduino.
Thanks,
Paolo

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?


#4 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 08 November 2010 - 09:34 PM

I'm using temperature sensor LM335Z (http://www.national....f/LM/LM335.html) but I don't know how connect it to Netduino.
Thanks,
Paolo


So I looked around and it looks like you are using this: http://www.sparkfun....roducts_id=9438 . am I correct?

Also how quickly do you need this? Because I can order one and use it for my video tutorial on Friday. I myself have to mess around a little until I understand how to use it, and without one of those on me it is hard to know how to use it.

#5 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 08 November 2010 - 10:03 PM

So I looked around and it looks like you are using this: http://www.sparkfun....roducts_id=9438 . am I correct?

Also how quickly do you need this? Because I can order one and use it for my video tutorial on Friday. I myself have to mess around a little until I understand how to use it, and without one of those on me it is hard to know how to use it.


Yes you are correct !
But can you give me some general information on Netduino analog input...how it works, what is aref...etc etc...
Thanks,
Paolo

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?


#6 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 08 November 2010 - 10:14 PM

The analog input pins basically work by returning a value between 0-1023 based on the voltage that is on the pin, relative to aref. Aref is the "analog reference" and sets the "ceiling". Typically you'd tie aref to 3.3v - which is it's maximum. Then, if you put 3.3v on the analog pin, you would get a reading of 1023. If you tied the analog input to ground, you'd get a reading of 0v. if you put 1.6v on the analog input, you'd get a reading around 512, or half the range. The analog inputs can handle a max of 3.3v.

Here's a link to some sample code:
analog sample code

In that code, there's a line:
AP0.SetRange(0, 1023);

This is the default, so it effectively doesn't do anything at all; but, if you do:

AP0.SetRange(0, 3300);

...your readings will match roughly with the actual voltage in millivolts. So, if you put 1.6v on the input, you'll get a reading around 1600 instead of 512.

Hopefully this makes sense?

#7 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 08 November 2010 - 10:55 PM

Hello again I suggest using this image (http://www.sparkfun....-sheet-SPAR.pdf) as a guide. If I get one of those sensors, then I'll post a tutorial.

#8 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 08 November 2010 - 11:19 PM

Oz: Are you sure that diagram is right? It doesn't quite make sense to me. Maybe talk me through it? Why isn't aref tied to the 3.3v line?

#9 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 08 November 2010 - 11:32 PM

Oz: Are you sure that diagram is right? It doesn't quite make sense to me. Maybe talk me through it? Why isn't aref tied to the 3.3v line?


I had it before, and it was quite the head scratcher... but if your sensor is getting X voltage after the 3V3 goes through a resistor... wouldn't you want the aref to recognize X voltage as the max? I may be wrong on that, but it makes sense [to me at least]

#10 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 08 November 2010 - 11:39 PM

I don't think it works that way, but I really don't know. Why do you have the analog input tied to the adj pin?

#11 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 08 November 2010 - 11:45 PM

I don't think it works that way, but I really don't know. Why do you have the analog input tied to the adj pin?


You know what... I think I'll take back my schematic... I completely messed that up. I was in a hurry to help, but that didn't do any good. Maybe I'll get one of those soon and figure it out, maybe post a tutorial.

#12 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 09 November 2010 - 05:13 PM

You know what... I think I'll take back my schematic... I completely messed that up. I was in a hurry to help, but that didn't do any good. Maybe I'll get one of those soon and figure it out, maybe post a tutorial.


I have connected pin + to a 2,2 K Resistor and then to +5V. The pin - to ground.
With a multimetere, I read abouta 4,88 V on pin +. This voltage isn't too big for Netduino analog input ?

Thanks,
Paolo

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?


#13 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 09 November 2010 - 06:04 PM

The analog input only supports 3.3v -- but if I'm reading this right, a reading of 4.88v equates to 488K, which is 419F, which is 215C ... so unless your house is on fire, something else is wrong.

#14 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 09 November 2010 - 06:07 PM

The analog input only supports 3.3v -- but if I'm reading this right, a reading of 4.88v equates to 488K, which is 419F, which is 215C ... so unless your house is on fire, something else is wrong.


Where am I wrong ? I have connected wrong the pins ?
Paolo.

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?


#15 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 09 November 2010 - 06:15 PM

I'm sorry, I don't know. According to this picture:

Posted Image

If your room is 72 degrees F, which is 295 degrees K, you should have a reading of about 2.95V, I think.

When you're measuring with the multimeter, is the netduino involved in the circuit at all? I would start with the netduino out of the picture entirely a focus on getting the right readings on a multimeter, then focus on getting them well below 3.3V to be safe for the analog inputs.

#16 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 09 November 2010 - 06:29 PM

I'm sorry, I don't know. According to this picture:

Posted Image

If your room is 72 degrees F, which is 295 degrees K, you should have a reading of about 2.95V, I think.

When you're measuring with the multimeter, is the netduino involved in the circuit at all? I would start with the netduino out of the picture entirely a focus on getting the right readings on a multimeter, then focus on getting them well below 3.3V to be safe for the analog inputs.


I use 5V Netduion board to put V+...

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?


#17 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 09 November 2010 - 06:32 PM

Yeah, I don't know then -- using the 5v should be fine. Can you post a picture or a diagram or something? I wish I had one of those sensors to try it out myself.

#18 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 09 November 2010 - 07:01 PM

Yeah, I don't know then -- using the 5v should be fine. Can you post a picture or a diagram or something? I wish I had one of those sensors to try it out myself.


I have some difficults to post a diagram but following the connections :

LM335 - pin+ --> Resistor 2,2K --> 5 V Netduino board
|
|-------------------> Analog Input Netduino board

LM335 - pin- --> Ground Netduino board

Thanks,
Paolo

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?


#19 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 09 November 2010 - 07:31 PM

ok i think I got this right -- i believe the right most pin is the - and the center pin is the +:

Posted Image

Is that about what you're doing, with the multimeter/analog input hooked up after the resistor?

#20 Paolo Patierno

Paolo Patierno

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationItaly

Posted 09 November 2010 - 07:50 PM

ok i think I got this right -- i believe the right most pin is the - and the center pin is the +:

Posted Image

Is that about what you're doing, with the multimeter/analog input hooked up after the resistor?


Yes the circuit is right...I put the multimeter on LM335 middle pin like the schema you have posted in the previous post.
Paolo.

Paolo Patierno

Microsoft MVP on Windows Embedded & IoT

Azure Advisor

Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

Blog : Embedded101
?





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.