Go Down

Topic: Problems with a MOSFET relay (Read 11514 times) previous topic - next topic

KirAsh4

So I have a problem getting a MOSFET relay to work right.  I'm using an Omron G3VM-21AR in the following configuration:



SIG, DIN, and CLK go to an Arduino which is powered separately.  GND is common on both sides.  The battery is a Li-Ion there to provide power to the LED string only.

When I keep SIG LOW, the LED string is off, and when I set it HIGH the string turns on.  The idea here is that on the Arduino side, it could already be running, therefore sending data to the string.  The relay is simply there to cut raw power to the string.

The problem I have is when I turn the relay on, the LED string comes on however the data being displayed is corrupted.  If I disconnect the common ground between the string and the Arduino and reconnect it, then the string displays the incoming data as expected.  But if I power cycle the relay again, everything goes to hell in a hand basket.

So, what's going on here and how can I fix it?  I'm sure it's something I'm doing wrong but I can't figure out what.

JChristensen

#1
Aug 01, 2013, 05:20 am Last Edit: Aug 01, 2013, 05:31 am by Jack Christensen Reason: 1
Remove the ground from pin 4 on the LED string. Ground pin 1 on the LED string instead.

The way the circuit is drawn, the positive side of the Li-Ion battery is effectively grounded through the relay. The LED string thinks that its pin 1 is ground, but it's actually below ground level the way it's wired. That is probably messing with how the data signals get interpreted.

KirAsh4

No dice.  The circuit looks like this now:



Doesn't work.  The string turns on and off just like before, but now it doesn't show the proper data at all.  Even if I remove and reconnect the common ground between the LED string and the Arduino.

If I remove the relay from the equation and just connect the wires that are going to pins 3 and 4 on the relay, the LED string works as expected.  With the relay back in the circuit, the string just displays random colors.

I just noticed something else though, and may shed some light here.  With the relay in place, the voltage difference at the LED string is much lower than the actual battery voltage.  At the battery I can measure 4.1V (it's fully charged) and yet at the LED string, I measure 3.2V.  That's a significant voltage loss ...  Any ideas as to why?

KirAsh4

And actually, the datasheet shows pins 2 and 3 on the relay to be grounded (pin 2 has a series resistor of 220 Ohm).  So I reversed the battery so I can get a ground on pin 3, and reversed the connections on the LED string accordingly.  The relay is turning things on and off as I send either a HIGH or LOW signal to it.  So at least I know that works.  What I can't explain is a) why the significant voltage drop, and b) why does the data get corrupted.

Now, it is entirely possible that it's due to the voltage drop.  Even if the string's drivers work down to 2.5V (though the LEDs themselves only go as low as 2.8V).

nickgammon

I think you are getting parasitic powering of the LEDs. I have an LED string that glows dimly even when the power is off. Naturally I quickly disconnected the data lines as well.

If the power is off you should also have the data lines LOW.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

KirAsh4


I think you are getting parasitic powering of the LEDs. I have an LED string that glows dimly even when the power is off. Naturally I quickly disconnected the data lines as well.

If the power is off you should also have the data lines LOW.


That makes absolutely no difference.  If I power the LEDs first, then the Arduino (therefore the data lines), it's corrupted.
If I have the Arduino powered, but no data being send, power the LEDs, then start sending data, it's corrupted.
If I power the Arduino and LEDs, then start sending data, it's corrupted.

Anything where the relay is in the circuit, it gets corrupted.

As soon as the relay is taken out of the circuit, I can do whatever I want as far as what gets powered first or when data gets sent, it always works.

And I still can't figure out why I'm getting such a drastic voltage drop across the relay.

nickgammon

I don't get your circuit. Is pin 1 of the LED string +5V or Gnd?

If it's Gnd, why are you grounding pin 4?

If it's +5V why is it connected to the negative side of the battery?
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

KirAsh4


I don't get your circuit. Is pin 1 of the LED string +5V or Gnd?

If it's Gnd, why are you grounding pin 4?

If it's +5V why is it connected to the negative side of the battery?


You're looking at the wrong one.  I tagged the wrong image so you can tell which is wrong.  The second image is correct.  Pin 1 is GND, pin 4 is VCC.

cjdelphi

#8
Aug 01, 2013, 08:34 am Last Edit: Aug 01, 2013, 08:48 am by cjdelphi Reason: 1
What's the "low"/"high" voltage on the signal that's triggering off the ss relay?  also R1, what value are you using?




KirAsh4


What's the "low"/"high" voltage on the signal that's triggering off the ss relay?


At the moment, 5V, coming from the Arduino.

Ultimately, it will be coming from the battery.  The LED's forward voltage is 1.33V, so the battery will cut out well before it gets that low.

cjdelphi

also R1, what value are you using?

Maybe it's not allowing enough current for the LED for the fet's to fully switch on?

KirAsh4


also R1, what value are you using?

Maybe it's not allowing enough current for the LED for the fet's to fully switch on?


220 ohms.  At 5V, and a voltage drop off 1.33V, that means the LED is working at 16.6mA.  Minimum is 10mA, max is 30mA.  So it should be just fine.

nickgammon

What current is drawn by the LED string?
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

KirAsh4


What current is drawn by the LED string?


Max 2.59A (54mA per LED, 48 LEDs.)  That's if I ever set it to full white.

TomGeorge

Hi, I think you may have a problem with supply and filtering, you mentioned that the supply to the array with the mosfet relay was down to 3.2v.
These arrays have micrcontrollers built in them, probably running at 3.3V. If the main supply drops to 3.2V then the regulation will not be available to keep the microcontroller stable.
To fix this either use a small mechanical relay, or parallel up the output of three or more of these mosfet relays units to drop the switching  resistance.
To check, measure the voltage across pins 3 and 4, AT THE opto mosfet relay and see if you are loosing the 1v there and not your wiring or too small width tracks to the opto mosfet relay.

Tom
Everything runs on smoke, let the smoke out, it stops running....

Go Up