Go Down

Topic: Ghostly push-button input (Read 778 times) previous topic - next topic

frostyobsitnic

Hey all,

I'm trying to make a pair of chorded input gloves. Very simple setup: each finger is basically wired like the ground/signal portion of a pushbutton, and a conductive fabric pad on the palm is wired to +5V. Touching any finger to the palm closes the circuit and sends a signal to the board on the appropriate pin. Right now I have everything on a breadboard, with LEDs wired into the ground portion of each finger circuit so that the LEDs light up when the appropriate finger is pressed.

Here's the trouble:
The board is registering (and therefore typing) fingers that I have not pressed. But those false positives aren't lighting up the LEDs on the board. At first I thought it must be a problem in the code, but the false positives get worse or better depending on how I move around the hand that's generating them, which definitely feels like a wiring problem. But I have no idea what kind of faulty wiring could manage to send a signal directly to the board without lighting up the LED. I've attached a picture of my breadboard. Hopefully someone will be able to spot the incredibly stupid thing I'm probably doing.

Thanks,
Cory

Grumpy_Mike

I think we need a diagram of how you think it is wired up along with the code you are running.

frostyobsitnic

My mistake. Here you go.

(Let me know if I drew the LED facing the wrong way. It's facing the right way in the circuit, I promise.)


Grumpy_Mike

Yes the led is drawn the wrong way round.
It is not a good circuit because you are feeding the voltage across the led directly into the arduino. This will not be high enough to to reliably trigger the input.
Wire the input of the arduino direct to the glove. Also have a pull down resistor of 10K from the input to ground.

frostyobsitnic

I will certainly do that, but I'm pretty sure that doesn't have any bearing on the problem at hand. The issue isn't that I'm not getting signals when i should be. The issue is that I am getting signals when i should not.

tack

#5
Mar 26, 2013, 09:40 am Last Edit: Mar 26, 2013, 09:43 am by tack Reason: 1
Floating Inputs

What do you imagine is the input on the Arduino pin when your finger is touching nothing?

The last part of Mike's response tells you how to resolve.

strykeroz


I will certainly do that, but I'm pretty sure that doesn't have any bearing on the problem at hand. The issue isn't that I'm not getting signals when i should be. The issue is that I am getting signals when i should not.
You'd be getting signals when you should not because when the finger-circuit isn't closed, that input is floating rather than pulled down to a solid 0.  To do that, as Mike suggested earlier, the 10k resistor from the input to GND will enforce a 'default' 0 value on that input rather than it reacting to whatever electrical interference there is at the time.

Cheers ! Geoff
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

frostyobsitnic

wired as suggested, and it seems to work now. (typing with them now!) thanks all for responding so quickly.

also, would someone mind explaining to me how exactly my circuit was different from the working one? i assumed that using the led to connect to ground would be the same as using a pull down resistor, but obviously i was wrong. i'd like to know why so that i can avoid the same mistake in the future.

thanks again,
cory

strykeroz

Hi Cory

Until the threshold voltage of the LED is reached it's an open circuit - which would leave the input floating. 

Cheers ! Geoff
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

conradin

so many lulz in this thread... the problem at hand. lol
the pull up resistors are good points, but you may encounter issues after that. Human input isnt as binary as one might think. you may need to debounce you Inputs,  to prevent getting multiple false triggers. This can be done by strobign the input. As in checking and rechecking the Input lines to determine if there is change. having a few milliseconds wait between reading the input can help prevent false readings.

Additionaly, you might consider placing some small Mylar capacitors on you switching inputs to further eliminate noise. Given your glove closes on a mechanical structure of input, you can expect noise to come from there, anytime the contacts approach each other. 

Go Up