Go Down

Topic: arduino finger switches & stuff (Read 1 time) previous topic - next topic

zehneinsvierzehn

hey there!

some questions occured to me while building a simple (my first) arduino-based controller for audio applications
i've got 4 digital pins left so i decided to put in 4 buttons/switches, this is what i'm not sure about:

1. can i use like 2 thumbtacks next to each other just for a simple body contact touch switch? i want to have each of the 4 digital pins to read something while having the finger pressed and linking the 2 thumbtacks. i dont have any standard switches here, and i thought, this could be quite easy to realize with the 2 thumbtacks per switch. searching the web, i just found instructions using two darlington transistors, why should i? i mean i could just do connection by putting a finger onto the thumbtacks and have no connection by not doing so (pull down design), is there any more to it?

2. is there a possibility of building a switch with just one thumbtack (or one nail or whatever) coming out of my case? i read about capacity sensing but didnt really get how to programm the arduino for this... and i read about "touching" the base of the transistor to have it passing through current from collector to emitter... would that work that easily?

whats also not clear to me:

3. using two thumbtacks as a body contact for analogue input, it worked with pull down, but not with pull up circuit! why is that? is there a problem using a pull down style circuit? i mean people just say "its not so good, better do it pull up". so can i also do it pull down, can it really cause any problems?

4. can you "capsense" a distance? or is it just for on/off, and for distance sensoring, you have to use ultrasonic or infrared?

5. can i use a simple switch to switch between two sensors, one sensor at a time is chosen to run into one analog input, like this?:
- the switch has a left, a middle, a right pin. connection is either made between left and middle or between right and middle. middle is always connected to analog input pin of arduino
- analog input pin of arduino is also connected to ground but with a 1M resistor between
- i have a piezo connected to ground on the one side, the other side is going to the left pin of the switch.
- i have one thumbtack connected to 5v, the other one connected to the right pin of the switch. they work as a body contact

6. is there definitely no kind of danger using body contacts (two thumbtacks, one connected to 5v, one to GND and analog input pin)? i mean can any harm be done to the body concerning electromagnetic fields or whatever? could usb possibly draw more power over a short period of time? the arduino is connected to a computer constantly via usb. i dont have any clue, on the one hand people just say theres no danger at all, while others say "if you dont feel good about using body contacts and arduino, better dont do it"

7. i want to use a potentiometer to adjust the sensivity of an analog input, and typical values for that are up to 10M, but my potentiometers are just like 10k-100k. i have 1-10M constant resistors. can i somehow have those potentiometers control the whole resistor range and not just like 1-10% of the full range i get with the constant resistors? because putting them in series just makes me add a little more resistance to it.

thanks a lot for answering those longer... questions
jan

pwillard

#1
Apr 15, 2011, 07:32 pm Last Edit: Apr 15, 2011, 07:40 pm by pwillard Reason: 1
Quote
1. can i use like 2 thumbtacks next to each other just for a simple body contact touch switch?


You need a HIGH GAIN amplified input to read the small change that will occur when your finger (a form of leaky dielectic) touches the contacts.  You will need to convert that small change to a TTL Binary signal the Arduino pin can recognise.  That was why the circuit you found used a high gain Darlington amplifier pair.

Quote
2. is there a possibility of building a switch with just one thumbtack (or one nail or whatever) coming out of my case? i read about capacity sensing but didnt really get how to programm the arduino for this... and i read about "touching" the base of the transistor to have it passing through current from collector to emitter... would that work that easily?


With high enough amplification and a some what unstable enough circuit, yes, you can do that. You need a circuit that is almost ready to "flip state" and just needs a little prodding.  So, just a thumbtack by itself... unlikely to be any sort of reliable.



Quote
3. using two thumbtacks as a body contact for analogue input, it worked with pull down, but not with pull up circuit! why is that?


Works or does not work is likely due to transistor type (NPN versus PNP).   Pull up / Pull down hardly matters...  as long as you know WHY the pin state  changes, you can make a logical decision (code) around it.


Quote
4. can you "capsense" a distance? or is it just for on/off, and for distance sensoring, you have to use ultrasonic or infrared?


Capsense is more complicated than what we are talking about here but it is "touch" based.  Much is possible, however it depends on how much electronics you want to throw at it.  For example... Look at a theremin circuit.

http://en.wikipedia.org/wiki/Theremin

Quote
5. can i use a simple switch to switch between two sensors, one sensor at a time is chosen to run into one analog input, like this?
:

Yes, look at using a 4051 or maybe 4016... depends on what you can get you hands on and how you want to use them.



Quote
6. is there definitely no kind of danger using body contacts (two thumbtacks, one connected to 5v, one to GND and analog input pin)? i mean can any harm be done to the body concerning electromagnetic fields or whatever? could usb possibly draw more power over a short period of time? the arduino is connected to a computer constantly via usb. i dont have any clue, on the one hand people just say theres no danger at all, while others say "if you dont feel good about using body contacts and arduino, better dont do it"


NO DANGER

Quote
7. i want to use a potentiometer to adjust the sensivity of an analog input...


Let me stop you here... Adjusting a POT on an analog input... but itself... has nothing to do with sensitivity.  Sesnistivity is about gain... again amplification. You are not showing that you are wanting to use any kind of amplification... so you only have "potential"... not sesnsitivity.
All a potentiometer really does is act like the two reistors in a voltage divider circuit and adjusting the pot changes the values.

