PCF8574 to ULN2803 - have I done something daft?

We all start somewhere
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#1 PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

So the scenario is this - the linestage has an array of relays controlling volume level, and another array for switching inputs.

They are latching relays, so in steady state no current passes through their coils. When the volume or input is changed, then a 'set' or 'reset' current pulse gets routed to the relays in question.

This is the circuit controlling volume - and this one works fine. When the system has power applied, the software initialises all the PCF8574's ports P0 to P7 to low, from their initial state of high. So in steady state, the relays have +12V on both sides of the coil, with low having been inverted by the ULN2803. If a change in volume is made, then one or more of P0 thru P7 on U2 and U5 will momentarily 'pulse' high, pulling the voltage to zero on the appropriate side of the coil and operating the relay. The bargraph LEDs U3 and U6 are a telltale for when this current flows.

So - this one works:

Image

This one, however, doesn't:

Image

This controls the input selection. Now with it being a balanced linestage, two relays are needed for each channel. With there only being four inputs, I figured it made more sense to use all of the ULN2803 to still have one darlington array per coil, so I paralleled it on the TTS side (see U1 and U4, pins 1 thru 8. The idea being that when P0 pulses high, two relays are activated, one for each channel.

Unfortunately I don't get any LED activity at all from U3 and U6, aside from the 'power' LED (pins 1 to 20). The 12V supply also powers a series of front panel illumination LEDs, and they momentarily dim during the pulse, which seems to suggest that a big load is being put on the 12V supply every time any of P0 thru P7 goes high.

Given that this circuit is near-identical to the one for volume, I can only think that the paralleling of the ULN2803 input pins is responsible and somehow causing a short, but I cannot fathom out how or why. The relay coils are not connected at this point. I tried to model it in Spice to prove one way or the other but didn't have a lot of success there either (I'll talk about that separately if needed), so I'm having to fall back on the Audio Talk hive mind.

I'm pretty sure the ULN2803 can handle two relay coils in parallel per output so the fix is easy enough, but if I'm going to have to go through the hassle and expense of redesigning and remanufacturing the PCB, I want to be sure of the root cause first. Basically, did I make a dumb mistake with the ULN2803 wiring?

This is a PDF of the complete PCB which might be easier to read than the jpegs - https://user.fm/files/v2-242081f2a53cf9 ... Driver.pdf
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
Tony Moore
Old Hand
Posts: 495
Joined: Thu Aug 02, 2007 12:24 am
Location: New Brighton

#2 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Tony Moore »

I can't see anything wrong with the circuit you have.

Is it possible you have a solder bridge somewhere?

Cheers,
Tony
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#3 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Nick »

It looks to me that when the output of the relay driver is puled low it will be passing 360ma through the 33R resistor, and for that time the resistor will be dissipating 4.3W which seems a little high, but it is only a moment I guess. And both those numbers will be doubled when you are driving two relays at the same time. You will also be passing the relay current plus the 360ma when the relay is in circuit.

That may or may not help. I would have though a h-bridge would have been a better choice to set and reset the latching relays.

But it doesn't really explain why it works with one switched channel but not two unless the 720ma is enough to cause a problem.

Maybe try an ammeter in the power line and see exactly what current is being pulled? If we know the current it would help point to what the problem is.

I assume the SSR is there to avoid the 12v line being present until the processor is setup?
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#4 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

Thanks Nick. It's a very short current pulse so the question is whether the ammeter will respond quickly enough. I'll try wiring it in later on and see.
Nick wrote: Mon Jan 02, 2023 4:33 pm I assume the SSR is there to avoid the 12v line being present until the processor is setup?
Correct, this is the circuit for the original AMB boards which mine is effectively a clone of:

Image

but if you apply power to the board without the software running, or if the software freezes up completely before it initialiases the ports (as it did in my case), then ULN2803 and the series resistor networks get very, very hot! I figured out that I had enough spare ports to add those SSR's as a safety measure.
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#5 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

