Shop OBEX P1 Docs P2 Docs Learn Events
A/D Converter Project Help — Parallax Forums

A/D Converter Project Help

ArchiverArchiver Posts: 46,084
edited 2001-03-28 09:57 in General Discussion
OK, Here is my problem.

I am doing an alarm system where 8 sensors are attached to the BS2. I need to test the voltage on all 8 sensors and as long as there is 0 volts on each pin, the BS2 continues to test the pins. If a sensor pin ejects, then 5 volts is read on that pin and the alarm sounds.

Do I need an A/D converter connected and which one do I use if I need one?

Does anyone have any examples of code to use or good instructions on how to set this up?

thanks. wtterrell@netzero.com

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-03-28 07:06
    I don't see why you'd need an A/D converter if all you need is a binary (open/closed) indication of one of the contacts.

    Can't you just pull pins high and have the contact switches make the pin go low when the contact is closed?


    ---
    Don Russell
    ---

    Original Message
    From: wtterrell
    To: basicstamps@yahoogroups.com
    Sent: Tuesday, March 27, 2001 10:05 PM
    Subject: [noparse][[/noparse]basicstamps] A/D Converter Project Help

    OK, Here is my problem.

    I am doing an alarm system where 8 sensors are attached to the BS2. I need to test the voltage on all 8 sensors and as long as there is 0 volts on each pin, the BS2 continues to test the pins. If a sensor pin ejects, then 5 volts is read on that pin and the alarm sounds.

    Do I need an A/D converter connected and which one do I use if I need one?

    Does anyone have any examples of code to use or good instructions on how to set this up?

    thanks. wtterrell@netzero.com

    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-28 07:09
    In a message dated 3/28/01 1:04:37 AM Eastern Standard Time,
    wtterrell@n... writes:

    > OK, Here is my problem.
    >
    > I am doing an alarm system where 8 sensors are attached to the BS2. I need
    > to test the voltage on all 8 sensors and as long as there is 0 volts on
    each
    > pin, the BS2 continues to test the pins....

    If this is a burglar or other security alarm, you are better off using an
    intermediate voltage with an end run resistor. In that configuation your
    alarm will sound if the wire is cut or jumped.

    The rest I'll leave to someone with more knowledge.
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-28 09:57
    This bit of code will continuously scan the ports and exit when any of the
    ports has 5 volts on it.

    Loop:

    IF IN1 = 1 THEN Exit
    IF IN2 = 1 THEN Exit
    '*** and so forth...

    GOTO Loop

    Exit:

    '*** alarm stuff here



    Original Message

    I am doing an alarm system where 8 sensors are attached to the BS2. I need
    to test the voltage on all 8 sensors and as long as there is 0 volts on each
    pin, the BS2 continues to test the pins. If a sensor pin ejects, then 5
    volts is read on that pin and the alarm sounds.

    Do I need an A/D converter connected and which one do I use if I need one?

    Does anyone have any examples of code to use or good instructions on how to
    set this up?
Sign In or Register to comment.