jinqsi
Posts: 6
Joined: Thu Nov 20, 2014 5:37 pm

ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 5:54 pm

Hey everyone. I have a very strange problem. I'm using a ULN2803 to drive a Fotek 40A solid state relay to control mains power. I've built the prototype circuit below (without the resistors and capacitors, ignore those) to test out the concept. The problem is, the lamp I have plugged into the circuit will randomly flicker. It seems to start after the relay has been on for a few seconds.

Here are some things I've done to nail down the problem:
1. I've plugged the lamp into the wall to make sure it wasn't the lamp's problem.
2. I've plugged a different lamp into the circuit.
3. I've taken the relay out of the circuit and plugged in the lamp to that portion of the circuit.
4. I've plugged the mains circuit into a different wall in a different room.
5. I've skipped over the ULN2803, just grounding the relay. THIS made the flickering stop, but of course, now I don't have control of the relay...
6. I swapped out the ULN for another ULN and still got flickering.
7. I've driven an LED with the 3.3v GPIO and the 5v rail on the pi to watch for flickering but didn't see any.
8. I've connected the pi up to a different socket as well, still same issue.

The weird thing is that the LED on the relay that tells you it's on does not flicker, and glows a healthy shade of red the entire time, even while the light is flickering. Another weird issue is that if I drive the ULN input with 5v it still flickers... It seems to be the ULN's fault, but I don't know why it wouldn't be staying on even with 5v on it...

Image

User avatar
aTao
Posts: 1086
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 6:31 pm

At first glance at the datasheets the ULN2803 is designed to work with TTL (5V), the ULN 2308a for TTL and 5V CMOS and the ULN2304A with 6..15V CMOS, PMOS.

The Raspberry Pi with its 3.3V outputs might not be driving it hard enough.

