-2
\$\begingroup\$

This question already has an answer here:

I'm designing a digital I/O module which isolated with optocouplers. I'm done with the outputs, but having a confusion about input side.

enter image description here

I will have some switches and sensors to read as inputs, but I don't know how to do the connections, can someone show me as a schematic?

Which pin should be GPIO pin for example?

\$\endgroup\$

marked as duplicate by Elliot Alderson, Chris Stratton, Huisman, SamGibson, Sparky256 Aug 2 at 2:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0
\$\begingroup\$

The collector outputs will each need a pull-up resistor to Vdd, your CPU logic voltage, so that these pins may go "high". Other than that, it should work. The resistance value chosen (along with the capacitance of each line) determines how fast the output goes high. If speed isn't an issue, 10kΩ should work. But for fast speeds, much lower values will be better, and this means the current rating of the transistors inside the opto needs to be taken into consideration.

Edit: The STM32F072C8T6 has a supply voltage of 3.3v nominal. Bypass caps must be installed across Vdd/Vss pins. Make sure BOOT0, VBAT, and NRST lines are handled correctly according to the datasheet.

The TLP280-4 LEDs can be driven to 50mA: 24v/50mA = 480Ω minimum input resistance. Output transistor limit is also 50mA: 3.3v/50mA = 66Ω minimum pull-up. Smaller resistances will be faster, if speed is a concern.

\$\endgroup\$
  • \$\begingroup\$ So is this schematic true according to your opinion? ibb.co/BsPDW16 this is the link for schematic. Thank you \$\endgroup\$ – Teoman Açıkgöz Jul 31 at 13:26
  • \$\begingroup\$ Looks ok to me, you'll have to try it. :) \$\endgroup\$ – rdtsc Jul 31 at 14:21
  • \$\begingroup\$ thank you so much @rdtsc :) \$\endgroup\$ – Teoman Açıkgöz Aug 1 at 6:22

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