The breadboard connections diagram

Regarding the breadboard connections, they are a little more complex this time due to the fact that the optocoupler housing of the Fritzing part I used was a little too big for the breadboard, so I've had to use some extra wires.

That apart, please keep in mind that the exact optocoupler you may find might not have the same pin distribution as the one used in this diagram, and you should refer to your specific component datasheet to adapt the wiring connections to your optocoupler or you could easily damage it.

The breadboard connections diagram

A breadboard connections diagram for the optical switch example

In the optocoupler used in the diagram, ...

Get Arduino Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.