Shop OBEX P1 Docs P2 Docs Learn Events
Can the Basic Stamp process an AC input signal? — Parallax Forums

Can the Basic Stamp process an AC input signal?

SydSyd Posts: 13
edited 2011-11-06 16:14 in General Discussion
Hi Everyone,
From the basic stamp FAQ, it appears that there are some techniques to accept input analog signals. I am currently attempting to use the basic stamp to determine the frequency of an AC input signal. Does the basic stamp provide any mechanism to handle AC (analog) input signals? Or must I convert the analog signal to digital and then input this signal to the basic stamp? Thanks.

Cheers!
Syd

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-06 14:01
    What's the peak-to-peak voltage of the signal?

    -Phil
  • SydSyd Posts: 13
    edited 2011-11-06 14:09
    10V perhaps? Is there a particular "peak-to-peak" voltage that the basic stamp accepts (BTW, the basic stamp model is BS2pe)? In any case, I can always use a voltage divider to reduce the voltage.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2011-11-06 15:53
    A circuit that turns the AC into a square wave could do the trick to extract the frequency. With 10 V amplitude, there is plenty to drive a transistor across its 0.6V threshold. In the following, the value of R1 could be anywhere from 10kΩ to 50kΩ. The transistor a 2N3904. The capacitor is optional, and is a small value like 100pF to 0.001 µF and it helps if there is noise riding on the AC waveform.


    xistor.png
    297 x 236 - 7K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-06 16:03
    Here's the circuit I had in mind, before I saw Tracy's (which uses fewer components):

    attachment.php?attachmentid=86639&d=1320624080

    The diodes act as clamps, and the voltage divider biases the cap at the Stamp's logic threshold (1.4V).

    I think I like Tracy's circuit better.

    -Phil
    427 x 253 - 2K
  • SydSyd Posts: 13
    edited 2011-11-06 16:14
    Thanks a million! I will give it a try and report back. :)
Sign In or Register to comment.