zehneinsvierzehn

#2
Apr 16, 2011, 09:25 pm Last Edit: Apr 16, 2011, 09:37 pm by zehneinsvierzehn Reason: 1
@ pwillard - at first thanks for answering!
then:

1.
Quote
You need a HIGH GAIN amplified input to read the small change that will occur when your finger

...hmm well but i tried this: i connected one thumbtack to 5v, the other to ground via 1M resistor and to analog-in...
the result was: having my fingers touching both thumbtacks a bit gave me a value of about 200, pressing harder did 400-600 and touching with a wet finger did like value 1000, which is nearly 100% of the 5v, isn't it?
why cant i do this with the digital pin, as well? i mean if values just go up to about 200, i could (software-wise) still convert the values to a boolean state, setting the threshold to 100 (above giving 1, beneath giving 0) or so!?

2.  
Quote
With high enough amplification and a some what unstable enough circuit, yes, you can do that. You need a circuit that is almost ready to "flip state" and just needs a little prodding.  So, just a thumbtack by itself... unlikely to be any sort of reliable.

could you explain that just a bit more? i'm no native english speaker, i'm sorry, i don't get what you mean by "prodding"
and what kind of a "flip state" circuit could that be

3.
Quote
Works or does not work is likely due to transistor type (NPN versus PNP).   Pull up / Pull down hardly matters...  as long as you know WHY the pin state  changes, you can make a logical decision (code) around it.

(talking about two thumbtacks connected via finger working pull down, but not pull up)
okay... but i didnt use any transistor at all...
what i know is that i can flip things over easily and make a "LOW" a "1" and a "HIGH" a "0", so that my software gets "1" when pressed, talking about pull up. but it just works pull down, and i wonder why. people say pull down is not as safe and good working as pull up. is that right?

5.
Quote
Yes, look at using a 4051 or maybe 4016... depends on what you can get you hands on and how you want to use them.

(talking about simple switching)
what about a real simple switch?:

i'm fine with the rest of your answers, thank you! well, not totally true, but i'll come to one thing later on, and thats the danger of finger switching

---

@ KE7GKP - thanks to you too!
but:

3.
Quote
Your question cannot be answered because your circuit details are not disclosed. Including the value of the pull-up/down resistor(s)?

i'm talking about very easy circuits that are presented here:
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html
(in the middle of the page there are pictures of pull-up and pull-down switching)
i'm using 1M resistors.
is that still difficult to answer?

5.
Quote
I can't tell what you are asking here?  Please describe exactly what you are trying to do. I can't follow your proposed solution?

hmm... its quite easy actually...lets see if i can describe it in a better way:
i have one arduino analog input left, the arduino sits inside a controller box with potis, buttons etc., but i want two analog-input-sensors to be selectable by a simple switch
... so i'm thinking about connecting the middle pin from the switch to analog-input-pin and to ground and one other pin is connected to the piezo and one is connected to the body contact (the minus or ground poles of piezo and bodycontact go into ground as well). so now i can switch between either the piezo signal going into the analog-input or the body-contact-"signal". is that wrong?

---

6.
and now comes the most important part to me.
my question number 6 is asking: is there any danger using arduino usb-plugged and body contacts?
the first one said "NO DANGER", the second one said "there is most definitely a hazard"
now - what is true? could anyone explain it again to me so that i'm just really sure about this?
i don't want to use a shield like the JK-devices-shield, because i have only little space on the front plate of my controller.
what i have is: one thumbtack is connected to 5v, the other one is connected to ground via 1M resistor and to analog-input of the arduino.
the arduino is usb-connected to my macbook. i don't use any external power source.
if i put my fingers on the thumbtacks, what could happen then?
i'm sorry that i am not really getting the point of the danger, KE7GKP, i mean... 5v?
when does it go dangerous? at 5v and 40mA? or how much can arduino give out? 500mA and 5v max for a short time? (i think i read this somewhere)
PLUS: isnt there a difference between DC and AC? do i have DC here?

---

roll on, give me answers, please, and... THANKS for any!
i really appreciate your help as people i asked about this couldn't really help me and i want to go on with building
(its my first ever electronics project, and i'm very at the start, slowly getting to know about transistors, having understood like half of the resistor-ampere-voltage-relations)

greetings,
jan

elandd2011

A few year ago i needed some similar for one job and i solved the problem with this

elandd2011

improved circuit

zehneinsvierzehn

thank you! that looks good and is quite directly what i'm looking for
i mean i dont get all of that, but if it works, why not just try it out?

but, again, what about touching the circuit while having it connected to ardunio 5V-usb-notebook-wall outlet ground?
what about the danger that KE7GKP is talking about all the time... i mean if it can get really dangerous, why do just so few people care?
and how do you do the isolation so that its really secured? my controller is built into/onto a metal box, so... thats quite risky, isnt it?

elandd2011

It is not dangerous at all,trust me
In the USB you have only 5 volts so you never can fill that power yourself,the sensibility  for some people start around 28 DC ,but normally every one need 48 DC volts or more.I need 66 DC volts or 85 AC volts in my fingers

pwillard

If you do some research, you will find that the AMPLIFIER posted in the PDF is what I meant when I said:
Quote
With high enough amplification


Your finger and an input PIN and a resistor is not going to work right.

Go Up