??? 07/24/04 09:23 Read: times |
#74786 - Reed Relay *INPUTS* Responding to: ???'s previous message |
Kashyap Deepak said:
How do I read a ON/OFF input (not from switch but relays and pressure switches) As far as your 8051 is concerned they're all just switch contacts - it is entirely irrelevant whether they're manually-operated switches, electro-mechanically operated relay contacts, pressure-operated contacts, or any other sort of contacts! You can connect the relay like this: Vcc-----+-- ! ! / / Pullup ! Port <--+ Pin ! ! ! +---- ! ! ! ( Relay ( Relay Contact ( Coil ! ( ! ! ! +---- ! ! Gnd-----+--- You apply the input signal to the relay coil - when the signal is "ON", the relay opreates; when the signal is "OFF", the relay releases. Obviously, you need to choose the coil rating to suit the input signal. It should also be obvious that the input signal is completely isolated from the microcontroller - there is no need for an opto isolator! (unless you have some special requirement for a double isolation barrier...?) |