Simulating button presses on unsupported device

Hi everyone,

long time lurker, first time poster here.
I want to automate a device that runs on 5V DC. It is a PCB with SMD push buttons. I would like to hook up a D1 on these buttons to short them to make the device automateable (real word?).
Now I’m not the best at electronics.

I was thinking about using a relais, but those I have are rather big and maybe overkill?

I would love a small solution. The problem is: I don’t know what the buttons do, exactly. Do they pull the microcontroller input to ground or 5V?
I was thinking about optocouplers, but those have transistors and I would have to know how to wire them up and I may need a resistor in there to limit current.

What could I use, hopefully without a big cirquit, that would work without me knowing the polarity on those switches or the load they switch?

Attached is a picture of the switches I want to short on the PCB-board!


Grab a multimeter and find out! If you don’t already have one, they’re cheap and will be immensely useful for any future projects as well.

I had a similar situation with a fan. The buttons simply shorted to ground, so I was able to simulate button presses directly from my microcontroller pins.

1 Like

How do I find out? The device was kinda expensive and I don’t want to break it before even starting :sweat_smile:

I can see what looks like a Microchip PIC uP and a WS2812 LED, but are you sure it’s all SELV 5V? (i.e. uses batteries or a fully isolated external PSU).

A capacitive dropper PSU can run 5V uP, but touch any part (including “0V”) and you’ll get a shock.

There’s what looks like a bridge rectifier bottom left, and although there’s no magnetics on the PCB for a boost/ buck chip, many current devices run at low voltage, BUT the PSU is still referenced to mains voltage.

Relays are bulky, but can give galvanic isolation. Optocouplers can also work, but in both cases you need to know if the input is positive or negative logic (i.e. pull high or pull low).

For hints on reverse engineering (and ubiquitous BigClive link):

1 Like


Thank you for the long explanation.
You are right about the microcontroller.
The whole thing runs at 24V and there is a regulator regulating down to 5V for the logic circuit.

Also thank you for the link I will read up on it!
I was thinking about using opto couplers but had my reservations about polarity and max current, so I thought a (reed) relay may work better.
On the other hand the 5V regulator has a max current of 100mA so this might become a problem, too…
To be honest I had hoped that simulating two buttons would be easier than it ultimately was!

Just checking so you’re safe (yes, I am an Engineer!). The 4x diodes and large array of decoupling capacitors made me wonder about the voltages.

The two transistors/ mosfets and diodes in the middle left (and the pad layout, and big lump on the other side…) suggest there is a bi-stable relay switching something (i.e. two coils, latching contacts).

I’m in the UK, but latching relay, diodes, 24V (possible AC) - thermostat?

I’d trace the active contacts on the button pins (only 2x connections, straight through from side to side to give 4x), then trace them back to the uP. Check the other button contacts - all may be the same (looks like a ground plane). Power the device up on a test bed (isolated PSU), measure the voltages on the uP pins from the buttons and try a shorting wire, then an optocoupler.

I’d also check the voltage AC and DC from both power supply rails to protective earth / ground just in case the supply is not isolated from the mains.

You can use a uP output pin to drive the buttons, but it’s best to leave them as tri-state or floating when not used (if you don’t, pressing the button manually could damage the output - something like a 1k resistor in series might also help).

Thanks for the concerns! The device is a roller shutter motor and it runs on 24 DC all the way through. I decided to work with opto-couplers. It works quite well. I measured the way that current flows and it is never more than 9 V. The opto.couplers can do 30V. I tested it and it works well, but as I soldered them on I destroyed the PCB, so I have to wait for a new one to arrive.