November 22, 2024, 03:00:24 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Optosensor (Beam Break) Hookup Advice

Started by ScaryTinker, August 17, 2013, 07:04:22 AM

Previous topic - Next topic

ScaryTinker

I'd like to use the Honeywell # CP18LDND2. Retroreflective opto sensor as a trigger.  I will be running it and the Prop-1 on 12 volts.   Here's a link to the spec sheet   http://tinyurl.com/losetqq

I just need help with the wiring to connect it to the Prop-1.

JonnyMac

That's an open-collector type device which means the output wire (black) will go low when the device is active, and will float (be disconnected) when not active -- the same what the ULN outputs work.

Sensor.Brown (+) --> Prop-1.V+
Sensor.Blue (-) --> Prop-1.GND
Sensor.Black (output) --> Prop-1.P6.W

Setting up for triggering:

1) Move P6 SETUP jumper to UP
2) Clip pin 2 of the ULN chip to prevent interference
3) Code must debounce on a low signal -- like this:


Reset:
  PINS = %00000000                              ' all off
  DIRS = %00111111                              ' P5..P0 are outputs


' -----[ Program Code ]----------------------------------------------------

Main:
  timer = 0                                     ' reset debounce timer

Check_Trigger:
  PAUSE 5                                       ' scan delay
  IF Trigger = 1 THEN Main                      ' check trigger for low
    timer = timer + 5                           ' update timer
  IF timer < 100 THEN Check_Trigger             ' check timer

  ' program code here

  GOTO Reset



See this link about the ULN and clipping pins:
-- http://www.efx-tek.com/php/smf/index.php?topic=130.msg476#msg476
Jon McPhalen
EFX-TEK Hollywood Office

ScaryTinker

Thanks!  As always, super support service from EFX-TEK.   Now I've got to throw together a demo before the CalHaunts meeting at 11.   :o