Electronic – arduino – Optocoupler – Make active low output at active high

arduinoopto-isolator

I'm currently working on a project and it consists of amplifying a 5V signal from an Arduino to 24V. I made my circuit and hooked it up to a oscilloscope and it shows that the output of the optocoupler is active low. I just wanted to know if there's a way I can make it active high.

Thanks in advance.

schematic

Best Answer

Yes. Swap the positions of the 1.6 kΩ resistor and the opto-transistor. That will default to pull-down and the opto-isolator will pull up.

It's not clear why you're using the opto-isolator other than as an inverter (which you seem to not want) since you have CH connected to the micro-controller's D7 so you have lost all isolation.

Your CH1, if it's a 5 V input, should be fed directly from D7, not from the top of the infrared LED where it will be clamped by the 1.4 V forward voltage, Vf of the infrared LED.