74HC245 to ULN2803A and drive relay, flickering issue of power ON

I want to drive number of relay with arduino mega and try to driver through 74HC245 (SN74HC245DWR) which drive ULN2803A and than 12V relay. everything working as normal

Only issue is " Relays are flickering during initial power up after that work as normal. I am not well aware of 74HC245. If some one can help out to solve the issue. specially for connecting OE pin.

schematic and chip data sheet are attached.
Software side I confirm by removing the arduino mega and power up only gpios layer but same issue observed.

You COULD put pull down resistors on the inputs or connect #OE to a GPIO pin, and set it to output & high at boot.

1 Like

Are you running any other code before you initialize this circuit? If so, change it so it's the very first thing you do out of reset. The resistor idea mentioned above is good, even a high value like 100k would be fine.

A more global way would be to delay the application of 12V to the relay circuit by gating it with a FET.

You could probably have achieved the same thing using a single chip, the TPIC6B595.
Anyway the 74HC245 has a /OE (NOT OUTPUT ENABLE) pin which you could, by default, pull HIGH. After the initial start up, pull it LOW using a free GPIO pin. This should suppress the random output while you set all the outputs for the relays to LOW. You may still need pull down resistors on the ULN2803 inputs.

Already built in!

I prefer pull down, pins are generally to valuable.

In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.

Use the </> icon from the ‘reply menu’ to attach the copied sketch.


Try a 10-100uF capacitor from the 74HC245 pin 19 to 5v.
Place a 150k across the capacitor.

Thanks all for your time and comment. # OE to GPIO pin and pulldown ULN2803 is good idea which I will consider in next update after test. because my PCB is already pinted.
Unfortunately I have 03 number of 74HC245 at input / output and I was expected these type of issue so I add tip switch on #OE pin which can pullup or down.

Input flickering I controll by add some delay in setup (program). I will update here after apply the above recommendations.

My PCB and input scheamatic is attached may some one improve further.


I will read more about your suggestion for TPIC6B595. I am considering TBD62783 drive high side of relay with PTC fuse on GPIOS for overload protection.

Is it possible to do hard ware side. I see some similar design on internet would you think it can help us

Hi,
You will need to put bypass capacitors, 0.1uF at each of the ICs to help with glitch suppression and filtering your power supply.
Even a 10uF or 100uF capacitor at the point on the PCB where you connect power would help with smooth operation.

Tom... :smiley: :+1: :coffee: :australia:

10uF capacitor from the 74HC245 pin 19 to 5v solve the issue .
Footprint of 805 (R1,R3) resistor were available on PCB so easy solve the issue with adding 10uf capacitor.

Will update these also "0uF or 100uF capacitor at the point on the PCB where you connect power"

Thanks to all for your comment. I learn a lot from this single issue which cover many mistake in designing.

This effectively prevents the outputs from transferring until the charging of the capacitor is achieved; at which time the software should be up and running.

This is actually standard practice for all digital circuits. The issue you had would not
have occurred with anyone else's circuit because they typically add the 10uF cap across the 5V power rail and the 0.1uf at each IC BEFORE they even install the ICs.
This has been standard practice since the days of TTL in the early 70's. You will find
it in Don Lancaster TTL COOKBOOK

(first published June, 1969) (the year I enlisted in the Air Force on a whim)

(this is what my copy looked like when I had it).

2021-1969=52 years people have been doing what you just discovered.

image

In this case, note pin 19 of D3 is the OE’ pin.
Adding the capacitor from 19 to 5v acts as a sort of power on delay disable.
On power up, 5v is sent to the OE’ pin therefore disabling the OE pin.

Once the capacitor has charged, the R3 resistor pulls down pin 19 therefore enabling OE.
Timing ensures software is running before the OE pin is enabled.

Clever !

Convenient that the 10k resistor is already there.

In fact, that is the only reason that the resistor would be there. :grin:

Well, except for the general advice to use such a resistor to tie any control line - such as the "DIR" pin of the 74HC245 - pin 1 - to a fixed level "just in case" you might find a reason to later add some additional functionality.

The big question is why is the OP using a 74HC245 rather than a 74HC595? :face_with_raised_eyebrow:

Hi, @Ghulamfarid

0.1uF on each chip will also be of benefit, 10uF will not bypass any high frequency noise/glitches very well.

Tom.... :smiley: :+1: :coffee: :australia:

Because I just start (1 year) the circuit designing and didnot know about these chips and filtering. But i learn many other thinks from 1 simple mistake with your help and comments.

R3 should be replaced by a wire - CMOS inputs can tolerate direct connection to supply or ground and this will be least noise-sensitive.

The '245 is not performing any function here (in fact its possibly the reason for the proble), the ULN2803 can take logic inputs directly, no need to buffer as only ~1mA per pin is needed.

In fact adding the '245 means that when the inputs to the '245 float its outputs will be undefined (potentially jumping around from low <-> high). The 2803's inputs take current and thus don't float so directly connecting them to the microcontroller will prevent flickering during the power-up/boot sequence.

And yes every chip need decouplng - this is always assumed with electronics.

Is it possible to drive 08 relay individually with TPIC6B595. Which i think not the same as 74HC245+ULN2803