In my original post I thought I had this turkey nailed, sadly not :(

I've got a pnp laser distance sensor and a Denkovi USB relay board. I'm planning on using the laser to trigger the IOs on the Denkovi board so that I can detect it with software. enter image description here

The Denkovi Manual is here

The Chip Manual is here

The Laser Manual is here

Denkovi tell me... 4 Digital I/O Port: Inputs - 0-5VDC TTL levels, with pull-up 200kOhm resistor. Each can be configured as digital output (0-5VDC).

My sensor has either Normally open 4.5VDC to switched 12VDC Normally closed 12.5VDC to open 4.5VDC

Does anyone know a way I can active one of the inputs directly without using a relay?

Think Im going to need a relay :(

EDIT When the sensor is powered up using 12.8VDC (sensor will operate in the range 12 to 30 VDC) In the NOT switched state, measuring between white (NC) and Blue (0VDC) we measure 12.7VDC. (assumed transistor loss) In the switched state white to blue measure 4.6VDC

As mentioned below 5VDC has to be the maximum the denkovi board is subjected to.

Hence I propose the folowing enter image description here

  • \$\begingroup\$ The diagram appears to omit the essential connection between the 0 V on the sensor and the GND on the relay board. \$\endgroup\$ – Andrew Morton Oct 3 '17 at 12:26

The "PNP" output on sensor means that the wire is pulled to ground when the output is active, and left unconnected when the output is not active. The Denkovi board has a digital input with pull-up, which means you need to connect it to ground to activate. Sounds like they are perfectly compatible to each other (I am not sure where does "Normally closed 12.5VDC to open 4.5VDC" come from)

I'd recommend just connecting them together, after taking basic precautions to ensure that there are no mistakes in documentation:

  • I recommend using normally closed output (white wire) because the other output also have IO-Link and who know how it will interfere with the sensitive logical input.
  • Connect sensor to power supply, power it up, and use voltmeter to measure voltage output. Ensure it is always <5V, because your USB board will be damaged otherwise. In fact, since you have no pull-up yet, I expect you will always see 0V. This is OK.
  • Configure your Denkovi board pin as input, connect 1K resistor per picture 6.2 in the manual, and use it to temporary short the In1 input to ground. Make sure you software registers change when you connect and disconnect the pin to the ground.
  • If both previous steps were successful, just connect sensor output to In1 pin via 1K resistor. It should just work.
  • If this does not work, use voltmeter to measure the voltage on the input pin. It should be either <0.5 volt or >4 volt, depending on whether sensor is triggered or not.
    • If "high" output is too low, and never reaches 4 volts, you need more pullup. Connect extra resistor, say 10K, between 5V output and In1 input.
    • If "low" output is too high, and never reaches <0.5 volt, then output driver in the sensor is not good enough. This is harder to fix, you may need to add a relay (or another transistor, or optocoupler) after all.
  • \$\begingroup\$ I suspect your measurement of 4.6 volt voltage in the switched state. It looks like your sensor has some pull-up built it, and what you are measuring is the internal resistance of the voltmeter. Try adding some resistance, say 10K, between white and blue. Do you still have 4.6 volt in the switched state? \$\endgroup\$ – theamk Nov 17 '16 at 17:49
  • \$\begingroup\$ Correct me if I'm wrong, but PNP output from a sensor means that the sensor is putting out +Vcc when activated and is open-circuit when not active. NPN is the opposite: the output is pulled to ground when active and is open-circuit when not active. automation-insights.blog/2011/01/18/… \$\endgroup\$ – Dwayne Reid Apr 27 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.