# Relay logic validation

#### metermannd

Joined Oct 25, 2020
343
It looks like I'm coming down to one of the last design hurdles in my project - see the image attached.

After cleaning out unused sections of the original design, I am left with a single channel in use on the ULN2003A driver IC, as shown on the left side, so it would be better to replace the IC with a discrete equivalent, freeing up some real estate on the board.

I want to be sure the circuit on the right side has the same functionality, that the relay is activated when the RLY line is brought to a logic '1'.

#### ericgibbs

Joined Jan 29, 2010
18,661
hi m,
On the left circuit , the Relay will energise when the input to the ULN is High.
On the right side circuit , the relay will energise when the input to Q5 is Low.
You do not need two transistors.

E

#### metermannd

Joined Oct 25, 2020
343
So I omit R6, R11, and Q5, and I should be good to go?

#### ericgibbs

Joined Jan 29, 2010
18,661
hi,
On Q4 Base you need a series resistor from the driving source, requires about 5mA Base current.
What is the driving voltage.?
E

#### metermannd

Joined Oct 25, 2020
343
So I keep R11 then, and the drive voltage is 5V from a MC6821.

#### ericgibbs

Joined Jan 29, 2010
18,661
hi,
The MC6921 outputs 5V when High.
So for 5mA Base current, thats 5V - 0.7V == 4.3V/0.005A = 860R, I would a value between 470R and 1k for the R11 into the Q4 Base.
OK.?
E

#### Attachments

• 39.5 KB Views: 7

#### metermannd

Joined Oct 25, 2020
343
Before I add another line to my project BOM, I do have entries for 510 ohm and 1K...

Assuming you mean that at least 5mA is needed to turn on Q4, would the 510 ohm resistor work?

Also, for clarity, as I understand the 6821 has different arrangements for the 'A' and 'B' outputs, this is driven from one of the 'A' outputs.

#### ericgibbs

Joined Jan 29, 2010
18,661
hi,
Have you read this section of the d/s, regarding the PortA and PortB outputs when set to OUT.?
What do you see as the difference.
E
a value between 470R and 1k for the R11

#### Attachments

• 108 KB Views: 3

#### ElectricSpidey

Joined Dec 2, 2017
2,756
If you really want to emulate the 2003 use a Darlington.

#### metermannd

Joined Oct 25, 2020
343
Spidey: I could - and the 2N6427 comes to mind...

Eric: I assume we're looking at the same datasheet, and this should be a page or so down:
Just want to be sure.

#### ericgibbs

Joined Jan 29, 2010
18,661
hi,
Just set the A or B pin that you are connecting as an OUTPUT pin.
The other features of the pin when set as an Output ie: INPUT or TRI State are not used for your Application.

E

#### eetech00

Joined Jun 8, 2013
3,823
Spidey: I could - and the 2N6427 comes to mind...

Eric: I assume we're looking at the same datasheet, and this should be a page or so down:
Just want to be sure.
The output will usually go tri-state at boot up even though your not using a tri-state function.
Use a 10k pull down resistor from the base of the drive transistor in post#6.

#### metermannd

Joined Oct 25, 2020
343
eetech: To be sure, I assume you mean the 10K is connected on the side of the 820 ohm resistor towards the transistor?

#### eetech00

Joined Jun 8, 2013
3,823
eetech: To be sure, I assume you mean the 10K is connected on the side of the 820 ohm resistor towards the transistor?
Yes. At the junction of the 820 resistor and transistor base to ground.