Hello,
im developing a project in ISIS proteuse 2012 and i need to add an optical sensor to port B, when an object is detected by this sensor,+5v should be applied to this Port and i can start an operation of calculation.
i have think to use "E3Z-L81 from omron", but it deliver a current instead of voltage !!!
any idea please ??
This sensor has a 12-24V high side PNP output and you need a resitor divider from the output to ground to get a 5V max. signal. The diagram is shown here: https://www.ia.omron.com/product/item/e3z_7163g/ .
first, thank you for your reply it show me where to start
so if i understand well the schema should be look like this :
if we apply Ohm's Law we must mount a resistor of 50 ohm between sensor output (Wire 4 black) and pin RB0 of microcontroller in order to get +5V when sensor detect objects
this would supply the 12-24V to your input and damage it. A resistor divider with two resistors in series to ground is needed. If you have for instance 12V supply and use 12k ohm for the two resistors, the lower one should have around 4kohm and the upper one 8kohm(total 12kohm). Then the signal between the two resistors can be connected to the port input.