How sensitive are the driver station digital inputs?

Okay, so we’ve plugged four switches into four of the eight digital inputs on the driver station and written code to make those inputs do something when turned on. Yes, we remembered that on is false and off is true in the code. The switches all seem to work fine.

One day, however, we made a very interesting discovery; whenver someone touches the PWM cables, whatever input is connected to that cable begins pulsing on and off. We discovered this when someone was bundling up the wires and everything on the robot started moving. It was quite fun to impress the build team with our magical powers. :smiley:

Right now, we’ve solved the problem by wrapping the wires in spiral plastic, but does anyone have an explanation for this? Are you telling me those digital inputs are so sensitive, lightly touching an insulated area of the PWM cable is enough to set them off? Are we the only ones with this problem?

When wiring the switches, we connected ground (black) to one terminal and signal (white) to another. Is this correct?

You must use a 10k pull up resistor on the driver’s station. The crio input on the robot has built in 10k resistors but not the driver’s station.

So put a 5V to 10k and that goes to input. Then when the switch is flipped have it go to ground.

A way to have a three way switch, on-off-on (up - neutral - down) tie 47k resistor to each end of the switch both terminating to the middle of the switch. The end of switch is tied to 5v and other end to ground. Then the middle goes to the analog port. That will give you three conditions to be read by analog input.

I’m confused. It seems to me like you’re saying:

When switch is off, signal should be connected to ground.
When switch is on, signal should be connected to 5V going through 10K resistor.

That’s a little difficult to do with a SPST switch…

I made it too complicated. What you have already done, connect a 10k to the side that has the input and the other side of the 10k to 5V. Same switch just adding 10k resistor from input to 5V.

We had the same problem and checked if driver’s station had pull up resistors which it doesn’t

You’re close, but backwards and incomplete.

When switch is off, signal should be connected to 5V going through 10K resistor (this will be read as true).
When switch is on, signal should be connected to ground – and still connected to 5V going through 10K resistor. The resistor will keep the 5V and ground on opposite sides of itself (this will be read as false).

When done as Doug suggests, there is always a 10K resistor from +5V to the signal line. The switch leaves the signal alone when open, and pulls it to ground when closed.