The magnetic field in a regular, non-latching relay is static, so I wouldn't worry about it coupling into audio circuits. You could potentially get some coupling when the relays are switching, but that's no different from latching relays.i was looking into latching type of relays, do you guys think these are any better than constantly powered ones in terms of the magnetic field they emit once switched?
With latching relays you trade energy efficiency for complexity. You need twice the driver circuitry (or 4x for a single coil latching relay), but the relays don't use power once they're switched. They also remember their settings when the power goes out.
Tom
The magnetic field in a regular, non-latching relay is static, so I wouldn't worry about it coupling into audio circuits. You could potentially get some coupling when the relays are switching, but that's no different from latching relays.
its hard to say what really matters in the end here, tho if i wanna do it "OCD-like" i rather have no other signal around the audio signals active (as long i dont change volume), so preferably the audio path relays board is completely passive in normal use
for this reason i already wanted to provide clean 5V to the ULN2003, having a noisy power supply lane pretty close to the audio path might be better avoided if you can?
question in the end also is, how noisy are the transistors inside the ULN2003, but since it just powers relay coils im more worried about "stray intereference" than actual "circuit interference", or well i should put it like this: if stray interference can be avoided, and its somewhat easy to implement, why not?
For me this is more of a project of tweekeray, i only wanna build this to avoid the builtin (digital) volume pot on my interface (Well and for further comparisons as a A/B switch (or just conveniently as multiple sources/ multiple speakers switch) which would finally make it convenient to get some small wideband drivers as studio monitor alternative 🙂
the difference between digital volume and passive volume is probably marginally to begin with
preferably as transparent (and convenient eg remote/display etc) as possible, so i dont feel the need of making another one anytime soon
getting a palmer P4 i think it was called, a transformer based unbalanced to balanced converter... this thing was definitely NOT transparent, i hope i can make the volume control better than this...
the thing is definitely here: if im looking for ready made units with the same features im looking at 500-1000 atleast, so do i really care if my BOM is 10 euro more? 🙂
the difference between digital volume and passive volume is probably marginally to begin with
preferably as transparent (and convenient eg remote/display etc) as possible, so i dont feel the need of making another one anytime soon
getting a palmer P4 i think it was called, a transformer based unbalanced to balanced converter... this thing was definitely NOT transparent, i hope i can make the volume control better than this...
the thing is definitely here: if im looking for ready made units with the same features im looking at 500-1000 atleast, so do i really care if my BOM is 10 euro more? 🙂
Last edited:
Then do the math on it. Many small signal relays will tell you how much capacitance there is from the coils to the switch elements, for example. Include those in a circuit simulation and see how much they matter.Its hard to say what really matters in the end here, tho if i wanna do it "OCD-like" i rather have no other signal around the audio signals active (as long i dont change volume), so preferably the audio path relays board is completely passive in normal use
Sure. But that's easy. Put a voltage regulator on the supply for the ULN2003. I can't think of a compelling reason not to do that. Most audio circuits run on ±15 to ±17 V. Relays are commonly available with 12 V coils, so you have 3 V to play with.for this reason i already wanted to provide clean 5V to the ULN2003, having a noisy power supply lane pretty close to the audio path might be better avoided if you can?
Not very. If you're using the ULN2003LV, the MOSFETs have pretty low on-resistance, so they won't make much noise.question in the end also is, how noisy are the transistors inside the ULN2003
Sure. But if worrying about all this causes you to develop an ulcer, I'd say it's best not to worry., but since it just powers relay coils im more worried about "stray intereference" than actual "circuit interference", or well i should put it like this: if stray interference can be avoided, and its somewhat easy to implement, why not?
I bet if you draw the circuit diagram with the parasitics included and run a simulation you'll find that the coupling from the coils to the rest of the circuit is pretty minimal. Not zero, of course, but low enough that you don't have to worry about it.
I'd worry more about coupling between left and right channel within the same relay. That's easily solved by using separate relays for left and right channels.
You could then worry about the off attenuation. Have a look at Douglas Self's writing about relay switches either in Wireless World or in his Small Signal Audio book. It wouldn't surprise me if capacitive coupling across open relay switches could end up wrecking the off attenuation, especially at higher frequencies. But that's something that's easy to simulate and design around if it's a problem.
Tom
I choose to use non-latching relays in my design, it is simpler and does not effect sound. Power consumption is minor, 5 watts per hour for however long you have the power on. Without balance control my previous design used a Arduino Nano but when I went to balance, muting, display dimming, standby mode, etc. I ended up using an Arduino Mega for the higher I/O pin count. Cost difference is $7 for a Nano and $20 for a Mega. The cost different is worth the straight forward programming of more I/O pins. The Kemet EC2-5 relay uses 20 ma and has gold plated small signal contacts that have no audible artifacts.
If the processor also has to do other things, e.g. input, signal, function switching, then a small processor with several expander pots is better.
expander pots = expander mcu's right?If the processor also has to do other things, e.g. input, signal, function switching, then a small processor with several expander pots is better.
currently it looks like i will do a atiny for the relayboard, which contains 2 channels, either 1x balanced or 2x unbalanced
everything else is probably easier done in the arduino domain with certain ready made boards, displays and such, arduino will communicate with the atiny over either i2c or uart, actually i think only i2c supports different addresses, allowing with X relay boards to build a multichannel volume control and such in the future
currently for the relayboard i made a first draft, with kemet ec2 (double coil latching), kimase 2W resistors, 2x ULN2003 and atiny 3226
either 3V relais or 5V im not sure yet, theoretically 3V induces less stray interference, nothing to lose your sleep over but, why not, i will just provide either a 3 or 5V input on the board and probably regulate the voltage with a seperate board or connect it direclty with some caps
will come back in a couple of days with schematics of input switcher board & attenuator board (nothing final yet, so feel free to discuss) i just feel more comfortable doing it the OCD way, hehe 🙂
regarding the switcher board and combatibility to multi channel setups, its probably best to stick with my stereo 2x2XLR inputs & 2x2XLR output idea, hard to plan for further setups here...
The Kemet EC2 relay coil uses 140 mW nominally. Let's just say you have up to 17 relays engaged at one given time; 2x8 for the attenuator and one for the input selector. That's 2.38 W.Power consumption is minor, 5 watts per hour for however long you have the power on.
More realistically, you'll have half the relays in the attenuator engaged, plus the one in the input selector. That's 1.26 W ... or about the loss in
one of the older transformer-based wall warts.
I'm thinking "expander pots" should have been "expander ports". Port expanders are chips that usually take a serial input of some sort and deliver a number (8-16 usually) of I/O ports. They're nice in that the allow you to use a 'dumber' (and, thus, lower cost) MCU but also in that they allow you to put the ports where they're needed on the PCB and just run 2-3 traces to them for control. The drawback is a slight increase in code complexity because you now need to talk to a serial port (usually I2C or SPI). These days that's usually not the end of the world, though.expander pots = expander mcu's right?
Tom
Why not just use the MCU directly? I've used the LPC8xx-series from NXP in a few products. The IDE is well-developed and available for many platforms. You select the modules within the MCU that you want to use and program it in C. The $3.50 (QTY 1, Mouser) LPC845 has 42 I/O lines, ADC channels, DACs, PWM, you name it.I ended up using an Arduino Mega for the higher I/O pin count. Cost difference is $7 for a Nano and $20 for a Mega.
Or if you don't want to buy or build a programmer for it, you can get the $6.87 evaluation board for it. That eval board can be turned into a programmer if you're on a budget.
Tom
ah nice, i have to look into these, thanksI'm thinking "expander pots" should have been "expander ports". Port expanders are chips that usually take a serial input of some sort and deliver a number (8-16 usually) of I/O ports. They're nice in that the allow you to use a 'dumber' (and, thus, lower cost) MCU but also in that they allow you to put the ports where they're needed on the PCB and just run 2-3 traces to them for control. The drawback is a slight increase in code complexity because you now need to talk to a serial port (usually I2C or SPI). These days that's usually not the end of the world, though.
i wanted initially to use a microcontroller so the code that controls volume is seperated and the "display mcu" only needs to write "volume: 30" or such over i2c
maybe this would help run the volume adjustments smoother, more reliable since the mcu can focus on just that
tho if volume adjustments can be done reliably on a "busy" mcu expander ports might be the way to go, its probably just a software thing to figure out...
Yeah...I love jelly bean solutions.
Or port expanders:
The PCA9555 can be configured so it offers both inputs and outputs. That's harder to do with jelly beans. 🙂 The upper seven bits on U5 are inputs. The rest are outputs.
Also note the programming interface in the upper left (J1). That and the resistor network to the right of it is literally all that is required to move from something like the Arduino to a stand-alone MCU.
Tom
Me thinketh thy think too much.i wanted initially to use a microcontroller so the code that controls volume is seperated and the "display mcu" only needs to write "volume: 30" or such over i2c
maybe this would help run the volume adjustments smoother, more reliable since the mcu can focus on just that
Relays take time to operate. The Kemet EC2, for example, takes 1-2 ms just to move the armature. Then the switch will bounce for a while. You can figure that after 10ish ms the relay is done switching. Even ancient MCUs like the 8051 running at 12 MHz (-> 1 MHz instruction clock) will be able to execute 10000 instructions in the amount of time it takes for the relay to switch. Newer MCUs would be able to do even more.
Humans are slow compared to an MCU. You're very unlikely to notice any delay as long as the display updates within 100 ms of user input. That's a lot of instruction cycles for a modern MCU.
The first schematic snippet in my post above is from the display of a preamp. The display has four 7-segment LED displays in it. I decided to geek out and have the brightness set by an ADC that controls the constant current source in the common cathode of the display. To get the same brightness in all display segments, the display current has to be set according to the number of segments that are being shown, which in turn depends on which digit is being shown. On top, I have two brightness levels. One that's used when the user turns the encoder (or hits a button on the remote control) and one that's used when there's no user input. So there's a lot of table look-ups and also a bit of math going on whenever the display is updated. Most math is slow ... very, very slow ... on most MCUs and the Atmel MCU I used is no sprinter. Still, I can't spin the encoder fast enough to make it skip a beat.
Also keep in mind that because of Atmel's crappy tools at the time I ended up bit-banging all the connections to DAC, port expander glue logic, etc., which ate up even more CPU cycles.
Once you get the SPI or I2C figured out, port output becomes as simple as dropping a byte into a register and moving on. Reading from a port expander is not much more complicated, but like reading from any port, you have to choose if you want to use polling or set up an interrupt service routine. I chose the latter in the second schematic snippet. The PCA9555 conveniently has an interrupt pin that'll let you know if its input ports have changed.tho if volume adjustments can be done reliably on a "busy" mcu expander ports might be the way to go, its probably just a software thing to figure out...
Tom
Do you guys have a recommendation for a "solid" volume pot for the arduino?
i cant imagine that these cheap rotary encoders feel great
i was thinking of maybe using a 10k high quality pot and building a voltage devider going into a analog input
----
also, i just came up with an idea to utilize 4 bit i2c adress selection and only using 1 mcu pin, 2 pins if you wanna save power and only power the voltage devider network if the mcu needs to read the adress at startup...
i cant imagine that these cheap rotary encoders feel great
i was thinking of maybe using a 10k high quality pot and building a voltage devider going into a analog input
----
also, i just came up with an idea to utilize 4 bit i2c adress selection and only using 1 mcu pin, 2 pins if you wanna save power and only power the voltage devider network if the mcu needs to read the adress at startup...
Last edited:
Some of them do. Some of them don't. They're cheap, so you can buy a few and find one you like. One could also entertain the thought of running the encoder shaft through a linear bearing or maybe just a slip fit bushing and get a better feel that way.Do you guys have a recommendation for a "solid" volume pot for the arduino?
i cant imagine that these cheap rotary encoders feel great
Yeah. That's commonly done. Get a linear ALPS RK271-series pot. But, of course, unless you get a motorized version you then also wave bye-bye to remote control.i was thinking of maybe using a 10k high quality pot and building a voltage devider going into a analog input
Multi-level "digital" inputs have been a thing for quite a while now. Some have 16 levels.also, i just came up with an idea to utilize 4 bit i2c adress selection and only using 1 mcu pin, 2 pins if you wanna save power and only power the voltage devider network if the mcu needs to read the adress at startup...
Also note that your assembly cost just went up by a fair bit as the operator of the pick-n-place machine now has to load four more reels of resistors into the machine. Manual labour is expensive. You'd be better off by going with R+R+R+R or something like R2R. Not that DIY has to be cost-optimized, but I thought I'd just add that perspective as well.
I'm curious why you'd want to change the I2C address, though.
Tom
Tom, what if you use the three states of the PIC I/O 1, 0 and high impedance. I did that many years ago in a project that only used an 8 pin device and created double the I/O.
- Home
- Source & Line
- Analog Line Level
- DIY Volume Control (Relay Attenuator)