Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Dilemma about limit switch, Help~

Status
Not open for further replies.

whkang07

Newbie level 2
Joined
Jan 1, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
malaysia
Activity points
1,298
I beg for answer from anyone of you all here for my silly question

I am wonder how is a limit switch works. with microcontroller.
Lets say i connect the limit switch with NC condition. when i (press + release) the limit switch, it return 1 to the pin?

for the second time i (press + release), it will return "0" or "1" to the pin?

it is like
(press + release) - 1
(press + release) - 1
(press + release) - 1
(press + release) - 1

or

(press + release) - 1
(press + release) - 0
(press + release) - 1
(press + release) -0

????????????

what if i only (press) but (not release) the limit switch? or it returns 1 when it is pressed and will returns 0 when it is released?

I beg for answer. thx anyone that could share with me~
 

you have in general two types of switches. On/off switches and pushbuttons.

The limit switches are normally of the pushbutton type : make contact when pushed, break contact chen released (or vice versa of it is a normally closed one).

ON/Off swhitches work like push : make contact, stay in contact until next push ( = bistable behavior)

This is very easy to check with your switch and a multimeter that you put on 'measuring ohms' mode.
 

So, do you mean that, for normally close limit switch, when i press the switch, the microcontroller's pin is pulled high (1), and when i release the switch, the pin's state returns to (0)?

thx for replying ~
 

@whkang07

it depends how you connect the switch to microcontroller. I prefer placing the resistor from input pin of uC to Vcc and the switch from input pin to GND, so when the switch is closed the pin is pulled Low, otherwise it is on High logic level.

HTH
 

Zasto states the usual preferred way of doing it. You just need to configure the software to recognise 0 as a closed input. 5V systems resistor of 4k7 is a useful value but is far from critical, values of 100R to 100K would work, but 3k3 to 10k is probably about right.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top