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?
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!
Looks fine to me. I’d probably check to make sure the buttons/switches are actually switching to ground and not 12v. If so you’d just need to switch up your schematic a bit
Relays would be another good choice to drive the switches and you can get a relay for any voltage/current and SPST/DPDT configuration that you can get a switch for. I would check the current going through the switch if you can, just to be sure you are putting too much through the opto-isolators.
Hi. Thanks for the help!!
So if the device was switching to 12v how would I change the schematic?
I guess the emitters on the ctlout will have to go to 12v instead of gnd? But that wouldn’t change the schematic, just the way I interface to the machine pins?
As for the relay suggestion… That’s another solution for sure, but still I wanted to learn a bit about transistors and onto isolators. I don’t quite get them still very well
The switches can essentially be doing one of three things:
- Connecting an input to ground
- Connecting an input to V_LOGIC (logic voltage high)
- Something else crazy. (Like a resistor ladder or something to psudo mux the switches into 1 switch)
You’ve already handled 1 with your schematic. If it turns out that 2. is the actual situation then you need to change your circuit up so the high side of all the opto isolators are tied to V_LOGIC and the low side are tied to the microcontroller inputs of the coffee machine. Does that make sense?