Shop OBEX P1 Docs P2 Docs Learn Events
Analog I/O with Spinneret? — Parallax Forums

Analog I/O with Spinneret?

cwegercweger Posts: 4
edited 2011-01-18 13:17 in Accessories
Hi all,
I'm brand new to Spinneret and to Parallax products, so pardon me if the answer to this question is obvious and I just haven't searched correctly.

In my reading of the documentation, the Spinneret board seems to me to be very limited in terms of I/O. Specifically, I'm looking for analog I/O capabilities (sensor measurement, device control, etc.). I see that Parallax sells a "Digital I/O Board Kit" (product ID 27113). Is this something that could "easily" (i.e. libraries already exist or are trivial) be connected to the Spinneret?

If not, how would you suggest dealing with multiple (just a few, not dozens) of analog I/O channels?

Thanks!
-Chuck

Edit: spoke too soon; just found the MCP3204 chip, which looks good. Not being a Hardware Guy, is there an example somewhere of how to interface this chip to the available pins on a Spinneret? Also, forget the part about the "Digital I/O Board Kit" above; turns out that "digital" really means "digital" in this case. As usual, I am an idiot.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-17 12:42
    Parallax's Proto-DB prototyping daughterboard provides a handy way to add circuitry to the Spinneret. The ADC12130 provides four channels of 12-bit analog input and would be a nice match for the Proto-DB and Spinneret.

    -Phil
  • cwegercweger Posts: 4
    edited 2011-01-17 13:00
    Thanks for the quick response, Phil. I see the ADC12130 goes for $8.58 at Digi-Key, while the MCP3204 is only $4.73 (if ordered from Parallax; less if you get it from Digi-Key or elsewhere). Is there some reason you suggest the ADC12130 over the MCP3204?

    Thanks,
    Chuck
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-17 13:30
    The ADC12130 was the first thing that came up in my DigiKey search. I'd definitely go with the Microchip part instead.

    -Phil
  • th3jesterth3jester Posts: 81
    edited 2011-01-18 08:01
    If its a resistive analog signal, then you could use the RC-DECAY capabilities. One pin and a capacitor per analog signal (you can find examples in the Propeller Manual/Documents). I'm not sure if its as accurate as the common ADC IC though.
  • zoopydogsitzoopydogsit Posts: 174
    edited 2011-01-18 10:43
    The code for RC Decay is very very simple. Attached is an object I use called RCLITE, a very simple implementation to read voltages, though it is not fast and is non-linear. I use it for simple things like measuring temperature (using a PTC thermister) or change in the amount of light.

    Let me know if you need examples on calling it.

    RClite.spin
  • sstandfastsstandfast Posts: 39
    edited 2011-01-18 12:14
    @zoopydogsit - It should be noted that the resistance of whatever you are measuring needs to be orders of magnitude greater than the 240 ohm known resistance in order for this setup to be accurate. If R is close in value to the 240 ohm resistor you show, then you will be too close to the 1/2Vcc logic threshold of the Propeller and it will read as a 0 counts. So the 240 ohm resistor sets the minimum resistance value you can accurately measure. If you have a 100 ohm RTD, this will not work. A 10K pot will be just fine.
  • zoopydogsitzoopydogsit Posts: 174
    edited 2011-01-18 13:17
    @sstandfast, thanks for the feedback, I'll add it to the notes.
Sign In or Register to comment.