Shop OBEX P1 Docs P2 Docs Learn Events
Listening to an operational amplifier — Parallax Forums

Listening to an operational amplifier

simon2simon2 Posts: 10
edited 2006-09-28 06:01 in BASIC Stamp
I have a BS2p40 and I would like to save analog data coming from the amplifier
I was told that I just solder one of my general purpose pins to the output of the amplifier and with:
DO DEBUG ?IN3
LOOP

I could get the one's and zero's coming from the amplifier; later I could transform my code to be able to store data
My problem is that nothing happens, it's as if my pin was left floating ...
My question is is there any special command in Basic to use?
Is there a specific way to connect the amplifier with my Basic Stamp?
Thank You

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-28 05:20
    The BS2p40 like most microcontrollers has digital inputs. When an input pin is connected to a voltage above some fixed threshold (determined by the construction of the input circuitry), the microcontroller sees that input as a one. Below that threshold, the microcontroller sees a zero. This threshold could be 2V, sometimes it's 0.6V, sometimes it's 1/2 of the power supply voltage, depends on the device specification. Near the threshold, some inputs can become unstable although some are specifically designed as Schmitt triggers which have some hysteresis and won't oscillate at their threshold. In any event, if your operational amplifier output moves above and below the BS2p40 threshold fairly quickly, you can use the BS2p40 to sense a HIGH or LOW relative to the threshold. That's not the same as saving the analog data.

    If you really want to save analog data, you need an analog to digital converter which converts an input voltage to a number in binary which can be read by the BS2p40. If you download and read the Stamps in Class book on Basic Analog and Digital and the Nuts and Volts articles on analog to digital conversion, you can learn how to do this. All of these references are on the Parallax website.
  • simon2simon2 Posts: 10
    edited 2006-09-28 06:01
    thank you
Sign In or Register to comment.