Simulating button press

Hi

I have a ticket dispensing machine that I'd like to control with arduino. At the moment there is a wire that, when I connect it to ground, spits out a ticket. How can I control this with an arduino? Would i do something like change the pin from pullup to pulldown when I want it to trigger. Or is there some other hardware way to do this?

Thanks for your help

The safest and easiest to understand way to do this would be to use a relay with its contacts wired across the switch

At the moment you don’t describe what is being switched ie what voltage and current are going to ground when the switch is closed. It could be a signal level voltage that arduino would be happy with it it could be a high voltage and likewise there could be little or lots of resistance in the circuit.

You could test with a multimeter. Then your options are:
Let the arduino drain to ground: attach to pin input pull-up engaged and write low when you want to close the switch (simplest but riskiest if you haven’t checked everything)
Use an electronic switch like a mosfet or transistor.
Use a relay module (most protected for arduino and you don’t need to test anything)

Thank you :slight_smile:

The ticket machine is 12v and is powered with its own supply. It's a cheap ticket machine I got from aliexpress and I can't find much info on it. here's the link Currently there is no switch i'm just touching the out wire to the gnd of the ticket dispenser - when I measure between that it's 6v.
What i have is two wires that come off the machine. When I touch them together they spit out a ticket. I want to use a proximity sensor to make that connection. I think from having a look at relays this is the way to go. Will a relay make a connection (push a button) when I tell it to from the arduino? I've done a fair bit of audio electronics but not worked with relays before.
thanks

You can control the relay from the Arduino and turn it on or off depending on conditions that you code.

When turned on the relay will cause contacts to be connected just like a switch and it is also likely to have contacts that are normally connected and disconnect when it is powered

Awesome. Thanks for your help

Just make sure and get a relay module suitable for arduino as it won’t power the coil on its own. Lots of tutorials online of varying quality. Also make sure that the wires you are rooming through the relay are not for an inductive load otherwise you will need a fly back diode to protect the relay contacts