Puzzle about digital Input circuit

Discussion in 'General Electronics Chat' started by bug13, Sep 23, 2014.

  1. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    I got this following circuit here, when SW is pressed, the digital IO can somehow detect the SW is pressed, but I don't understand how.

    Can someone help me out? Thanks a lot!
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,382
    It would have to be a very sensitive input to detect the change in base emitter current?
    What is the nature of the input?
    Max.
     
  3. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    That circuit makes little sense. Who designed it?
     
  4. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    I am not sure what you mean. Normally, the digital IO would toggle the LEDs. But when the SW is pressed by a user, LEDs stay on. Does that answer your question?
     
  5. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    One of the Engineer at work. (He passed away in an accident two year ago, so I can't ask him).
     
  6. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    That makes no sense either. :confused: When the SW is pressed (closed) the LEDs should go off since there is then no voltage at the base of Q2.
     
    mithilesh tiwari likes this.
  7. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    Sorry, I meant to say the SW is pressed and then released, my bad!
     
  8. pwdixon

    Member

    Oct 11, 2012
    488
    56
    Do you have processor code that says that this I/O is being driven and being read? Can you post any code?
     
  9. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    Sorry I don't have access to the code.
     
  10. ScottWang

    Moderator

    Aug 23, 2012
    4,858
    768
    According to what you described, the program have two parts, the first is to set the port as an output port and to output high and low.

    The second parts is set the port as input port to detecting the SW, when the SW is not press, the input port will get a high level, when the SW was pressed then the input port will get a low level.

    How the input port changing the voltage level, when the SW is not press, according to the voltage divider, the Q1_C will get a high level less than 5V, when the SW was pressed then the Q1_E will get about 0.9V, and the input port will get less than 0.2V, the 0.2V is a low level, so the input will get a low level.
     
    Last edited: Sep 25, 2014
  11. pwdixon

    Member

    Oct 11, 2012
    488
    56
    Can you just go over again how when set for input and the switch is closed that the input will see a particular voltage?
     
Loading...