Pages: [1]   Go Down
Author Topic: Ghostly push-button input  (Read 532 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* Picture 8.jpg (235.21 KB, 1280x960 - viewed 11 times.)
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.)



* Picture 11.jpg (111.49 KB, 1280x960 - viewed 15 times.)
* gloves_v3.ino (5.24 KB - downloaded 6 times.)
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 26, 2013, 03:43:52 am by tack » Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Cory

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

Cheers ! Geoff
Logged

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

Maine
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
You blocked me on facebook and now youre going to die!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Pages: [1]   Go Up
Jump to: