Go Down

Topic: Push button resistance or bounce issue ?? (Read 906 times) previous topic - next topic

dan_movie


Hi All,

Need help understanding what is happening to my circuit and to adjust accordingly...

I had a working push-button sender & receiver system over Xbee :: push the button activate a remote relay.
I wanted to make my remote smaller so I bought these buttons on Amazon : https://www.amazon.ca/gp/product/B07DDG8T8V/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1
Now my circuit keeps blinking without me touching the button. When I compare with the old ones I had (approx 10 Ohm resistance when pushed) these new buttons give me about 40 to 60 Ohms depending on which pins I use.

Is the added resistance causing the Arduino to think a button is pressed when it's not (bouncing) ?
Do I compensate by increasing my pull-down resistor, I had a 5.1kOhm while supplying 3.3v to the button, I went to 10kOhm still doing the same blinking.

Any ideas would be greatly appreciated.


adwsystems

Since there are multiple ways to connect a button to an Arduino, you will need to post a schematic so we can help you.

dan_movie

#2
Dec 07, 2018, 10:24 pm Last Edit: Dec 08, 2018, 01:39 am by Coding Badly
See attached basic schematic.

I just tried to power the button with 5 volts instead of 3.3 and it seems to have solved the issue.

I must admit I don't understand why.




Paul_KD7HB

I think you are getting what you pay for. Cheap switches. A proper switch would have much less than 1 Oh resistance.

Paul

dan_movie

Thanks Paul, I figured that by now.
Still I am not so good an electronics - more of a hobby for me - but I am curious to know if the resistance
was causing the blinking or is it just bad contacts in the switch, and why would a higher (5v) voltage solve the random switch state - that I could not even seem to stop when pressing on the button.

BabyGeezer

Thanks Paul, I figured that by now.
Still I am not so good an electronics - more of a hobby for me - but I am curious to know if the resistance
was causing the blinking or is it just bad contacts in the switch, and why would a higher (5v) voltage solve the random switch state - that I could not even seem to stop when pressing on the button.
i'm not good either, but why would you connect the button to 3v3 if it is a 5V logic setup ?

maybe the "HIGH" reading on the button was right on the threshold ?
Attach your images to be viewed directly - THIS WAY;
https://forum.arduino.cc/index.php?topic=519037.0

WattsThat

#6
Dec 08, 2018, 01:34 am Last Edit: Dec 08, 2018, 01:35 am by WattsThat
Sorry, im not buying the cheap button theory. This comment:

Quote
Now my circuit keeps blinking without me touching the button.
says the problem as nothing to do with contact resistance because you're not pressing the button. Now, if you measure the contact resistance and you have 60 ohms without pressing the button, well, then yes, that's a crappy switch.

I'm more curious why you were using the 3v3 supply when the Nano Is a 5 volt device. Granted, the inputs should be high with 3 volts in but did you actually measure the pin voltage? Perhaps you pull down isn't really connected. There are several possible explanations but a high resistance contact resistance switch causing false high levels isn't one of them.

Vacuum tube guy in a solid state world

larryd

You may have a bad connection.

Show us a good image of your circuit wiring.




No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Grumpy_Mike

Many cheap push buttons have a minimum voltage that they will work at. I have some that will not work on a 3V3 system like the Due but are quite happy working at 5V. It is even written in the spec sheet under maximum and minimum voltage.

I think there is some sort of skin or barrier, or oxide layer and you need a certain voltage to break it down. Maybe it is because the metal is aluminium. Anyway it is a thing that is recognised.

Slumpert

Curious why would you even care about switch bounce on the transmitter if your remotely controlling a relay wirelessly.. 

Control " bounce " seems better placed in the receiver actually powering the relay.

Grumpy_Mike

Curious why would you even care about switch bounce on the transmitter if your remotely controlling a relay wirelessly.. 
The OP said:-
Quote
Is the added resistance causing the Arduino to think a button is pressed when it's not (bouncing) ?
That is not a description of bouncing. Bouncing occurs only when the the switch is being pressed or released over say a 25mS period.

If as the OP says "the Arduino to think a button is pressed when it's not" that is a floating input problem. The fact that he thinks this is called bouncing is an error on his part.

dan_movie


to answer some of the questions....

I started out based on info from this webpage....

https://spin.atomicobject.com/2016/07/18/xbee-tutorial/

She was using 3.3v - i imagine cause she was supplying power to the Xbee with the same line.
I did same and it was working just fine with some bigger switch I had.

I wanted to handle button bounce, because the Xbee would send out multiple button presses and the relay on the receiver would trigger on & off repeatedly. I took care of that via code.

The newly installed button was creating a mess of relay triggering, etc. So it opened up a bunch of questions for me - admittedly, not all thought thru. I wondered if bounce was not handled ok or if my pull down was affected by the resistance of the button itself - so that the button was floating and not really at zero.

I don't fully understand the resistor value selection to have the "proper" pull down but generally speaking, if my 5.1k was doing the job at 3.3v with the old button offering almost no resistance....would it not be even more effective with the new button adding an extra 60 Ohms to the 5.1k that was in my circuit ??

When I moved the button V+ line on the arduino from 3.3v to the 5v pin things were back to normal,
so I don't think I had a bad connection unless it was the 3.3v pin on the arduino itself - all other cables did not move.

thanks for the help everyone. I always appreciate the feedback.

 

dan_movie

One more point on the bounce...

I thought it would be better handled at the "sender" unit, because the xbee would transmit false button presses that would just load the network and possibly a receive buffer at the other end. Also it is my understanding that the xbee radios use more power to transmit so I would shorten battery life if I let it send anything - i figured I would be better served by making sure there is a "proper" press at the sender level then once that is confirmed, send the one time message.

Paul__B

You are correct in regard of de-bouncing, but as Grumpy_Mike points out in #10, you say
Now my circuit keeps blinking without me touching the button.
which clearly is not contact bounce.

dan_movie

yep, i agree.

my message subject should have been....Push button resistance, floating state or bounce issue ??

AND I should have tested more before posting  :)


Thanks everyone for the feedback !

Go Up