![]() |
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? |
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.
|
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.
|
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. |
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. |
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. |
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/--------- |
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.
|
Re: Toggle switches to Analog board?
1 Attachment(s)
Al is probably referring to this type of configurations.
|
Re: Toggle switches to Analog board?
1 Attachment(s)
It should look like this...
|
Re: Toggle switches to Analog board?
Quote:
|
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.
|
Re: Toggle switches to Analog board?
Quote:
|
Re: Toggle switches to Analog board?
1 Attachment(s)
Quote:
|
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 20:49. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi