piBeacon: 23 - optical isolated input to GPIO

User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

piBeacon: 23 - optical isolated input to GPIO

Post by kw123 »

here a circuit for an opto coupler input to a RPI-GPIO
connect
GND --> ground on RPI
OUT1--> GPIO
the RPI has to be configured with the pull-up resistor you select in device edit
Screen Shot 2020-07-05 at 21.49.48.png
Screen Shot 2020-07-05 at 21.49.48.png (250.48 KiB) Viewed 6644 times
And the input side goes to a switch with supplied voltage Vin (switch open: Vin=0, closed Vin=X) . The LED needs ~5-20mA to switch on fast
Values for R for different voltages Vin (the internal LED has a voltage drop of ~ 2.5V itself ):
12V: ~2k -470 Ohm ((12-2.5)V/0.005 /0.02A)
5V: ~500-120 Ohm ((5-2.5)V/0.005 /0.02A)
3V: ~100-25 Ohm ((3-2.5)V/0.005 /0.02A )


Karl

Return to “piBeacon”