Sorry to bother you all…but can anyone point out specifically where on this board is the opto isolator? And as a corollary, should the opto isolator ‘protect’ the Photon from any interference or temporary spikes from the load? In my experience this has not been the case. Meaning I’m wondering if the board really is opto isolated!
Thank you. Sorry.
If not built into the relay itself, then an opto isolator must have it minimum 4 leads. The only package on that board with 4 leads looks like the yellow IC just above the jumper.
The optoisolator is the white component next to the jumper for digitalWrite High or invert. It should have four pins (sometimes they have six but four is the most common).
An opto-isolator will protect the photon from damage and direct interference from both the load and the relay coil. However depending how everything is hooked up if the load shares a power source or a ground with the photon and is particularly noisy or has a big surge when coming on it can’t work miracles.
The board appears to have an isolator, but it is unclear how it would isolate relay power from control signals with a three terminal input arrangement. At some point the grounds must be connected and that is not isolation.
It depends on whose load you are referring to.
If you are referring to the load on the relay contacts, yes. The relay (not the opto) will isolate the Photon from the load. Just don’t tie any of its contacts to the Photon.
If you refer to the coil as a load to the Photon, it does something different. The opto allows you to split (not isolate) the relay coil power from the Photon power. In this case the Photon only needs to drive the opto LED, but the coil power can come from another supply.
As others suggested, the input is not fully isolated because it has to share the return wire (DC-) with the Photon.
If this is a one-off deal, you could add a separate return wire for the opto LED. Then you need a separate power supply just for the relay.
As far as spikes, I see what looks like diodes on the board. They should be in parallel with the coil, but even they don’t eliminate spikes from the coil. Only the separate power supply can achieve that.
Hopefully the load side of the relay goes directly out the left connector, so that should not affect the Photon.
For true isolation, you don’t connect the Photon’s Ground to the relay at all.
As per the picture, this requires a dedicated power supply for the relay.
You activate a relay by driving the Photon pin LOW.
This page was very helpful to me.
Hmm, not really sure if that statement can be made unconditionally.
This very much depends on the layout of the board.
The only thing that can be stated generally is, that for true galvanic isolation no electric connection can exist between the two isolated circuits. But if the “primary” ground is not in any way connected to the “secondary” ground you can - and should - connect the µC GND to the primary ground pin.
In order to properly “compare” logic levels you need a reference voltage and that commonly is ground, not Vcc.
Sure, if the “input” for the opto-isolator is the the cathode of the LED inside the unit and Vcc is hardwired to the anode then you can (potentially) omit the GND contact as the control pin will supply the LOW level. But that’s definetly not the “usual” setup.
My understanding of the concept is that the only connection to the Photon/Arduino is Vcc and an Output Pin.
When the Photon drives an output pin low, this completes the circuit from Vcc to Ground - which lights the tiny LED inside the opto-isolator. I didn’t think of it as a Logic Comparison, only completing a circuit to drive the LED inside.
I was “repeating” info from the website I linked to in the hopes that it might help. It’s worked great for me and several models of the relays I’m using (w/ JDVcc Jumper “removed”).
I hope I don’t appear defensive or argumentative. This forum is an incredible resource for learning… especially @ScruffR
Let me ask a question: what is the problem you are trying to solve?
Here is where the opto is.
if wired properly (I.E. the opto circuit has a built in resistor), then yes.
The main thing I see people do which is the cause of many problems. They run the Vin pin to the hot side of the coil. The trouble with this method is that when most relays close they will suck quite a bit of current to do that momentarily. This sudden spike in current typically causes the onboard regulator to dip its output voltage to low which can cause a reset on the Photon, or wigg out other devices that are connected.
There is just not enough onboard capacitance to adequately deal with this. In your situation you might consider sticking something like a 100uf - 220uf cap on the DC+ and DC- pins on your board to help mitigate this effect.
Your description of the setup was relating to a particular board/layout where it’s absolutely working that way. With my post I just intended to generalise the overall idea of galvanic isolation independent of particular layout designs to prevent the evolution of potential misconceptions.