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?


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.

| improve this answer | |
  • \$\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 '19 at 13:26
  • \$\begingroup\$ Looks ok to me, you'll have to try it. :) \$\endgroup\$ – rdtsc Jul 31 '19 at 14:21
  • \$\begingroup\$ thank you so much @rdtsc :) \$\endgroup\$ – Teoman Açıkgöz Aug 1 '19 at 6:22

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