Shop OBEX P1 Docs P2 Docs Learn Events
Trigger input to Basic Stamp — Parallax Forums

Trigger input to Basic Stamp

prprogprprog Posts: 18
edited 2005-10-17 16:06 in BASIC Stamp
Hi:

I was searching the web on stamp circuits and found the following circuit to interface a piezo sensor. I have interface switches to BS2 , but which command do I used to interface to this circuit?
383 x 161 - 1K

Comments

  • TiboTibo Posts: 81
    edited 2005-10-12 21:57
    I'm interested to a answer too since I use the a modified cybot kit which contains two pairs of piezo emitters and receiver...
    Good question : [noparse];)[/noparse]
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-12 21:59
    It would help to know the specifications of the device.· Do you have a link to a datasheet?· What type of signal does the device output?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • prprogprprog Posts: 18
    edited 2005-10-13 16:37
    In my case the piezo will be struck (for a drum/percussion) controller. I guest the signal will be the voltage (??) generate by the piezo when hit.·Which command (BS2) do I used to read the voltage generated? Is this circuit (as is) suitable for this application?

    Thanks
  • BeanBean Posts: 8,129
    edited 2005-10-13 16:39
    You probably will need a zener diode to limit the voltage created by a piezo element.
    Check out the docs for the Parallax piezo element.
    http://www.parallax.com/detail.asp?product_id=605-00004
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    "Save your money. Pay with cash."
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-13 16:54
    Bean is correct, depending on the voltage levels output by the device you may need a Zener Diode, however, if there is an existing application using this, then I assume it's okay to work the way it's listed.· In any event, you should probably be just looking for a 1 on the input, according to the schematic you provided.

    IF IN0 = 1 THEN ...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • prprogprprog Posts: 18
    edited 2005-10-13 17:17
    Thanks a lot for the information. You all answer my question on the BS2 command to used (this is what makes this forum that great)....but as usual it raise another-> How do I know (without damaging the BS2) that the first circuit (the one I originally post) its OK ? (my guest is that I can add the zener diode to the original circuit and if nothing happens it indicate that the voltage is not enough for the BS2 to detect... on the other hand the zener diode will limit the voltage to no more than ~5 volts [noparse][[/noparse]is this statement correct?].
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-13 17:43
    The Zener Diode we have posted on the page that Bean mentioned will effectively limit the input voltage to 5.1 volts, but it may not be needed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • TiboTibo Posts: 81
    edited 2005-10-15 15:07
    Can it be a ultrasonic transducer like this one ?
    Ultrasonic.jpg

    I got 1 pair of emitters and 1 of receivers but I've no idea of how to use them wiht the BS2...and since they come from a hacked robot kit : cybot
    cyball-04.gif

    Thank for your help !
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-15 17:36
    If you look through our old app notes (see the downloads section on www.parallax.com) you'll find a BS1-based project that uses sensors like that -- it should give you some ideas.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TiboTibo Posts: 81
    edited 2005-10-16 15:08
    Thank you Jon.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-10-16 15:56
    Is the piezo sensor a thin piece of film that has a couple of wires or electrodes coming out at one end? If so, the voltage pulse output will be fast. I was suprised by the 4.7k and 1.5 kohm resistors shown in your schematic. If it is one of the film type sensors, the amount of charge produced by the film is quite small for each event. If that is the case you can connect the film directly to the Stamp pin via the 4.7k ohm resistor, and I would replace the 1.5kohm resistor with a much much higher value like 1 megaohm or 10 megaohm to drain off charge for the next event.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • TiboTibo Posts: 81
    edited 2005-10-16 21:10
    Thank you Tracy : the component are really small. I'm not sure of what I see in it but i'll try to shoot it tomorrow so you can have a look.
    ++
  • prprogprprog Posts: 18
    edited 2005-10-17 12:35
    Tracy:

    The piezo is one those discs generally used for generating buzzing sounds. it also can be used for generating voltages when hit. What I don't get is that on some sources (web pages) the piezo output is amplified ..but on other they recommend that since it can generate a high voltage it must be attenuated. (???). I guest the circuit I posted (piezocircuit.gif) reduce the signal. In previous prototype circuits I had found very difficult to handle the signal/event generate by the piezo disc. I read the voltage with an ADC ->Stamp and sometimes the voltage reading does not relate to the "hit event" . I will experiement with your recomendation about the 1meg resistor. Thanks.
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-10-17 16:06
    prprog,

    In another life, for fun I was an "electronics rodie" for a local band/friend that I new.·

    As indicated in an earlier post, the pulses generated from a piezo are very quick and can be missed easily.
    Here is a circuit that I have used that uses a current mirror to grab and store the signal very quickly.
    A quick and dirty "sample and hold" if you will.· The Idea is for the Stamp to monitor the "Discharge" signal
    as an INPUT.· When the "Discharge" signal goes HIGH, then the "Piezo hit value"·is ready and can be read
    with an ADC off of the "ADC Signal".· Once the "ADC Signal" has been read,·make the "Discharge" signal
    an OUTPUT and LOW, to discharge the .047uF capacitor.· Next, make the·"Discharge" signal an INPUT and
    wait for the next·"Piezo hit value".


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    1015 x 579 - 46K
Sign In or Register to comment.