??? 07/23/04 14:20 Read: times |
#74754 - RE: Reed Switch Sensor Responding to: ???'s previous message |
Without knowledge of your particular optocoupler, I see no reason It should not work.
1) +24 - switch - resistor - OC diode - 24V return 2) OC transistor base floating 3) OC transistor emitter to ground 4) OC transistor collector to port pin 5) if port pin is p0 a pullup resistor of ~4k7 to Vcc 6) write a '1' to the port bit 7) read the port bit Erik |