I am trying to connect a Raspberry Pi / Arduino to a coffee machine. The coffee machine has a simple function, with a single button (momentary switch, on a DC cicuit) to dispense a coffee. I'm trying to add a parallel control to this button, such that the coffee machine can be triggered electronically (app, website, IR remote etc).

I have seen many examples of doing such projects with transistors as switches. I bread-boarded an example myself, using an NPN transistor in the common emitter configuration, with the load connected between the power supply and the collector of the transistor. That prototype worked great.

Opening up the coffee machine, the switch I want to add the transistor to is connected between the load and ground, so as far as I understand, this would mean needing a common collector setup, which won't be possible as the voltage of the secondary circuit is higher than the signal to the base.

If any of the above assumption is wrong, corrections are welcome. Perhaps there is a way..

If I can't use a transistor here, what alternatives could be used to control the secondary circuit?

Software engineer here, learning small pieces of electronics on the fly for this project, so you may need to assume less basic understanding than usual.

  • \$\begingroup\$ An electromechanical relay? Be aware these bounce. But it is unclear what you mean by "the voltage of the secondary circuit is higher than the signal to the base". Transistors are used to allow microcontrollers to use their little 3.3V pin to switch voltages which are much higher. You may be misinterpreting the operating modes of transistor. The transistor conducting when acting as a closed switch causes the Vsd or Vce to fall below the Vgs or Vbe if you are driving the gate/base hard enough, even if Vgs or Vbe is initially below Vsd or Vce when the switch is open \$\endgroup\$ – DKNguyen Oct 10 at 20:40
  • \$\begingroup\$ There are DC controllable relays that you can plug into that are safe, you should probably look at one of those then start mashing up AC mains (which I don't even like to do) \$\endgroup\$ – Voltage Spike Oct 10 at 20:52
  • \$\begingroup\$ @DKNguyen Fair question. I gained a lot of understanding from this post: electronics.stackexchange.com/questions/38285/… By, 'the voltage of the secondary circuit is higher than the signal to the base', I was referring to where the accepted answer states: 'So if the load voltage is higher than the control voltage you can't use common collector.' Am I misunderstanding that answer? \$\endgroup\$ – Matt Oct 10 at 21:49
  • \$\begingroup\$ @VoltageSpike Thanks, I should have been clearer in the post, but the button being controlled isn't a power button, nor on an AC circuit. It's a momentary switch on a DC circuit and everything is already powered on, so no need for any AC involvement here, thankfully. Relay could still work, I'll check that out. Any reasons to use a relay over an optocoupler or something else still..? \$\endgroup\$ – Matt Oct 10 at 21:52
  • \$\begingroup\$ If you use a relay, you don't need to know if the switched circuit is AC or DC, or what polarity if DC. Most optocouplers will only control a DC circuit of the correct polarity. \$\endgroup\$ – Peter Bennett Oct 10 at 21:56

Your Answer

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

Browse other questions tagged or ask your own question.