Soft resistive buttons. How to activate?

Hi, i have a device with those classic rubber pcb buttons. I think they work trough resistence.

|500x141

I have the need to drive a device and in particular the turn on button wich has to be keeped pressed for 3seconds for the device to be turned on.

I managed the make it work with the analog write on pin A1, i was guessing if there is a more elegant or pratical way to make them go.

Here the code i used to make it start. Hope it will be usefull.

analogWrite(A1, 0); delay(1100); analogWrite(A1, 50); delay(1100); analogWrite(A1, 150); delay(1100);

I managed the make it work with the analog write on pin A1,

You do know that analogue write does not produce an analogue signal. It produces PWM.

So if an analogue write worked then simply use a digital write instead.

analogWrite(A1, 0);

Is a nonsense anyway, the A1 pin is not capable of PWM so you are just using a digital write.

Those buttons don't work with resistance (or at least don't depend on resistance). You just have to connect the two pads that make up the button together. How to do so depends on the circuit.

analogWrite(A1, 0);

Is indeed bs. A1 is not capable of PWM (= analogWrite). And if you use the function on a non-PWM pin it just act as digitalWrite(x, HIGH) for >=128 and LOW otherwise. Only thing is does do is setting the pinMode to OUPUT.

This is what I found when I did this project:- http://www.thebox.myzen.co.uk/Hardware/Crazy_Golf.html The buttons of the sound module could be directly connected to the Arduino's digital output pins.

Blu-Vector, Do you see how (in S4) the gold print is arranged like 2 combs pushed together? One comb is one contact, the other comb is another contact. The soft button is coated with a conductive film, and when pushed it connects the two combs. This IS a switch. This type of switch has a higher resistance than most switches, and can also handle only much lower currents. You can consider them ON or OFF, 0 ohms or infinite ohms, but whatever you are turning on/off cannot draw much current. (like less than 10 mA)

It is used just like any single pole single throw switch (i.e., common light switch). One contact is connected to ground OR power, the other is connected to the device to be turned on or off, the other side of the device goes to the opposite Power OR ground. In this case, the controlled device is an arduino pin, and that pin should be an input. (pinMode (INPUT) or, better yet, (pinMode(INPUT_PULLUP).

In the latter case of input pullup, you connect one side of the switch to ground, and the other side to your pin. The pin normally sits there in a high state, and when you push the button (or connect the 2 contacts) it drops to a low state. In other code, you then compare what state the switch is in, and do the action you desire for the state the switch is in.

In (DS2), there is a LED as well as a switch. (Probably intended to light up a translucent button.) You do not have to light the LED to make the switch work, the LED and the switch are separate components on the board. If you want to light the LED, be sure there is a current limiting resistor in the circuit. (There is not one shown in your picture, but there is likely to be one on that board. You must be sure.)

Is this a section of a remote control? Can you tell us more about it? Model? MFG.? Original use?

-fab

Fab, he is not trying to use the buttons as an input for the Arduino. He want's to control the function of the button with an Arduino. So the whole INPUT/pull up etc part of your story doesn't apply. But yes, it's just a button like every other button.

Remote control buttons like that are usually matrixed. The easy way out is a small reed relay. Arduino could drive small 5volt ones directly. Leo..

Wawa: Remote control buttons like that are usually matrixed. The easy way out is a small reed relay.

Indeed they are likely to be matrixed.

In which case the even easier and more compact way is to use a 74HC4066 for 4 buttons. If you figure out the matrix fully, it is possible to use a 74HC4051 to control up to eight buttons sharing each common line.

40xx electronic switches will also work if... power/ground can be shared.

It is only necessary that the remote controller voltage be equal to or less than the Arduino supply and either positive or negative supply is common.

Since most remotes use two (or possibly three) AA cells, this is almost always.

So you always leave your Arduino on. Leo..

Wawa: So you always leave your Arduino on. Leo..

If that is a concern, power the HCMOS chip through a diode OR gate.

Wawa: Remote control buttons like that are usually matrixed.

Not in my hacking experience they aren't. See my previous link about the sound effects module.

Also given that the OP says he can get it to work with a digital signal matrixing is clearly not the case here.