Shop OBEX P1 Docs P2 Docs Learn Events
Reading voltage at I/O pin — Parallax Forums

Reading voltage at I/O pin

garylakegarylake Posts: 41
edited 2011-05-12 09:17 in Propeller 1
Is there a way to read the voltage on an input pin?
Say I hooked up a pot to pin 1 that would vary the voltage from 2v-3v to pin 1and as I adjusted the pot it would output to the terminal.

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2010-12-24 11:39
    See the sticky thread "Propeller Education Kit Labs", there you find the PDF document with the same name. Search for "Sigma delta", that's a way to convert analog input to a digital value.
  • wjsteelewjsteele Posts: 697
    edited 2010-12-24 12:00
    Yep... to add to MagIO2s response... the pins on a Prop are digital... on or off... but you can build a real inexpensive A/D converter (the Sigma Delta.) You also can go for a more robust solution with something like an MCP32xx a/d converter. There are several MCP32xx libraries in the Obex. I personally use the MCP3208 library more often than anything else... it's real easy to use and works great. One other thing... to get analog out (like the ntsc/pal video out feature) requires the use of a DAC via simple resistors.

    You can also take a look at the Propeller Backpack (http://www.parallax.com/Store/Microcontrollers/PropellerAccessories/tabid/786/ProductID/602/List/0/Default.aspx?SortField=ProductName,ProductName) for an implementation of the Sigma Delta... becareful implementing your own, however, as they are real sensitive to the distances between the components. In other words, keep the components as close to the pin as possible.

    Bill
  • TappermanTapperman Posts: 319
    edited 2011-01-10 20:47
    MagIO2 wrote: »
    See the sticky thread "Propeller Education Kit Labs", there you find the PDF document with the same name. Search for "Sigma delta", that's a way to convert analog input to a digital value.

    You know ... I've searched and searched and I can not find reference to your citation here? I searched the OBEX and came up empty as well? Where is it? I thought I would try to measure using "Sigma delta" as opposed to my ADC chip. Not all that important, but I sure would appreciate some help finding it here?
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-01-10 22:04
    garylake: The sticky thread to which they refer is the second top post on this forum. It is sticky because it remains there on top of the threads.
  • TappermanTapperman Posts: 319
    edited 2011-01-11 19:28
    Cluso99 wrote: »
    garylake: The sticky thread to which they refer is the second top post on this forum. It is sticky because it remains there on top of the threads.

    Okay ... have you tried to click on the link and then load the PDF in question and search for "sigma delta"? That is what I was refering to. You come up empty? Give it try and see if you get different results than I do?
  • TappermanTapperman Posts: 319
    edited 2011-01-13 20:20
    Cluso99 wrote: »
    garylake: The sticky thread to which they refer is the second top post on this forum. It is sticky because it remains there on top of the threads.

    Okay ... I'll ask again ... have your tried to click on the link and then load the PDF in question and search for "sigma delta"? That is what I was refering to. You come up empty?
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-13 23:40
    Hi Tapperman!

    I'm really sorry for missleading you here. I really thought it's described in the PE Lab, but it's described in the
    AN001-PropellerCountersv1.2 document. There you also find demo code.

    http://www.parallax.com/Portals/0/Downloads/appnt/prop/AN001-PropellerCountersv1.2.zip

    But if you have an ADC-chip, why don't you simply tell which one and we can help you with that as well.
  • zoopydogsitzoopydogsit Posts: 174
    edited 2011-01-14 02:26
    Try this, it's a quick and dirty RCTime I wrote as a general purpose measurement of temperature (using a PTC), Light (LDR), voltage (you'd need to use a resistor divider).

    It's not fully documented, and not linear. but it's simple and easy to use and easy to understand.

    I'm yet to graph out to show the response curve to predict the values.
  • TappermanTapperman Posts: 319
    edited 2011-01-14 13:45
    MagIO2 wrote: »
    Hi Tapperman!


    http://www.parallax.com/Portals/0/Downloads/appnt/prop/AN001-PropellerCountersv1.2.zip

    But if you have an ADC-chip, why don't you simply tell which one and we can help you with that as well.

    Thankyou ever so much!!! I'm sorry if I sounded 'annoyed' ... I just like links to go some where for new users! And that helps a great deal.

    My chip is a 10 bit A/D [MPC3001-I/P]

    http://ww1.microchip.com/downloads/en/DeviceDoc/21293b.pdf

    ... Tim
  • edited 2011-05-12 09:03
    Hi all
    I need to use the chip mcp3208 to convert the analog output of chip opt101 to digital input for the propeller.
    Can you help with a circuit for the converter please?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-12 09:14
    There is an object in the Propeller Object Exchange for using the MCP3208 (here). Look at the comments at the beginning of each of the SPIN source programs for a description of how to connect the MCP3208. You'll also need to look at the datasheet for the MCP3208. There's a link to it on this page.
  • M. K. BorriM. K. Borri Posts: 279
    edited 2011-05-12 09:17
    There are also objects to use the 7705 and 7706 analog input chips.
Sign In or Register to comment.