|Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
||Thread Tools||Search this Thread|
|19th August 2015, 02:40 PM||#1|
Join Date: Jan 2011
Arduino based LDR volume and source selection controller
I needed a remote controlled, very high audio quality attenuator for a preamplifier that I built. After considering the various options, I decided to design my own LDR volume controller.
It took a lot of effort, but it works well now, I'm pleased with the result. I would like to share the project with the DIY community, in case someone is interested.
So, here it is:
- customizable impedance, between 5kohm and 50kohm
- customizable number of attenuation steps, between 20 and 80
- you do not need matched LDRs
- LOG attenuation curve
- you can display your own welcome messages on the LCD screen
- the firmware is easy to update and modify
- remote controlled with any Apple remote
- big LCD screen, the volume level is displayed with 4-char high digits, easy to see from a distance
- the screen auto-dims to a customizable level after some inactivity time
- rotary encoder with push button
- controls up to 6 input and output stereo channels
- I/O switching is done with best quality latching relays with Silver-Palladium contacts, to avoid any degradation of the musical signal
- you can name each input and output channel
- the controller remembers the settings after power off
- can control a delay relay to soft-start a tube preamplifier
- achieves a large attenuation range by increasing series resistance at very high attenuation level and by increasing shunt resistance at very low attenuation level
- the calibration compensates for the load impedance effect
- the on-board calibration relays are best quality and they are powered only during calibration
- the LDR LEDs are working at low current (7 mA maximum), they will last a very long time
- the controller is isolated from the audio ground to avoid noise and loops
- separate linear analog and digital low noise power supplies
- power supplies on separate board, to keep the power transformer far from audio circuits
- easy to calibrate anytime from a menu – no need to plug jumpers or an external module
- better audio quality than R-2R relay attenuators (no multiple relay contacts and solder joints in the signal path, no noisy relay coils)
It is Arduino based - there are more powerful microcontrollers available, but the Arduino is much easier to work with, any amateur can easily update and customize the software.
The DACs are simply the PWM outputs switched to 31250 Hz (instead of the 500 Hz default value) and easily filtered to clean DC by two R-C cells.
The whole thing should cost around 100€ to build, much cheaper than the equivalent commercial solutions available.
I ordered the PCBs from ShenZhen2U ?PCB|Source|Assembly|Components-ShenZhen2U , where 10 pieces of 2 layer PCBs cost 10€.
You can even make the power supply and I/O boards yourself, to save some money, with the toner transfer method or even "by hand", because they are simple and single layer.
If you only need the volume control without channel switching, don't order the I/O board and parts and configure the software for either zero I/O (the volume will be displayed in the middle of the LCD in this case) or one input or output (if you still want to display a channel name).
Project status: built and confirmed.
The latest version (23 November 2015) of the project package is here: Arduino based LDR volume and source selection controller
Improved firmware by Wineds is here: Arduino based LDR volume and source selection controller
Firmware modified to support both 2004 and 1602 LCD by Howarthcd: Arduino based LDR volume and source selection controller
Zdr's custom code for OLED and LCD displays + bugfixes: Arduino based LDR volume and source selection controller
Last edited by Vincent77; 6th December 2016 at 03:06 PM.
|23rd August 2015, 03:43 PM||#6|
Join Date: Jan 2011
The Arduino is quite limited, it doesn't even have DAC outputs. But with some hacks, it can brilliantly do the job!
As said before, the PWM outputs are switched to 31250Hz, and thus easily filtered, making an 8 bit DAC. To overcome the low precision of this "DAC", the software can switch the driver MOSfets between two working ranges: low current and high current. This is enough to control the LDR current with acceptable precision.
The ADC inputs are oversampled to 12 bit (instead of the default 10 bit).
The target resistance values are computed for each LDR and each attenuation step. The code then searches for the needed current which gets the measured resistance as close to the target resistance as possible.
During normal use, the current through each LDR is permanently measured and fed back to the DAC control code in order to compensate for temperature drifts.
|23rd August 2015, 05:30 PM||#7|
Join Date: Jan 2011
Last edited by Vincent77; 23rd August 2015 at 05:33 PM.
|21st September 2015, 08:47 AM||#10|
Join Date: Mar 2013
Location: Ancona but roaming in Rome, Milan and Turin.
I subscribe this thread - for now I can't build one, but this is the candidate for my DCB1 volume controller... In the while, I may source some LDRs...
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Another Modified PGA2311 kit with Arduino for volume control and input selection||cjkpkg||Analog Line Level||29||17th September 2019 12:04 PM|
|Passive Preamp: Arduino based, remote control, Relay R2R, input selection||maxw||Analog Line Level||104||18th July 2019 10:13 AM|
|LDR Based Input Selection||udailey||Analog Line Level||27||8th November 2018 04:37 PM|
|Source select and passive volume for microcontroller-based preamp?||vputz||Analog Line Level||3||21st July 2012 11:51 AM|
|WTB: LDR-based volume control / pre||jdubs||Swap Meet||7||2nd December 2010 02:50 AM|
|New To Site?||Need Help?|