Go to Post I'll do my best, but I'm this --><-- close to telling our drivers they're NASCAR styling it this season..."Sorry boys and girls, left turns only!" - Mr. Lim [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2014, 16:28
tgross35 tgross35 is offline
Registered User
FRC #4810 (I Am Robot)
Team Role: Electrical
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Michigan
Posts: 23
tgross35 is an unknown quantity at this point
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   Spotlight this post!  
Unread 09-02-2014, 16:32
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
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.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #3   Spotlight this post!  
Unread 09-02-2014, 16:33
Chris_Ely's Avatar
Chris_Ely Chris_Ely is online now
Registered User
AKA: luckof13
FRC #3414 (HackBots)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Farmington, Michigan
Posts: 366
Chris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond reputeChris_Ely has a reputation beyond repute
Re: How to wire a digital input device

The limit switch should be wired to ground and signal.
__________________
2013: Waterford Finalist, Livonia Winner, MSC Quarterfinalist, Curie Division
2012: Waterford, Northville, Livonia
2011: Waterford Finalist, Livonia
2010: Ann Arbor Rookie Inspiration Award, Troy

Mechanical Engineering Student,
Michigan Technological University
  #4   Spotlight this post!  
Unread 09-02-2014, 18:54
tgross35 tgross35 is offline
Registered User
FRC #4810 (I Am Robot)
Team Role: Electrical
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Michigan
Posts: 23
tgross35 is an unknown quantity at this point
Re: How to wire a digital input device

Thanks for the help! I'll have to fix that as soon as possible.
  #5   Spotlight this post!  
Unread 09-02-2014, 21:58
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 19:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi