Arduino based LDR volume and source selection controller - diyAudio
Go Back   Home > Forums > Source & Line > Analog Line Level

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
Reply
 
Thread Tools Search this Thread
Old 19th August 2015, 01:40 PM   #1
diyAudio Member
 
Vincent77's Avatar
 
Join Date: Jan 2011
Location: Bruxelles
Default Arduino based LDR volume and source selection controller

Hello,

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 zero I/O. The volume will be displayed in the middle of the LCD in this case.

Everything you need is in the attached archive. The board files can be opened with Eagle (free).

Disclaimer: it works well for me, but the controller hasn't been tested by someone else yet, so project should be considered a "release candidate" - it may still contain small bugs.
Attached Images
File Type: jpg P8020026.JPG (48.3 KB, 193 views)
File Type: jpg ctrl.jpg (161.9 KB, 194 views)
File Type: jpg mainboard.jpg (252.8 KB, 191 views)
Attached Files
File Type: zip LDR Controller.zip (813.7 KB, 56 views)

Last edited by Vincent77; 23rd August 2015 at 12:36 PM.
  Reply With Quote
Old 19th August 2015, 01:48 PM   #2
diyAudio Member
 
jackinnj's Avatar
 
Join Date: Apr 2002
Location: Llanddewi Brefi, NJ
Nice job.

I've used the Arduino and the ADI ADG1414 octal switches.
__________________
A preferential option for the poor, need not imply a preferential option for the state.
  Reply With Quote
Old 23rd August 2015, 09:30 AM   #3
diyAudio Member
 
Join Date: Jul 2015
Location: gothenburg,sweden
Du you have board(s) to sell ? Or even komplete kit's ?
  Reply With Quote
Old 23rd August 2015, 12:31 PM   #4
diyAudio Member
 
Vincent77's Avatar
 
Join Date: Jan 2011
Location: Bruxelles
No, I don't sell boards/kits myself, but it's easy to order them online.
  Reply With Quote
Old 23rd August 2015, 01:41 PM   #5
maxw is offline maxw  United Kingdom
diyAudio Member
 
maxw's Avatar
 
Join Date: Jun 2004
Location: London
Looks interesting. How does calibration work exactly?
  Reply With Quote
Old 23rd August 2015, 02:43 PM   #6
diyAudio Member
 
Vincent77's Avatar
 
Join Date: Jan 2011
Location: Bruxelles
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.
  Reply With Quote
Old 23rd August 2015, 04:30 PM   #7
diyAudio Member
 
Vincent77's Avatar
 
Join Date: Jan 2011
Location: Bruxelles
Quote:
Originally Posted by Vincent77 View Post
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.
Talking about the precision: the controller can approach the target LDR resistance within 0.1% at 1K, 1.5% at 10K and 5% at 50K

Last edited by Vincent77; 23rd August 2015 at 04:33 PM.
  Reply With Quote
Old 23rd August 2015, 06:15 PM   #8
maxw is offline maxw  United Kingdom
diyAudio Member
 
maxw's Avatar
 
Join Date: Jun 2004
Location: London
Sounds interesting. Do you have a schematic as an image?
  Reply With Quote
Old 23rd August 2015, 06:27 PM   #9
diyAudio Member
 
Vincent77's Avatar
 
Join Date: Jan 2011
Location: Bruxelles
There's a PDF schematic in the ZIP archive.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passive Preamp: Arduino based, remote control, Relay R2R, input selection maxw Analog Line Level 20 23rd July 2015 06:38 PM
Another Modified PGA2311 kit with Arduino for volume control and input selection cjkpkg Analog Line Level 27 15th February 2015 05:41 PM
Source select and passive volume for microcontroller-based preamp? vputz Analog Line Level 3 21st July 2012 10:51 AM
LDR Based Input Selection udailey Analog Line Level 25 5th October 2011 10:03 PM
WTB: LDR-based volume control / pre jdubs Swap Meet 7 2nd December 2010 01:50 AM


New To Site? Need Help?

All times are GMT. The time now is 12:34 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2015 DragonByte Technologies Ltd.
Copyright 1999-2015 diyAudio

Content Relevant URLs by vBSEO 3.3.2