uC&Gate Logic

Discussion in 'Embedded Systems and Microcontrollers' started by chandu13, Jan 25, 2009.

  1. chandu13

    Thread Starter Member

    Oct 15, 2008

    I have to interface Limit Switch with LPC 2106 microcontroller. For isolation I am using MCT2E. MCT2E 1 & 2 pins are connected to the limit Switch.5th pin is connected to the 3.3V supply using Pull up resister, 4th pin is connected to the ground.
    LPC 2106 micro controller I/O pin is connected to the 5th pin of the MCT2E. Normally LPC 2106 micro controller I/O pin reads the logical high. Whenever Limit Switch is closed the Opto led will ON & LPC 2106 micro controller I/O pin reads the logical low.
    Here my application is I have to give the the 3.3v logical high signal & logical low signal to the micro controller I/O pin & 74HC04 input pin.

    Here I am checking the input signal using mircocontroller & Gate logic. If both are true then only my output solenoid will be ON
    Please suggest me how to connect the Logical High or Low signal(3.3V) to the micro controller I/O pin & to the 74HC04 input pin

  2. mik3

    Senior Member

    Feb 4, 2008
    Did you put a resistor at the input of the opto to limit the current through the diode?

    Have you considered that the limit switch will bounce during closing and cause unwanted short duration pulses to the microcontroller? Is it a problem for your design?

    You can use another opto, which will be driven by the same limit switch, to drive the input of the gate which or use a transistor with a pull up resistor driven by the output of the opto you have now as to convert the 3.3V logic to 5V logic for the gate.

    In my opinion, you don't need to use an opto at all. Just connect a pull up resistor between the uC input and the limit switch between the input of the uC and ground.

    What is the coil going to do?