Shop OBEX P1 Docs P2 Docs Learn Events
IR Emitters & Receiver Module Question — Parallax Forums

IR Emitters & Receiver Module Question

DataJDataJ Posts: 23
edited 2009-04-07 19:36 in BASIC Stamp
Gentlemen - -

I have just about completed a small HO model train switching display using an OEM BS-2 Stamp.

Train detection is being accomplished via the IR emitter and Receiver Module·as delineated in
the BOE-BOT manual, and it has worked properly when one output pin is used for the emitter and
a separate line for the input.··The code, "Freqout 1, 2, 38500,·works as advertised, but only at 2 ms rate.

My problem is, that in order to save output pins, I have tied two of the IR emitters to one of the output
pins on the Stamp, and again used the code, "Freqout 1, 2, 38500.· However, the addition of the second emitter causes erratic returns from the receivers.

I have just about concluded that each IR Emitter must have a dedicated output·pin, just as each receiver
must have a dedicated input pin.

Any thoughts about this would be appreciated.

Thank you for your assistance.

Regards,
Jim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-06 16:35
    You need to provide a schematic.

    If you just parallel two IR emitters, each one gets only half as much current and produces roughly half as much light.

    If you parallel two IR emitters, each with its own current limiting resistor, you may be trying to draw more current than the Stamp can supply.

    It's impossible to tell without more information.
  • DataJDataJ Posts: 23
    edited 2009-04-06 17:07
    Thanks Mike for your reply - -

    I have changed the resistors all the way down to 220 ohms, running two emitters - - well below the stamp's output
    limits. (I have had one set running with 1k ohms on the emitter and 1k on the rcvr - no problem).

    My question is more theory -- i.e., is it possible to have several emitters operate from one output pin, given that the power and current source is adequate.

    I cannot determine any reason why several emitters cannot be tied to one output provided the power requirements
    are met.

    Thanks,
    Jim
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-06 17:26
    It is certainly possible to have several emitters operating from one output pin. The issue is still whether there's adequate current available. With LEDs in parallel, one LED can hog the available current if its forward voltage threshold is slightly lower than the other LED's. You really need a separate resistor for each. If you put the two LEDs in series, you may be able to run them that way, but will need to recalculate the resistor value. It all depends on the forward voltage of the LEDs.

    You need to look at the datasheet for the Stamp and the PIC16C57 that it's based on. There's a specification for the output voltage at different currents and you need that to determine the proper resistor value.
  • DataJDataJ Posts: 23
    edited 2009-04-06 18:21
    Dear·Mike - -

    Thank you for your reply·- - I had some·reservations when connecting the emitters in
    parallel, but thought that since there was only two of them, it would work.· I will give·it a
    try with a separate resistor to each and see if it will·operate.· If so,·that will confirm that
    the system will·perform as planned.

    The·stamp·will need an outboard component in order to handle the current requirements
    for the 5 emitters, and I have·found various circuits on the Parallax website that can·handle this.

    This is my first full-fledged·project with a microcontroller, and, it has been quite an event - far different
    than experimenting·with the BOE.

    Regards,
    Jim
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-06 18:33
    Be careful about the maximum current draw. The PIC I/O pins are only rated for about 20mA (source - high) or 25mA (sink - low).
  • DataJDataJ Posts: 23
    edited 2009-04-07 19:36
    Hello Mike - -

    I have made the changes based upon your analysis and recommendations, and, the two emitters & IR receiver circuits are working·just fine.

    Thank you again for your help - it is much appreciated.

    Regards,
    Jim
Sign In or Register to comment.