Nick wrote: Mon Jan 02, 2023 4:33 pm It looks to me that when the output of the relay driver is puled low it will be passing 360ma through the 33R resistor, and for that time the resistor will be dissipating 4.3W which seems a little high, but it is only a moment I guess. And both those numbers will be doubled when you are driving two relays at the same time. You will also be passing the relay current plus the 360ma when the relay is in circuit.
I missed that when I analysed the original circuit. So each time a relay is triggered, you've got a small amount of current driving the relay in series with the 33R resistor, but added to that is a bigger lump of current being drawn through the 33R resistor on the other side, not achieving anything useful. The engineer in me really doesn't like that.

That said, I don't think the current draw is a problem as the volume control circuit successfully flips 6 relays simultaneously at the -31/-32dB crossover point. But it will be putting an unnecessary strain on the power supply.
Nick wrote: Mon Jan 02, 2023 4:33 pm That may or may not help. I would have though a h-bridge would have been a better choice to set and reset the latching relays.
I agree, these 33R / 47R resistor networks seem like a bit of a sticking plaster to me, the more I look at this circuit the more I'm convinced it could be done so much better. If I have to redo the PCB anyway, then I may as well improve the design. I really don't like having any resistance in series with the relay coils. After added the safety SSR's, I felt it was safe to drop the value a bit to ensure the relay coils got something closer to 12V, but of course I didn't take into account what would happen on the other side. An H-bridge sounds ideal.
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#6 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Nick »

An H-bridge sounds ideal
Or don't use latching relays.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#7 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

Nick wrote: Mon Jan 02, 2023 7:01 pm
An H-bridge sounds ideal
Or don't use latching relays.
Yeah... bit late for that...
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#8 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

Tony Moore wrote: Mon Jan 02, 2023 4:24 pm I can't see anything wrong with the circuit you have.

Is it possible you have a solder bridge somewhere?

Cheers,
Tony
I did check the board pretty carefully after it was done, but there is always that possibility - I'll take another look over it.
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#9 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

OK so I found the Texas Instruments datasheet for the ULN2803A here: https://media.digikey.com/pdf/Data%20Sh ... ev2015.pdf . I wanted to look at the TI one specifically as they sometimes have example circuits.

Looking at page 11, there is an example showing the input pins being parelleled to drive heavier loads - exactly as I have wired them. So that proves to me that the circuit is valid - the fact it doesn't work does seem to indicate some kind of fault rather than a design issue. So now to track down what that is.

The ULN's were put under some strain that time that I had a software crash and this is the first time they've had 12V of VCC (previously it was 5V), this could possibly be an issue with the chips themselves. The plan is to swap positions with the ones that are working and retest, then measure some of the voltages to see what deviations exist there.

Watch this space...
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#10 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

OK, so the voltages to the relay coils all checked out - 11.97V on all of them, as expected.

I then removed the darlington chips for the volume control side and retested. The panel lights no longer dimmed, and this was an interesting data point - when the source is switched, the volume is reset as well (it stores the last volume setting for each source) so you get activation of the volume relays - and it was this that was causing the slight dimming.

So - no shorts or anything like that, but it does look like I may have made the wrong choice for the 33R network resistors, I think they need to be more like 82R (the official boards have them at 47R with a 5V supply, the relay coils have to be rated at 4.5V). If anyone has any useful tips on how to desolder a 10 legged through-hole component without damaging the PCB, I'm all ears. Failing that, I do have four other PCB's...

I also swapped around the ULNs and port expanders to exclude the possibility of chip faults - long story short, it's currently pointing towards the PCF8574's on the input select side simply not responding to their I2C signals. I've double checked that the addresses match the jumper settings, and I also know the I2C bus is fine - it passes under the two chips from the Arduino before terminating at the connection to the front panel LEDs and pushbuttons, and they work fine.

Now I do know that the PCF8574's in question are responding to their initialisation signal, which resets their outputs to low from high - otherwise the SSR's wouldn't activate from P7 and the 12V power wouldn't be reaching the darlington arrays. That is done by the software in quite a 'brute force' way - it loops around initialising all I2C addresses to ensure everything is 'caught in the net'. I'm currently thinking this might be some issue with the addressing.

I should be able to confirm the address they are responding on by adding a delay and display to that code loop, and noting when the power LED lights. indicating activation of the SSR.
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#11 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Mike H »

