I am trying to use the Arduino as a switch for an external circuit.

I first thought about using a shift register, but this wont allow me to switch the external circuit. Here is a little sketch of what I want to do : Desired circuit

So basically I got this external circuit with a 3 position switch. And I want to replace this manual switch with an Arduino so it can be controlled by a PC, without influencing the other circuits Voltage or Amps...

Any suggestions ?

  • Is it important for the switch to have 3 positions? Would it matter if two contacts can be on at the same time? Why use a shift register if you only need 3 positions, you could use 3 I/O pins? What voltage/current will go through? – Paul Jun 19 '16 at 9:57
  • 1
    I will start off with three but it should be expandable to lets say 32 or more later on. Temporarily it wouldnt matter if two were on at the same time, but after some time only one has to be on. What do you mean with 3 I/O Pins ? Voltage will be max 1V at 100mA max. – Tom Jun 19 '16 at 10:17
  • Since you are only switching low voltage, you could probably use a transistor instead of a more expensive relay. – Gerben Jun 19 '16 at 12:56
  • Yeah but transistors would influence the currents and th voltage in case of not being opened – Tom Jun 20 '16 at 8:27

Three-position makes it a little more tricky than normal.

The simplest option, though depending on what the circuit is, maybe not the safest option, is to use three relays.

enter image description here

Switch only one relay on and it is the same as having the three-position switch in that same state. Switch that relay off and switch another on and you have changed the switch position.

The danger is that this arrangement can have two or even three relays on at once, something that can't happen with a switch. Also how you do the switching could be critical. Switch one relay off, then add a delay before switching the next one on, so that the previous one has a chance to switch off properly first. That way you avoid having two on at once. Of course, depending on what it is you're switching, that may or may not be an issue.

The safest option, though the hardest to create, would be to physically move the existing switch with, say, a servo motor. Without knowing a little more about the mechanics of your switch I can't really advise more on this option.

| improve this answer | |
  • Hello, yes it needs to be at least 3... It should even be expandable to 32 later on. I tought about relays but it seems to be a hassle to get them powered and controlled by the arduino? We cant have anpther power source.... – Tom Jun 19 '16 at 10:14
  • The use 5V relays and use the Arduino as the power source. Tip: buy pre-built relay modules with the driver circuit built in. They are cheap enough, and you can get them in up to 8 relays to a board. – Majenko Jun 19 '16 at 10:16
  • Also about the relays being on at once isnt too bad temporarily. Te mechanical switch has to go away so no way to use a servo. This sounds like a good way to go. Do you know any prebuilt modules easily available in europe / germany? – Tom Jun 19 '16 at 10:19
  • There are plenty made in china on eBay. Cheap, easy to get, etc. SainSmart are a common maker of them. They have a good selection. – Majenko Jun 19 '16 at 10:19
  • Ok perfect thanks, one more question, will the relay have an influence on the current and voltage tat flows trough my external circuit ? – Tom Jun 19 '16 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.