Shop OBEX P1 Docs P2 Docs Learn Events
Trouble with IR detector sending an output to another stamp. — Parallax Forums

Trouble with IR detector sending an output to another stamp.

sammiegsammieg Posts: 4
edited 2009-05-24 14:58 in BASIC Stamp
Goal: I am using two BS2 stamps to flash a large amount of LEDs. On one board I am using the IR detector program that is used for the boe-bots to drive around. On the other board I am using an “IF…THAN” statement to flash the LEDs.

So far: Everything on the IR detector board is working. Debug acknowledges that objects are detected, and when tested with a DMM shows a tenth of a volt change on the IR receiver. I read somewhere that there needs to be a 1.4 to 5 volt input to the other stamp.

Question: How can I program a suitable output from the IR stamp to activate the LED stamp?

Code used for IR receiver stamp:

'Robotics! v1.5, Program Listing 5.1: IR Pairs Display.
' {$STAMP BS2}

'
Declaration

one_IR_det VAR Bit

'---- Initialization

OUTPUT 1

'---- main routine

main:

FREQOUT 1, 1, 38500
one_IR_det = IN0

DEBUG HOME, "one= ", BIN1 one_IR_det
PAUSE 20

GOTO main
Code used for LED stamp:

' {$STAMP BS2}
' {$PBASIC 2.5}

DO

DEBUG ? IN3

IF (IN3 = 0) THEN
HIGH 14
PAUSE 10000
LOW 14
PAUSE 100
HIGH 14
PAUSE 600
LOW 14
PAUSE 10000

ELSE
PAUSE 100

ENDIF

LOOP

Comments

  • Mike2545Mike2545 Posts: 433
    edited 2009-05-23 17:53
    You are going to have to be much more specific about what you are trying to do.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • sammiegsammieg Posts: 4
    edited 2009-05-23 18:41
    I am trying to make a motion activated flashing LED table like the one from Evil Mad Scientist.

    I am using two stamps, one with the IR sensors to detect movement, and another stamp with the IF…THAN…ELSE code to flash the LEDs.
    My problem is that the stamp with the IR sensor works in debug, I can see it change from 1 to 0 when I wave my hand over it. I need to take the output of the IR sensor to the input of the LED program. However when I connect the two of them, the LED input is not able to see the toggling of the IR sensor.
    What I don’t know is if I am doing something wrong in trying to program the two boards to communicate. So far what I need is for the output of the IR sensor to send the 1 or 0/no detection or detection signal to the other stamps input to IF it sees a 0/detect to THEN run the flashing coded for the LEDs, ELSE it pauses and runs through the program again.
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-05-23 19:14
    Please define "large amount of LED's".
    In your current code you·could drive 14 LED's "directly" (using appropriate current limiting hardware ).
    Since you need ports to comunicate between stamps (and you want to have one stamp dedicated to LED's) how do you expect to operate more than that by tying two stamps together?
    Rather than dwell of· very simple (on/off) coding let's·see a schematic of your whole setup.

    Cheers Vaclav

    ·
  • sammiegsammieg Posts: 4
    edited 2009-05-23 20:56
    I will eventually be lighting 300 LEDs from the stamp with the IF THEN code. I haven’t quite figured it out yet, but my plan right now is to power those LEDs from a separate power source so that I don’t overload the stamp. I am just using the stamp to send a signal to make the LEDs flash. The 300 LEDs are going to be broken into six groups of 50, each with an IR sensor on them to trigger them at different times.

    I attached a drawing of my schematic.
    2316 x 976 - 318K
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-05-23 22:27
    Take a look at MAXIM 7219 Serialy Interfaced 8 digit LED driver. Each can drive up to 64 LED's independently and you can "daisy chain" therm.
    It also has intensity control.
    MAXIM is generous with free samples and I could send you my code.
    Cheers Vaclav

    ·
  • sammiegsammieg Posts: 4
    edited 2009-05-23 23:29
    Thank you for the suggestion, I had never heard of those. I took a look at them and they sound like just the thing. I'll take you up on your code, never hurts to look. Thank you so much.
  • DataJDataJ Posts: 23
    edited 2009-05-24 14:58
    Sammieg - -

    I just finished an HO Train Display in which I used 5 IR emitters & 5 IR Receivers and had a similar
    problem.

    There would be a voltage change on the receivers when they were blocked and when they weren't.
    The voltages ranged from 5 volts to around 2.45 volts - - both above the trigger threshold.

    What I did was put a 1,000 ohm resistor in the +5 volt lead and 1,000 ohms in the receiver output
    that returns to the stamp pin.· Upon measuring the voltage changes then, I was getting +5 volts "on"
    or "1"·signal·and +2.0 volts for the "off" or "0" state.

    Another thing, when tying several·things together, such as two power supplies or Stamps, there needs
    to be a common ground.

    Hope this helps.

    Jim

    ·
Sign In or Register to comment.