Hello,
I am working on an audio volume control project using optocouplers.
The idea is to have the arduino run in two modes: calibration and control.
the way i can see it working is the following:
Calibration mode:
1- The arduino uses a predefined array of pwm values to control the LEDs in the optocouplers (4 optocouplers total for stereo volume control, one series and one shunt optcoupler per channel so as to mimic a potentiometer)
2- For each pwm value (probably around 100 values), the LDR impedance is read and stored in the table as corresponding to the pwm value.
once this is done for all 4 optocouplers and all 100 pwm values, calibration is done
Control mode:
Using a log potentiometer as a controller (pot has same range as optocouplers):
1- arduino reads the pot value between input and wiper and looks up the closest value in the impedance columns for the series opto arrays and returns the corresponding pwm value.
2- arduino reads the pot value between wiper and ground and returns the closest shunt value by looking up in the shunt array and returns the corresponding pwm value.
3- arduino uses the looked up oem values to run the LEDs in the optocopler.
That's the approach in a nutshell (a big nutshell i agree :))
Is it feasible?
Are there any fundamental flaws in this approach?
P.S: Some of you are wondering why go through that all that control for a simple volume control. Wrll in the audio world, pots are often considered noise generating devices and doing away with a pot's contacts makes for better sound.
The other thing is that optocouplers are seldom matched in the impedance response curve, meaning that in order to have good tracking between channels, one must either hand-match all optos (a long and tedious task, especially that optos have temp drift) or go for an active solution (as the one proposed here)
An opto is comprised of two parts; an LED and a LDR, both encased in one package.
the LDR's resistance is controlled by the LED's power.
you are right that in most cases an opti is used in a "digital" fashion, turning it full on for minimum resistance or full off for maximum resistance.
In the case the idea is to use in an "analog" fashion whereby the resistance is varied continuously from minimum to maximum.
hope it clears things up
Regards
Nick
An LDR is a Light Dependent Resistor or a photoresistor if you prefer this terminology.
what you are talking about is a photodiode or phototransistor.
There are two types of optocouplers, some have a phototransistor output, others an LDR output.
You might only be familiar with the former while in my project I will be using the latter. (NSL-32SR2 optocouplers should you want to look up the datasheet and use your electronics degree to interpret it)
I really hope this puts the issue to rest and we can get back on topic.
Regards,
Nick
Hi,
what is your electronics, programming, arduino, hardware experience?
Is this a school/college/university project?
Do you realise that using PWM on the LED, that the PWM signal will be modulating the photo-transistor resistor and you will have an over whelming level of noise at the PWM frequency on the audio you are aiming to control.
Can you please post a copy of how you aim to connect the circuit in including the arduino, in CAD or a picture of a hand drawn circuit in jpg, png?
Tom....
EDIT;
NSL-32SR2 optocouplers , you should have said so in your first post.
My comments about the PWM remain the same.
Thanks for chiming in Tom,
I plan on changing the pwm frequency and shift it high enough to be outside the audio band, iirc around 62khz is the maximum arduino can handle.
furthermore, LDRs have a relatively slow response time which makes their resistance quasi stable when the a frequency above a certain threshold is used.
this is a personal project i'm doing for my audio setup and my experience in building hardware spans multiple amplifiers, preamplifiers and tube amplifiers
i have also built a controller/timer for my amp using an arduino based setup using pre-existing sketches and hardware shematics that I adjusted to fit my needs.
Programming-wise is where i lack some knowledge and is the reason why i posted here hoping for some help, but it seems people are more interested in my background than the actual project itself.
Regards
Nick
TomGeorge:
Hi,
Your option with the PWM noise would be to LP filter the arduino output to a DC voltage level then apply it to the LED.
Tom......
You are right, low passing the output is also an option
At one point i also thought about using a 16-bit DAC to drive the leds as I wanted really fine control on the output voltage; at lower resistance values the LDRs' resistance vary a lot with the tiniest voltage change. But i could be biting more than i can chew with a DAC setup.
Hajj:
Programming-wise is where i lack some knowledge and is the reason why i posted here hoping for some help, but it seems people are more interested in my background than the actual project itself.
Regards
Nick
This is obviously aimed at me.
Without knowing the background of a new member, we cannot aim any advice at the right level. You gave no indication of your knowledge until the last post. Therefore you are assumed to lack knowledge.
There are many posts with ambitious projects. It is only later we learn that the poster has no knowledge at all on the project.
We also are expected to answer with less than all the information on parts being used.
Weedpharma,
I don't mind explaining what my background is, as has been cleared up in my reply to Tom.
What i do react negatively to, is the patronizing tone, especially when the facts i put forth are erroneously considered wrong.
Anyway, now that we're done with that part, shall we get back on track?
Regards,
Nick
The more i think about it, the more a rotary encoder makes sense for controlling it.
this would mean an additional array though containing the logarithmic scale.
I don't understand why you want to re-invent the wheel.
Passive/attenuation volume control has been done for donkeys ages with resistors and (electronic) switches.
I made one in the eighties with I think a HEF4053.
There also is "active" volume control, where you change the gain of an opamp.
The type of photocell you're describing has never made it past PA gear and guitar amps.
Did you think about using an R-2R network.
Or even a log one, because lineair is not a good idea for volume control.
Wawa:
I don't understand why you want to re-invent the wheel.
Passive/attenuation volume control has been done for donkeys ages with resistors and (electronic) switches.
I made one in the eighties with I think a HEF4053.
There also is "active" volume control, where you change the gain of an opamp.
The type of photocell you're describing has never made it past PA gear and guitar amps.
Did you think about using an R-2R network.
Or even a log one, because lineair is not a good idea for volume control. Logarithmic resistor ladder - Wikipedia
Leo..
Hi Leo,
Actually it has made it well past PA and guitar amps.
One of the best regarded volume attenuators for hi-fi is a setup similar to what i plan on building called the "lightspeed attenuator".
Exxept that this setup relies on prematched optos, which requires buying a good 100 optos and trying to find in that lot 2 pairs that track well throughout the required resistance range.
that's why i'd want to do something that does away with the matching part As well as keeps it fully passive, no opamps (especially that opamps can't go below a gain of 1)
As to digital pots, they tends to inject noise into the signal as well as have limited bandwidth (especially at higher frequencies)
An R-2R network still has contacts in the signal chain (usually relays) which is something i want to avoid.
What could be interesting though is to use a digital pot to control the voltage going to the LED.
Regards
Yes, I know the principle behind a two-LDR attenuator.
I played with it in the fifties.
Valve amps and valve compressors used it.
After that, the fet attenuator ruled.
But, nice project to find out the limitations.
Are there any noise/distortion tests available?
Leo..
Wawa:
Are there any noise/distortion tests available?
Leo..
I remember a forum member on diyaudio once trying to get some distortion measurements, and back then, it seemed that DC biasing the LDR side gave some improvements in terms of harmonics signature. I really don't remember ehat the figures were by they were pretty low.