R-2R attenuator PCB layout question

I think yes, we need external diodes across the relay power pins. It makes the loop created by back EMF current much smaller which helps avoiding clicks during relay switching. I use diodes with Vf significantly smaller than 0.6V of the diodes built into the ULN2803A. In addition using low Vf diodes can help keeping the relays closed for a bit longer helping to control ON/OFF timing difference (approaching make-before-break effect), which again helps to avoid pops and clicks when adjusting the volume. The last point does not apply to my later design since there the reverse is needed, longer switch ON and shorter release time to achieve the same effect.

Regards,
Oleg
 
I finally build my R2R attenuator and its giving me some serious headache. I get some serious oscillation and or noise if i dont connect signal and relay grounds together. If i keep them seperated noise kicks in as soon as the first attenuaion relay kicks in.
The attenuator is configured for 20k constant input impedance and works finde besides the noise issue.

Sources of error i already checked and can be ruled out:

Signal Gen - Problem occurs with two different signal sources
Power supply - Problem occurs with cheap switchmodes and highly filtered, noise free linear supplys
Digital interference - Problem occurs also when i connect the relays directly to the power line, basically controlling them by hand

I am starting to pull my hairs out here, anyone got some ideas how to solve that? Shouldnt relay/ Digital ground and Audio ground be seperated and galvanically isolated from each other?
 
I run both grounds together (both connected to chassis) but I use a USB charger as a power source followed by a fully isolated DC-DC converter without problems.

The symptoms which you describe sound like a ground loop somewhere. Try to insert a 10 Ohm resistor in input signal ground to see if it helps. If it is a ground loop somewhere 10 Ohm resistor will significantly reduce its effect and you will know what you are dealing with.

Regards,
Oleg
 
Hey Oleg, great to see you are still around. I suspect something similiar. I will probably connect both grounds together and tie them to chassis in the final assembly, i am still in the pre assembly testing phase though and this really confused me.

I will try the 10 Ohm resistor and will report back with my findings and some screen captures of my scope later this night or the weekende.
 
Just a quick reply:

The 10 Ohm resistor cures the symptons, tying Audio and Digital ground together right at the filter cap cures the problem a lot better.

So i have a ground loop between two galvanically isolated circuits, which confuses me a lot and makes think that i still dont understand ground loops at all. Is there a good readup on the topic? I vaguely remember an article by Papa Pass.
 
Hi Oleg,

I am working on something similar and I like the modular nature of your approach, for example your little universal I2C to 8 relay-drivers board, and that the input selector board is separate so it can be close to the input sockets.
Of course, I had a look at your code. I note that you record every state change of the encoder and, whilst this is important/vital in some scenarios, it is overkill for this application - as demonstrated by your need for a divide of the encoder count. With 4 steps per detent your encoder gives you 256 steps per revolution; if you were to record only 1 step per detent then this would only be 64. You might still choose to divide by 2 but for many encoders there would be no need for a divide at all.
It is quite simple to detect only one event per detent and it would simplify your code. If you still have some sluggishness, it might improve that too. I attach an example sketch of the method I plan to use as I work on my project.
I realise that your project was completed some years ago and you have little incentive to make any changes to a working system. "If it isn't broken, don't mend it". However, I attach it here so you and other readers can see an alternative approach which might be of help. The code is self-documenting (ie. more comments than code).

Regards
Geoff
 

Attachments

  • VolumeEncoder.txt
    2.5 KB · Views: 178
Hi Geoff,

Thanks for posting your code. It is really detailed and very informative!

I've finished my attenuator a while ago and am using it since then. I totally agree that the code can be improved especially from the speed of reaction point of view. If I turn the encoder knob too fast, significantly faster than I would normally use it, then it skips steps. But since in normal operation it does not do it I'm fine with it.

I should say that when I wrote the code I wasn't comfortable with interrupts and did not use them. Also other coding decisions were a bit naive but I may revisit the code at some moment just for fun. I did not fix the top cover of the attenuator enclosure and it stays this way for more than two years... who knows when I get the time to tinker with it again:)

Regards,
Oleg
 
Just a quick reply:

The 10 Ohm resistor cures the symptons, tying Audio and Digital ground together right at the filter cap cures the problem a lot better.

So i have a ground loop between two galvanically isolated circuits, which confuses me a lot and makes think that i still dont understand ground loops at all. Is there a good readup on the topic? I vaguely remember an article by Papa Pass.

Hi Razorblade,

How is it going with the ground loop hunting? When you consider the whole chain it will probably contain more than just two circuits since all circuits include PSUs which may or may not be connected to mains protective earth. Also most of mains powered measurement equipment is connected to protective earth. Some equipment is using USB power and PC connection which again gets connected to protective earth via USB cable ground. So there are many possibilities to form a ground loop.

Regards,
Oleg