Puzzle about digital Input circuit

Thread Starter

bug13

Joined Feb 13, 2012
2,002
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!
 

Attachments

Thread Starter

bug13

Joined Feb 13, 2012
2,002
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.
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?
 

ScottWang

Joined Aug 23, 2012
7,397
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:

pwdixon

Joined Oct 11, 2012
488
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.
Can you just go over again how when set for input and the switch is closed that the input will see a particular voltage?
 
Top