Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Arduino based LDR volume and source selection controller
Arduino based LDR volume and source selection controller
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
Vincent77 is offline Vincent77  Europe
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 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
Attached Images
File Type: jpg P8020026.JPG (48.3 KB, 9586 views)
File Type: jpg ctrl.jpg (161.9 KB, 9518 views)
File Type: jpg mainboard.jpg (252.8 KB, 9279 views)
Attached Files
File Type: zip LDR Controller.zip (813.7 KB, 1781 views)

Last edited by Vincent77; 6th December 2016 at 02:06 PM.
  Reply With Quote
Old 19th August 2015, 01:48 PM   #2
jackinnj is offline jackinnj  United States
diyAudio Member
 
jackinnj's Avatar
 
Join Date: Apr 2002
Location: Llanddewi Brefi, NJ
Arduino based LDR volume and source selection controller
Nice job.

I've used the Arduino and the ADI ADG1414 octal switches.
  Reply With Quote
Old 23rd August 2015, 09:30 AM   #3
petertub is online now petertub  Sweden
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
Vincent77 is offline Vincent77  Europe
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: Berlin
Looks interesting. How does calibration work exactly?
  Reply With Quote
Old 23rd August 2015, 02:43 PM   #6
Vincent77 is offline Vincent77  Europe
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
Vincent77 is offline Vincent77  Europe
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: Berlin
Sounds interesting. Do you have a schematic as an image?
  Reply With Quote
Old 23rd August 2015, 06:27 PM   #9
Vincent77 is offline Vincent77  Europe
diyAudio Member
 
Vincent77's Avatar
 
Join Date: Jan 2011
Location: Bruxelles
There's a PDF schematic in the ZIP archive.
  Reply With Quote
Old 21st September 2015, 07:47 AM   #10
ghiglie is offline ghiglie  Italy
diyAudio Member
 
Join Date: Mar 2013
Location: Ancona but roaming in Rome, Milan and Turin.
Wow, nice!
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...
  Reply With Quote

Reply


Arduino based LDR volume and source selection controllerHide 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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passive Preamp: Arduino based, remote control, Relay R2R, input selection maxw Analog Line Level 102 17th October 2017 08:05 AM
Another Modified PGA2311 kit with Arduino for volume control and input selection cjkpkg Analog Line Level 28 15th December 2015 09:21 AM
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 05:21 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki