Shop OBEX P1 Docs P2 Docs Learn Events
is this possible? (input reading using i/o pin) — Parallax Forums

is this possible? (input reading using i/o pin)

amotanisamotanis Posts: 2
edited 2004-11-16 05:51 in Learn with BlocklyProp
for my project i need to read the voltage from a circuit using the I/O pins.· Is this possible ?· from what i'm reading the RCTIME may be useful.. could someone explain this code for me ?· If the voltage reading wouldnt be accurate;· How can i get the i/o pin to get a high or low read from a device?

i'm very new. thanks
'

Post Edited (amotanis) : 11/14/2004 4:15:56 AM GMT

Comments

  • dandreaedandreae Posts: 1,375
    edited 2004-11-14 22:08
    Hello,

    The RCTIME command measures the time it takes to charge and discharge a capacitor using a resistor and a capacitor circuit.· If you are trying to measure a voltage with an I/O pin, you'll first need to know the range of voltage that you working with.· The reason why, is due to·the fact that the BS2's I/O pins are TTL logic or 0 to 5 volts.· If you are using larger voltages you will need to use a voltage divider circuit in order to bring the voltages down to a TTL level.· The BS2 reads a high as 1.4v to 5v and a low as 0v to 1.4v.·

    You can do a search on www.google.com for a voltage divider circuit.

    Dave




    Post Edited By Moderator (Aristides Alvarez) : 11/15/2004 1:11:05 AM GMT
  • edited 2004-11-15 00:05
    The original post said something about reading current. RCTIME is used to measure voltage decay times, but it can also be used with sensor circuits that pass more or less current when they sense more or less of whatever it is they sense. In some cases, current flow has to be monitored without interrupting the circuit. The thing about RCTIME is it usually takes full control of the sensor circuit. If you need to measure current in a circuit but cannot control it with the BASIC Stamp, there are other methods that involve small resistors and A/D converters.

    If you can let us know more about the circuit and your objectives, we can probably refer you to a Stamps in Class text or article that will get you started.

    Since this is new to you, consider reading and/or trying the experiments in the What's a Microcontroller text. That should get you up to speed pretty quickly. It's available for free download from www.parallax.com -> Downloads -> Stamps in Class Tutorials.
  • amotanisamotanis Posts: 2
    edited 2004-11-16 01:07
    this is my intention.· a wheel with 5 numbers on it each will have their own circuit.· (like wheel of fortune, sorta).· When the wheel stops i need to have the stamp be able to differentiate between the 5 numbers on the wheel and from there the program will match it up to a slection on a differnt wheel.· thats the idea, i dont see this working out by its deadline but we'll see.· Thanks for the responses I will check out the parrallax articles you refered. Thanks.

    *if a solution comes to either of you let me know.
  • edited 2004-11-16 05:51
    I would just put some black and white stripes on the back of the wheel (or the outside edge) and either use photoresistors or QTIs to read them.· With three stripes, you can detect eight different combinations of black/white.· WWW, WWB, WBW, WBB, BWW, BWB, BBW, or BBB.·

    What's a Microcontroller Chapter 7, Activity 1 shows an example using a single photoresistor.· It's not difficult to expand that to an array of three.

    Here also is a link to the QTI documentation:

    http://www.parallax.com/detail.asp?product_id=28108
Sign In or Register to comment.