Skip to main content

Reply to "IR or Optical Sensors"

It never seems to end. I am lost again. I used the circuit with the transistor that produces a high when the beam is broken. I use that output as an input to an arduino. I wrote a simple program that tests the state of the beam (HIGH is broken) and sends a HIGH or LOW (when the beam is unbroken) to the relay trigger. The relay is triggered by a LOW (and I have tested that the arduino will cycle the relay by just outputting H's & L's). My operational code is very simple, but when I run it and the beam is unbroken, the relay just chatters. When I break the beam, the relay opens and stays. My program design keeps the trigger output LOW if the input DOES NOT = HIGH (!=). I have tried many different approaches, but I believe the problem is that the output when the beam is unbroken is floating and causing random H & L. If that is the cause, is there a design solution that will give me a solid GRD output when the beam is unbroken and a solid HIGH (~5v) when beam is broken?

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×