Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Toggle switches to Analog board? (http://www.chiefdelphi.com/forums/showthread.php?t=90235)

sircedric4 27-01-2011 08:31

Toggle switches to Analog board?
 
I know it is not a traditional use of the analog breakout board to attach toggle switches, as most people use potentiometers or some other sensors, but this year we have used up the 14 inputs on our Digital Sidecar. I have 4 questions before trying this and a search on here didn't pop up a solution.

1) Instead of adding a whole sidecar for the other 3 switches our current design needs, I was wondering if I could wire them to the Analog Breakout board instead? (I have to have an analog board for the battery jumper so I should go ahead and use it as much as possible and save some weight and failure points)

2) Do I need to have a resistor in the line between my switch and analog board, or can I strictly wire my switch to the analog breakout like I do the digital board, with just the white and black wire?

3) Has anyone done this before, if so what issues did you have?

4) Bonus question: Can I do the switch to the analog input on the driver station cypress chip as well, using the same method that I would hook it up to the robot analog breakout board?

Zme 27-01-2011 08:38

Re: Toggle switches to Analog board?
 
we did this last year with the cypress, was a little annoying to program but aside from that i didn't notice any issues with it.

JamesBrown 27-01-2011 08:44

Re: Toggle switches to Analog board?
 
You can definitely do this, you are probably going to want (need?) a pull up resistor. Solder a resistor from signal to pwr and wire the switch from signal to ground, flipping the switch will toggle between the power voltage and 0v.

Alan Anderson 27-01-2011 08:48

Re: Toggle switches to Analog board?
 
I think the easiest way to make it work is to add a pullup resistor (10k or so) from signal to +5 volts, and connect the switch from signal to ground. You'll read 5v when the switch is off, and 0v when the switch is on.

You could even use a half dozen or so resistors to make a rudimentary D-to-A conversion circuit, which would let you connect all three of your switches to a single analog input, but that's probably a bit fancier than you need to get.

Al Skierkiewicz 27-01-2011 08:56

Re: Toggle switches to Analog board?
 
Darren,
Teams do this all the time. There are a variety of applications. A simple single throw, single pole switch can be used tied to a 10 k resistor which has one end connected to a 5 volt supply. One side of the switch is tied to power common and the other side to the resistor. The switch when open allows a 5 volt input to the analog module and when closed, provides a zero volt signal. A double throw switch can be wired for three states, a multi pole switch can be wired for even more. We use an modified Radio Shack switch to provide 11 different positions for selecting different modes or auto programs in this way, either at the robot or on the driver's station. 9.1k resistors are tied between each contact and the switch then provides 12 levels of voltage between 5 volts and zero volts.

sircedric4 27-01-2011 12:49

Re: Toggle switches to Analog board?
 
Thank you everyone! This was the information I needed. This helps me keep our controls to one digital sidecar. I don't think we will have a weight problem, but on our team we always look for any weight savings throughout the entire build so we don't have a problem at the end. Using the existing, mandated analog board saves us 1.2 lbs between the additional sidecar, big cable and cRio module.

I am the programming mentor so I know how to tweak the settings on that side, I wasn't sure of how to wire it correctly. I don't like to test theories on expensive robot components when a quick question gets me an answer from teams that have already solved the problem.

sircedric4 03-02-2011 20:29

Re: Toggle switches to Analog board?
 
I just want to make sure I understand this wiring, we are at the point we are about to use the analog to digital trick. I assume this is how I wire it from you guy's instructions?

Code:

  ---/Switch/---------
  |              |  |
  |              |  10k Resistor
  |              |  |
  |              |  |
  B              W  R

Where B is the black wire, W is white wire, and R is red wire on a standard PWM cable. Basically tie the white wire and the red wire through a resistor onto one side of the switch and the black wire on the other?

AustinSchuh 03-02-2011 20:50

Re: Toggle switches to Analog board?
 
Yes. That is the circuit. And that 10k resistor can be anything from 1k to like 100k without too much issue, if you can't find a 10k easily.

mikets 03-02-2011 21:05

Re: Toggle switches to Analog board?
 
1 Attachment(s)
Al is probably referring to this type of configurations.

Al Skierkiewicz 04-02-2011 08:28

Re: Toggle switches to Analog board?
 
1 Attachment(s)
It should look like this...

sircedric4 04-02-2011 09:21

Re: Toggle switches to Analog board?
 
Quote:

Originally Posted by Al Skierkiewicz (Post 1015420)
It should look like this...

If I am looking at this correctly, does this mean I can't use a SPST switch to do what I want to do? I need a SPDT?

Al Skierkiewicz 04-02-2011 09:58

Re: Toggle switches to Analog board?
 
If you are going to the analog board, it does not have pull up resistors so you have to use the SPDT to switch between +5 and zero volts. If you use a digital input, the pullup would allow you to simply open or close a connection to the common to give two states.

Alan Anderson 04-02-2011 10:11

Re: Toggle switches to Analog board?
 
Quote:

Originally Posted by Al Skierkiewicz (Post 1015454)
If you are going to the analog board, it does not have pull up resistors so you have to use the SPDT to switch between +5 and zero volts. If you use a digital input, the pullup would allow you to simply open or close a connection to the common to give two states.

Sorry, Al, but I have to disagree. If you put a 10k pullup resistor between the analog signal and +5 power pins, a simple SPST switch between signal and ground will give the desired results. The schematic Darren posted is exactly how I would do it.

JamesBrown 04-02-2011 10:16

Re: Toggle switches to Analog board?
 
1 Attachment(s)
Quote:

Originally Posted by Al Skierkiewicz (Post 1015454)
If you are going to the analog board, it does not have pull up resistors so you have to use the SPDT to switch between +5 and zero volts. If you use a digital input, the pullup would allow you to simply open or close a connection to the common to give two states.

Attached is a picture for SPST (Al, please correct me if I am wrong but this should give him two states (Closed =0v Open=~5v) using a Single Pole Single throw switch on the Analog inputs which seems to be what he wants to do.

Al Skierkiewicz 04-02-2011 11:11

Re: Toggle switches to Analog board?
 
Yes, You guys are right. I have to stop answering these questions while I am working on interfaces here. Alan, can you add something about programming so that switch bounce doesn't confuse the readings?


All times are GMT -5. The time now is 11:59.

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