So the thing is, I'm a computer science major and working on an IoT project which is a coffee machine powered by a Particle Photon and controlled with an Amazon Alexa skill. The problem is I have absolutely no experience with electrical engineering and am terrified I'm going to hurt myself with this. I have a bread board, jumper wires, and relays and have done a fair amount of tutorials with the photon and arduino so I know the basics of how they work.

But today, I tore into the coffee machine to see the wire configuration and am at a complete lost. I've never done anything like this.

The coffee machine is operated by a simple ON/OFF switch. You flick the switch ON- it brews coffee. I just don't know how to achieve that through a micro controller.

I've included some photos of what the inside of the coffee machine looks like. Any help in pointing me towards the right direction would be great. I truly have very little idea where to start with this.

photo 1 photo 2 photo 3

Thanks so much! Like I said, a total newbie at this so sorry if I sound super naive and out of place.


closed as off-topic by Chris Stratton, Elliot Alderson, Finbarr, TonyM, JYelton Oct 18 at 18:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on the use of electronic devices are off-topic as this site is intended specifically for questions on electronics design." – Chris Stratton, TonyM, JYelton
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    \$\begingroup\$ Purchase an off the shelf Ethernet enabled power switch ($10-50), leave the machine on, turn on/off power using the equipment . Such a simple thing and yet it works. \$\endgroup\$ – crasic Oct 13 at 23:36
  • 2
    \$\begingroup\$ If you leave the switch "on" and simply plug it in, will that work? Better not to modify the internals, not only is their high voltage (and water potentially) but safety mechanisms to prevent fire and shock. \$\endgroup\$ – Spehro Pefhany Oct 14 at 5:48
  • 1
    \$\begingroup\$ It's a project for a class, so it has to be done within some requirements set by the professor. I appreciate the suggestion with the smart outlet, but I'm not sure that would get me the A I'm looking for. \$\endgroup\$ – snoofle Oct 14 at 15:07
  • 1
    \$\begingroup\$ There is no point for a CS project to demonstrate knowledge of power switching electronics. It is out of scope for the field. \$\endgroup\$ – crasic Oct 14 at 15:32
  • 1
    \$\begingroup\$ If you care for an update, once asking my professor about this he gave me what seems like a really good solution for somebody like me trying to control 120V with a relay. This seems like it was made for people who do not have knowledge in EE, but wish to make wicked IoT projects. Thanks for all the help! \$\endgroup\$ – snoofle Oct 14 at 22:24

Since you're a beginner at electrics/electronics, I strongly advise not attempting to modify the coffee machine or work with mains voltages unless you can find someone experienced to check your work. Instead, plug the coffee machine into a ready-constructed outlet that you can switch on and off using a signal from your Photon. If you're in the US then this looks ideal, though of course it's your responsibility to be sure it's suitable for your intended use.

For a more general answer if the linked product is not suitable: obviously there are Wifi-connected mains sockets available (e.g. the TPlink Smart Plug and many others) that you could control via their API, but if you or your project supervisor feel that using an off-the-shelf IoT device would be 'cheating' then another idea would be to get a 'dumb' remote-controlled socket, like this or the equivalent wherever you live, which is operated by a low-powered radio transmitter. You could then modify the remote so that a digital GPIO output from the Photon can 'press' the button on the remote by connecting the two contacts of the button together.

You could do that using a reed relay, as long as the Photon's output can supply enough current to drive it, or an optoisolator - I'm sure you can find example circuits using either of those devices on here or elsewhere.

  • \$\begingroup\$ It's ok, but still far from ideal. No CE mark or UL listing, no spec for isolation and safety, you trust the word of the manufacturer that there is "isolation", this is tolerated by hobbyists, but unacceptable for product development. If i t burns your house down, insurance won't pay for it. \$\endgroup\$ – crasic Oct 16 at 17:23
  • \$\begingroup\$ See edit. It's not for sale in the EU so no reason to expect a CE mark? The question is not about developing a commercial product. \$\endgroup\$ – nekomatic Oct 17 at 10:07
  • \$\begingroup\$ I wasn't clear I think it is perfect for this project . what I am trying to get at is if you install this in your house to automate your morning coffee, not as a project, but as part of your normal appliance in your home, and it causes a fire or hurts someone, whatever insurance issue or liability may not be in your favor . If I was the producer of this I would put bright logos "for development use only" and not try to invent my own isolation spec and safety Mark as they have. Most of my negative reaction is the attempt to pretend it has certification with their own mark. \$\endgroup\$ – crasic Oct 18 at 17:28

Replace the on/off switch with a "normally open" relay, then control the relay from the controlling device Alexa or whatever...

  • \$\begingroup\$ yes this is the way. You don't want to be messing with the internals of these things - usually it is a horrible circuit powered directly off the mains ... \$\endgroup\$ – danmcb Oct 14 at 7:39
  • \$\begingroup\$ Also OP make sure you use a switching device with low current, otherwise you'll burn out the Photon's GPIO pin during the testing phase. If you need to use a relay instead of an opto-isolator or a triac, then use a transistor to drive the relay if it comes anywhere close to the maximum GPIO pin current. \$\endgroup\$ – QuickishFM Oct 14 at 9:26
  • \$\begingroup\$ So essentially copy the wiring that goes into the on/off switch with something like this? \$\endgroup\$ – snoofle Oct 14 at 14:30

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