Why do the resistor arrays have to be 33R?

I tend to agree with Nick I wouldn't have tried to use latching relays, but just have them on or off through software. Image

Is it possible to do a test with only 1 input of each ULN2803 – just to prove it...
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
simon
Thermionic Monk Status
Posts: 5600
Joined: Thu May 24, 2007 11:22 am
Location: People's Republic of South Yorkshire

#12 Re: PCF8574 to ULN2803 - have I done something daft?

Post by simon »

Thermionic Idler wrote: Tue Jan 03, 2023 7:13 pm If anyone has any useful tips on how to desolder a 10 legged through-hole component without damaging the PCB, I'm all ears.
Can you snip the legs to remove the chip, then desolder each remaining bit of leg in turn?
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#13 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Nick »

Maybe for the moment worth checking if brownout detection is enabled in the processor and if it is, either reduce the test voltage or disable it. May prevent the reset when the voltage drops.

As for the desoldering I was going to suggest the same as Simon. Cut the pins as close to the body as possible to give you the most to get hold of when taking the pin out. I find having a couple of hemostat forceps on hand is the best thing when doing this. Clamp then onto the cut pin from the top side, then turn the board over and apply heat. The weight of the clamps will pull the pin through the board without stressing any tracks.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#14 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

Mike H wrote: Tue Jan 03, 2023 7:41 pm Why do the resistor arrays have to be 33R?
They don't, in fact I think I picked too low a value for them because I didn't analyse the circuit deeply enough for the change to 12V relays.
Mike H wrote: Tue Jan 03, 2023 7:41 pm I tend to agree with Nick I wouldn't have tried to use latching relays, but just have them on or off through software. Image
TBH If I'd been starting from scratch, then I probably wouldn't have used them either. I did a lot of research and decided in the end that I wanted to stick with the AMB solution as a base because it had a number of convenience features that I did not want to go away - the easy remote learning, saving the volume setting for each channel, use of a motorised pot, plus the software was well written and commented so it wasn't impossible to add the new front panel feature by extending the I2C bus.

But it was also designed to use latching relays, and if I'd changed to monostable types then I'd have had to make more extensive changes to the software.
Mike H wrote: Tue Jan 03, 2023 7:41 pm Is it possible to do a test with only 1 input of each ULN2803 – just to prove it...
That's an idea, I might be able to manually pull one input to ground but I'll have to check this won't do anything bad to the port expander...
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
User avatar
Thermionic Idler
Old Hand
Posts: 1018
Joined: Sun Apr 22, 2012 8:22 pm
Location: Southsea

#15 Re: PCF8574 to ULN2803 - have I done something daft?

Post by Thermionic Idler »

Nick wrote: Tue Jan 03, 2023 9:08 pm Maybe for the moment worth checking if brownout detection is enabled in the processor and if it is, either reduce the test voltage or disable it. May prevent the reset when the voltage drops.
I don't think it is enabled BUT it should not be affected by 12V voltage drops as it has its own independent 5V regulated supply with a dedicated transformer secondary. So the voltage supplying the the processor and port expanders should be absolutely clean and stable regardless of what's happening on the supply to the relay coils.

EDIT - I think I will be upping the 12V rail to 15V so that I can raise the current limiting resistor values significantly whilst still being able to feed 12V to the coils. (The relays have already been purchased and soldered to the signal PCB so I'm kind of committed to them at this point). Some tweaks will be required here and there but that should reduce the current draw significantly at the point of relay activation.

That's a secondary issue to the primary one though - I have to solve the non-response of the PCF8574's first.
Last edited by Thermionic Idler on Wed Jan 04, 2023 3:10 pm, edited 2 times in total.
Deck: Garrard 301 - Audio Origami PU7 - NW Analogue DH3S
Phono: Pete Millett LR, Lundahl SUT, AMB σ22 PSU
Linestage: Bruno Putzeys Balanced Pre + Hans Polak relay mod, LCDuino control
Power amps: 300B PP 'Symmetric Reichert'
Speakers: FF225WK Big Mets
Post Reply