Proble with button

I’m new in arduino and I’m developing a project on Max/MSP using one piezo electric film as vibration sensor. I have not problem with that it works fine. And at the same I’m trying to use a simple button to send a signal to the program when it is pressed. Here is the problem. I have use the circuit in the tutorials, I use a 10kOhm resistor conected to +5v in arduino. The problem is that time by time I receive a change of state from the button but I not touch it. It’s like an erratic jump from the digital input.
Please do you have any suggestion? I appreciate any idea about it.
Thank you very much in advance.

That 10K resistor is a lot more than I'd expect to see used with a switch. I would suggest that you replace it with either a 5.1K or 4.7K, and see if that helps. The other thing (and this is an easy enough mistake to make) is to be sure that your resistor goes from +5V to one side of the switch, and to the input of the Arduino that you think it does. The other side of the switch goes to ground, of course.

As far as I know, a 10K is a perfectly fine pull-up; the internal pull-ups you can ask the chip to employ are 20K.

In Echi's other identical copy of this question, I suggested a pull-down arrangement but Echi showed the circuit being used which should be just fine as well. If Echi is using button switches like all these photographs we were trading around, I would check that the switch is actually seated well into the breadboard, because sometimes they don't. But even if they popped out, a proper pull-up or pull-down would just make the circuit stay at one level.

Yes Halley is correct the difference between a 10K pull up and a 4K7 pull up is not going to cause the malfunction indicated. My guess is that the wiring is not correct or there is an intermittent contact. I assume the joints are not soldered and some sort of solder less bread board is used, these can be unreliable.

I understand your doubts, I also distrusted, then I did a new circuit, I used new components, I have soldered it carefully, but I still having the problem. I guess that perhaps is a problem generated because the Max/MSP patch I'm working on is heavy, it uses too much CPU, then the communication between arduino and the computer is having troubles. I can not understand it in another way. The circuit is excessively simple to have such problems. Thank you all for your advices

Are you sure that it is the Arduino that is causing the false triggering. The best way to test this is to have the button also light up the LED on the board for a second or so after it has sent the data to Max. Then you can eliminate either the Arduino or Max from being the system giving you trouble.

Thank you Grumpy_Mike, in fact I think the heavy patch and the high CPU usage in the MAc is causing the problem, not the >Arduino itself. I think your proposal is a good idea to discover who is causing the problem. I will tell you later

hi! my name is Laura. I am also using a piezo film sensor. but in my project it seems not seems not to sense anything, I think I am wrong in connections.can you show me how you build it? thanks!!!! Laura

How are you connecting the piezo sensor to the Arduino? Are you using an amplifier? Note that this thread is about connecting a switch, not a piezo sensor.

Hi Laura, here I send you the circuits I have use for the piezofilm, but note that we are merging subjects, we were talking about buttons.