For a quick test try using a resistor in place of the 2038A to turn on the SSR
>)))'><'(((<

User avatar
joan
Posts: 14079
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 6:35 pm

aTao wrote:At first glance at the datasheets the ULN2803 is designed to work with TTL (5V), the ULN 2308a for TTL and 5V CMOS and the ULN2304A with 6..15V CMOS, PMOS.

The Raspberry Pi with its 3.3V outputs might not be driving it hard enough.

For a quick test try using a resistor in place of the 2038A to turn on the SSR
You may be able to feed the one gpio to two 2803 inputs and dual up the outputs to cope with that possibility.

jinqsi
Posts: 6
Joined: Thu Nov 20, 2014 5:37 pm

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 6:53 pm

Interesting... so I run the GPIO to pins 1 and 2 on the 2803, and then connect the first two pins on the left to eachother, and one to the ground on the relay?

The 2803, by most accounts, can be driven with 3.3v anyway... that's sort of the problem. It did just occur to me that some time last week I accidentally shorted the 5v rail on the pi to ground, causing the pi to restart. Could that have fried something, causing the pi to output less current / voltage that it is supposed to? The pi restarted right back up afterwards...

jinqsi
Posts: 6
Joined: Thu Nov 20, 2014 5:37 pm

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 7:15 pm

joan wrote:
aTao wrote:At first glance at the datasheets the ULN2803 is designed to work with TTL (5V), the ULN 2308a for TTL and 5V CMOS and the ULN2304A with 6..15V CMOS, PMOS.

The Raspberry Pi with its 3.3V outputs might not be driving it hard enough.

For a quick test try using a resistor in place of the 2038A to turn on the SSR
You may be able to feed the one gpio to two 2803 inputs and dual up the outputs to cope with that possibility.
Interesting... so I run the GPIO to pins 1 and 2 on the 2803, and then connect the first two pins on the left to eachother, and one to the ground on the relay?

The 2803, by most accounts, can be driven with 3.3v anyway... that's sort of the problem. It did just occur to me that some time last week I accidentally shorted the 5v rail on the pi to ground, causing the pi to restart. Could that have fried something, causing the pi to output less current / voltage that it is supposed to? The pi restarted right back up afterwards...

User avatar
joan
Posts: 14079
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 8:04 pm

In effect you are driving the inputs/outputs in parallel. So link the two input pins and link the corresponding two output pins. It may work, it may not.

User avatar
mikronauts
Posts: 2709
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 8:19 pm

Can you post a link to the data sheet of the SSR?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

jinqsi
Posts: 6
Joined: Thu Nov 20, 2014 5:37 pm

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 8:57 pm

mikronauts wrote:Can you post a link to the data sheet of the SSR?
Here you go. Mine is the 40A one.
http://akizukidenshi.com/download/ds/fo ... ek_ssr.pdf

User avatar
mikronauts
Posts: 2709
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 10:13 pm

Without seeing a schematic showing how you have the ULN2803 connected, I can only speculate...

While I have not used tULN2803's in a while, I suspect you have the relay/ULN2803 hooked up incorrectly.

The relay requires a high signal to turn on, and apparently only requires 7.5mA @ 2.4V+ to enable.

If you are only driving a single relay, you could try driving it directly from a Pi pin through a current limiting resistor - it would be unlikely to hurt the Pi.

I = VR

R = V/I

R = 3.3/0.01

R = 330R for 10mA

A better way to do it would be to use a buffer chip, running at 5V, with the GPIO driving the buffer directly.

Take a look at the "Application Hints" (page 2) of your data sheet for sample configurations.

Here is a datasheet for the ULN2803

https://www.sparkfun.com/datasheets/IC/uln2803a.pdf
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

jinqsi
Posts: 6
Joined: Thu Nov 20, 2014 5:37 pm

Re: ULN2803A driving 40A SSR is unstable

Thu Nov 20, 2014 11:25 pm

mikronauts wrote:Without seeing a schematic showing how you have the ULN2803 connected, I can only speculate...
I posted a drawing of how I have it wired up. It's in the first post on this thread.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12020
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: ULN2803A driving 40A SSR is unstable

Fri Nov 21, 2014 12:40 pm

Note that SSR's like this use a (photo) TRIAC, and those need a mimimum current to keep conducting, if you lamp is very low power, it might be that the flickering is simply due to the TRIAC. test by simply applying power to the control input to see if the lamp keeps flickering.

klricks
Posts: 6500
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: ULN2803A driving 40A SSR is unstable

Fri Nov 21, 2014 2:44 pm

mikronauts wrote:..
..
The relay requires a high signal to turn on, and apparently only requires 7.5mA @ 2.4V+ to enable.
..
.
The spec sheet says 7.5mA @ 12V so at 3.3V that would be ~2mA. The RPi should be able to easily trigger the SSR with direct connection to GPIO.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
joan
Posts: 14079
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: ULN2803A driving 40A SSR is unstable

Fri Nov 21, 2014 2:48 pm

klricks wrote:
mikronauts wrote:..
..
The relay requires a high signal to turn on, and apparently only requires 7.5mA @ 2.4V+ to enable.
..
.
The spec sheet says 7.5mA @ 12V so at 3.3V that would be ~2mA. The RPi should be able to easily trigger the SSR with direct connection to GPIO.
I 'd have assumed that the power required was the deciding factor so 12/3.3*7.5 = 27mA.

klricks
Posts: 6500
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: ULN2803A driving 40A SSR is unstable

Fri Nov 21, 2014 2:52 pm

mahjongg wrote:Note that SSR's like this use a (photo) TRIAC, and those need a mimimum current to keep conducting, if you lamp is very low power, it might be that the flickering is simply due to the TRIAC. test by simply applying power to the control input to see if the lamp keeps flickering.
To OP .....is the lamp a CFL type? If so you might try a dim-able CLF type or incandescent bulb.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

klricks
Posts: 6500
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: ULN2803A driving 40A SSR is unstable

Fri Nov 21, 2014 3:08 pm

joan wrote:
klricks wrote:
mikronauts wrote:..
..
The relay requires a high signal to turn on, and apparently only requires 7.5mA @ 2.4V+ to enable.
..
.
The spec sheet says 7.5mA @ 12V so at 3.3V that would be ~2mA. The RPi should be able to easily trigger the SSR with direct connection to GPIO.
I 'd have assumed that the power required was the deciding factor so 12/3.3*7.5 = 27mA.
I am more familiar with the OPTO-22 brand which specifies a fixed input resistance of 1000 Ohms. They give formula for input current ic= (Vc-1)/1000.
http://documents.opto22.com/0859_Solid_ ... _sheet.pdf
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

danjperron
Posts: 3382
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: ULN2803A driving 40A SSR is unstable

Fri Nov 21, 2014 10:54 pm

I most Agree with mahjongg,

40A SSR will draw some current from the load and they could flicker if the load is not strong enough. Normally SSR current has to be adjusted to the load A 40A SSR won't be stable if your load is just 1A. Did you try a simple 9V battery on the SSR to check if the lamp flicker?

Does the lamp flick when there is no power on the input of the SSR. What is your lamp power. I hope it is more than 100W and it is a incandescent one or you have another load with it.

Daniel

KDMcM
Posts: 11
Joined: Tue Dec 01, 2015 11:07 pm
Location: Redditch, England

Re: ULN2803A driving 40A SSR is unstable

Fri Dec 28, 2018 8:34 pm

joan wrote:
Fri Nov 21, 2014 2:48 pm
I 'd have assumed that the power required was the deciding factor so 12/3.3*7.5 = 27mA.
There seems to be a lot of chat about weather (or not) SSRs can e driven directly from the Pi. I've recently used the 25A FOTEk one mentioned above. I drive the input directly from the Pi. The output is hooked to a 2kW water heater. The heater has an neon. the drive doesn't work. When the relay is enabled, the relay LED lights, but the heater neon only comes on for a fraction of a second.

What am I missing? How do we drive an SSR from a Pi?

If I hook the GPIO line to the SSR input but also pull it to +5V with a resistor (say 1k), is that likely to work?

User avatar
rpdom
Posts: 14741
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ULN2803A driving 40A SSR is unstable

Fri Dec 28, 2018 8:40 pm

KDMcM wrote:
Fri Dec 28, 2018 8:34 pm
If I hook the GPIO line to the SSR input but also pull it to +5V with a resistor (say 1k), is that likely to work?
Maybe, but it will probably kill the Pi by putting nearly 5V on the 3.3V tolerant GPIO pin.

danjperron
Posts: 3382
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: ULN2803A driving 40A SSR is unstable

Fri Dec 28, 2018 9:15 pm

Fotek ssr input is rated from 4 to 32VDC and voltage below 3.5V means OFF.

So you can't drive them directly but like the pdf documentation indicates you could add a transistor to activate the SSR.

http://www.fotek.com.tw/pdf/2013515_90632265.PDF

P.S. also the trigger current is 12ma. A little bit too much. The transistor is needed. First picture on page 04 (application hints).

danjperron
Posts: 3382
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: ULN2803A driving 40A SSR is unstable

Mon Jan 07, 2019 2:46 pm

Hum. 40A SSR on a small current lamp. You are asking for troubles.

What about leakage current from the ULN2803 and the SSR itself!

Did you put a load on the input of the SSR. A small resistor in parallel because the ULN2803 has leakage current around 50uA. a resistor load to keep the voltage low . 10K resistor should be enough.

Also the SSR itself has a leakage current of 7ma on the 120VAC. What kind of lamp? I hope it is not a led or a fluorescent type.

If it is a LED lamp then the charge accumulates up to a certain voltage and it start to flicker. I had that problem with a three way system. The live wire was transferring charge to the other wire because they were on the same cable and the capacitive effet was the issue. When the accumulated voltage was high enough then the lamp flash. Most of led lamp use a bridge with a capacitor. The charge accumulate to the capacitor until the Voltage was high enough to power the lamp. That was weird and brain scratching to figure out the problem. It was solved by adding a 33K 2W resistor in parallel with the led lamp.

Try to put an incandescent lamp instead or a resistive load with your lamp if it is led.

Return to “Troubleshooting”