|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
How to wire a digital input device
Hello everyone,
Our team is looking to use limit switches this year on our robot, and are wondering how exactly they should be wired. We have it working by connecting one side of the switch to the +5v and the other side to the ground of one of the digital pins, however this does not seem correct. When the switch is pressed (so a normally open connection becomes closed,) the 5V light on the digital sidecar turns off, and I am wondering if this is because of a short circuit, since we are connecting the power and ground pins. It seems to me that we should be able to connect the terminals of the switch to the 5v and the signal port instead, but this hasn't worked for us. If anyone knows for sure, please let me know. Thanks, T |
|
#2
|
||||
|
||||
|
Re: How to wire a digital input device
You actually want one end of the switch to go to SIG, and the other side of the switch to go to ground. There is an internal pullup to 5V on the signal line, so you do not need to hook up to the 5V line at all. You are right that what you currently are doing is creating a short, which is not good.
|
|
#3
|
||||
|
||||
|
Re: How to wire a digital input device
The limit switch should be wired to ground and signal.
|
|
#4
|
|||
|
|||
|
Re: How to wire a digital input device
Thanks for the help! I'll have to fix that as soon as possible.
|
|
#5
|
|||||
|
|||||
|
Re: How to wire a digital input device
After you connect the switch terminals from (-) to SIG on the Digital Input, you'll want to make sure your programmer understands what that means for the software. +5 on the SIG pin will read as a True value, and 0 on the pin will read as False. That's going to result in sort of the opposite of what one might expect, since an open switch will leave the pin at +5 and a closed switch will pull it low. Typically when the switch is not active, it'll read True, and when the switch is active it'll read False.
(If you're using a limit switch with Normally Closed contacts, you can use them instead of the Normally Open ones and the software will match the action of the switch.) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|