Opto coupler use

i am a railroad modeller
Now i want the lichts on my railmodel swits on and of bij a digital code
I have a opto switscjh atp 281
How can i connect my trac with this device to a serial of relais to switch the licht on an of by a digital code
And how make the sketsh

How about a link to your specific optical sensor? My guess is that it is a slotted type? So your sensor changes state when it is interupted. It may go fromhigh to low or low to high. You want that state change to do something. You make no mention of what you are using for a uC (micro-controller)?

Ron

May be TLP281?
https://www.mouser.com/datasheet/2/408/4195-37827.pdf

I am not a scilled arduino user
I have about 8 nano
And 10 relais norm open
and 2 opto couplers TLP 281 ,4 channel
so please be simpel with things u are common with
I am not

a typical opto is simply a transistor. it can be connected between a pin configured as INPUT_PULLUP and ground (emitter). the pin is pulled LOW and the opto is active, light is reaching the detector.

this is similar to many devices, for example, the DCC Specialties PSX circuit breaker has several outputs, including block occupancy, which are opto-couplers

from this i have 2

Tzt TLP281 4 Ch 4 Kanaals Opto Isolator Ic Module Voor Arduino Uitbreidingskaart Hoge En Lage Niveau optocoupler Isolatie 4 Kanaals| | - AliExpress

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.