Tue Jan 06, 2015 9:12 pm
Hi,
Why not start by purchasing one of those plug-in safety devices used to protect against electric shock. They have different names in different countries, such as ground fault interrupter or earth leakage circuit breaker. They are often sold for providing protection when using mains supplied devices out of doors.
Now if you come into contact with a mains voltage in the coffee maker (cm) you should be protected against being shocked, and although the Pi may be damaged it won't pose a serious risk to you.
Once the cm is plugged in via the protection device, you can test the circuit board for any mains voltages - unlikely, but lets be sure.
With a test meter set to AC and a mains voltage range, put the black probe onto a solid grounded/earthed piece of metal, and use the other probe to test each of the pads on the connector. As the connector is the only source of voltage for the pcb, if none of the pads registers a mains-like voltage, then the pcb is a low voltage device. If a mains-like voltage is seen STOP.
There is a theoretical possibility that the cm has an isolating transformer providing mains voltage but isolated from ground. To test for this, keep the meter set to AC and a mains voltage range and test all possible combinations of the four connector pads. No mains-like voltage will be seen from any combination. If it is STOP.
Now turn the meter to a low voltage DC setting and test the connector pads again, this time placing one probe on one pad and the other probe on each of the other three pads in turn. Repeat by moving the first probe to the second pad and so on. You should find a combination that registers a low DC voltage, perhaps 5 volts. Identify which is positive and which is negative. If the display shows a positive voltage , then the pad that the red probe is on is +ve. If the meter shows a negative voltage, then the pad that the black probe is on is +ve.
This will confirm the operating voltage of the pcb and which pads provide this low voltage (and which one is +ve)
Using the meter again, connect the black (-ve) probe to the continuous track along the bottom of the switches and touch the red +ve probe to the +ve connector pad. If the meter shows a positive voltage, then the long track is negative - which is what is more likely.
Next with the power off and the connector disconnected, use a resistance range on the meter to test the ON switch.
Is it a click-on click-off switch or is it only 'on' when pressed - a momentary contact switch.
This will determine how to control the cm.
Once you know these things, then a decision can be made on how to control it.
A relay seems like overkill for this issue. The switch is connected to some form of microprocessor and the current required is minute. A simple transistor will likely be sufficient to make the connection that the switch makes.
The transistor can then be controlled by a gpio on the Pi.
In an excess of caution, the transistor base can be connected to the Pi through an optoisolator.
If the pcb track along the bottom of the four switches is indeed negative (ground) then switching with an npn transistor should be straightforward.
The Pi then either provides a momentary on state, then off again, or just provides an on state until you are ready to switch it off, depending on what you found when testing the switch.
Regards
anita2R