Electronic – arduino – Interfacing without an Interface

arduinointerfacemicrocontrollerrelaysensor

I have a project where I need to interface with a machine that was never built to be interfaced with.

I basically want to programatically press physical buttons on the machine(critical) and also sense(optional) when they have been pressed.

The circuit below shows a circuit that I've been thinking of (blue represents existing circuitry):
enter image description here

To press the button, I was thinking of simply adding a solid state (or normal) relay in parralel with the switch (press button).

My question is about sensing that the physical button was pressed.

Option 1 in the image above shows that I would have to cut into the circuit and insert a relay in series.

Is option 2 possible? Can I coil a wire around the existing wire and so induce a voltage/current in the coil that I could read from a MicroController? I don't yet know what voltage or current will be running through that cable. Not sure if it's going to be 5V or 35v, but it would probably be DC though. How many turns would be required if the MicroController is runnning on 5v or 3.3v?

I've seen this type of sensing on some taredown videos online of high end lab equipment, but never tried it myself.

I'm trying to leave as much of the existing circuitry in place as possible so as to (ideally) fully preserve any warranties that come with the machine.

Assumption

  1. The switches will be low current micro swicthes as this is a high-end consumer device.
  2. The in existing circuit VCC will not be at the same voltage as my MicroController

Best Answer

If the switch is connected to a pin of a microcontroller, then the lead will have very little current, and will not be able to drive a relay or otherwise be current-sensed. However you should be able to sense whether the switch is pressed or not by looking at the voltage of the switch terminals.

With the switch open, measure the voltage on the two pins. One might be ground (0), and the other a voltage like 3.3v or 5v, usually referred to as Vcc Then close the switch. Depending on whether there is a pull-up or pull-down resistor, one of the leads will change to match the other (both will now be ground, or both will be Vcc). You can then use that lead as the indication of your switch closure.

As you proposed, you can use a solid-state relay across the contacts to simulate the switch closing.