-->
Page 5 of 12

Re: optocoupler as "relay"

PostPosted: Wed Mar 16, 2016 4:05 pm
by Trent
The SSR looks fine as well but I'm still hung up on the forward current issue. It lists 50ma in the datasheet. I still can't understand how that doesn't translate into blowing the GPIO. Sorry for my ignorance :(

Re: optocoupler as "relay"

PostPosted: Wed Mar 16, 2016 4:48 pm
by lethe
Trent wrote:The SSR looks fine as well but I'm still hung up on the forward current issue. It lists 50ma in the datasheet. I still can't understand how that doesn't translate into blowing the GPIO. Sorry for my ignorance :(

50mA is the absolute maximum rating. The output will turn on somewhere between 2-3mA, so calculate the resistor for 5mA and it should work fine.

Re: optocoupler as "relay"

PostPosted: Wed Mar 16, 2016 7:49 pm
by jra
When I got home I took out my Sainsmart 2 channel 5V relay like this one http://www.sainsmart.com/arduino-pro-mini.html and connected it as follows:

VCC to 3.3v
5V through a 9.9 ohm resistor to JD-VCC

Refer to the schematic on the previous link.

Prior to applying power I measured the current limiting opto-isolator resistor R4 (nominally 1K) as 988 ohms. I applied power, grounded IN2, verified the relay closed and made the following measurements:

Voltage across R4: 0.492V
Current through opto-isolator: 0.492V/988 ohms = 0.498ma
Voltage across 9.8 ohm resistor in series with relay coil: 0.434V
Current through relay coil: 0.434V/9.8 ohms = 44.3ma

The Sainsmart spec says each relay requires 15-20ma of current, not sure why this one is pulling double that. More importantly, it only took half a milliamp to turn the opto-isolator on so you should have no problem driving this with the GPIO pins.

Re: optocoupler as "relay"

PostPosted: Wed Mar 16, 2016 9:40 pm
by martinayotte
Eh, guys !
Are you discussing about relay power consummation or the current needed for the LED to saturate the optocoupler ?