Coffee Machine Control Interface Question

Hi All!

Newbie here, and I am trying to control a coffee brewing machine, I have some doubts if I am doing it right… I need to control 3 Switches and to read 3 LED’s the coffee machine blinks when there are different status.

My first though would be to opto isolate this readings and control. The coffee maker has 12 VDC on the switches and LED’s. This is the schematic I drew to make a PCB to work with the spark. Opto Isolation seems like a good idea… Thoughts?

Can some one tell me if I am on the right path in regards to the schematic or if I have a mistake I should fix?

Explanation:

SOUT is the headers to control the switches. I plan to connect the negative (GND) leads from the switches to the pin #4 in the header and then each switch to one pin of the header from 1 thru 3.

SIN is the headers for the coffee maker LED’s… Same thing… GND will be connected to pin #4 in the header and then each LED VCC to pin 1 thru 3.

On the other side of the OPTO ISOLATOR I am wiring them to the spark D0 to D2 on the input side since those are interruptible. And D3 to D5.

As for the input I plan to configure the input pins (D0 to D2 as pull up inputs).

Here’s the schematic. Any Help would be greatly appreciated!

http://community.spark.io/uploads/defau … c4d3ac.png

I don’t know that you need opto-isolators but they should work. Just make sure they can handle the Vce of 12V on the transistor side and are able to sink the current needed for the LED.

Alternatively you can probably use a ULN type driver for the LEDs. It has the advantage of having the base resistors built-in, so there’s less wiring to do. A resistor divider should work to bring the switched 12V down to the voltage used by your micro. I don’t know that that saves that much wiring.

https://www.sparkfun.com/products/312

https://www.sparkfun.com/datasheets/IC/uln2803a.pdf

I think it’s a good idea to optoisolate everything. A cheap coffeemaker might not be transformer isolated and the ground may be floating at 120V.