Shop OBEX P1 Docs P2 Docs Learn Events
ir sensor — Parallax Forums

ir sensor

eagle4ceseagle4ces Posts: 14
edited 2010-01-25 23:37 in BASIC Stamp
am trying to use an ir led and ir sensor but the input pins keeps repeating a sequence of 1 and 0 even when nothing is connected to it

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-01-25 23:04
    Post reply, attach code, attach drawing of circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • eagle4ceseagle4ces Posts: 14
    edited 2010-01-25 23:09
    here is the code
    do
    freqout 7,1,38000
    debug?in15
    loop


    i connect the ir sensor signal pin throught a 1k ohm and the transmitter throught a 220 ohm.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-25 23:37
    The IR-Sensor signal pin is an 'active-low' signal. This means, you need to tie this signal to +5 through the 1K ohm resistor. When the IR-Sensor detects a signal, it will then 'pull' the pin low.

    Alternating 1's and zero's indicates the pin is 'open', acting as an antenna.
Sign In or Register to comment.