I don't get these LDRs - I played a bit with them, driving them directly with analogWrite on pwm ports and RC network. They are usable up to 2K, as depicted in datasheet. After that, they are going totally crazy - change of 20mV at Vf=455mV results in 6K and more resistance jumps. How is lightspeed and this here attenuator working emulating pots larger than 10K? Or are they not?
The currents are indeed progressively much smaller above 2k. It does function and track very very well though.
See Theo's results here :
http://www.diyaudio.com/forums/anal...urce-selection-controller-19.html#post4628038
My system has similar performance.
See Theo's results here :
http://www.diyaudio.com/forums/anal...urce-selection-controller-19.html#post4628038
My system has similar performance.
we are told to use a 50k or 100k dual track vol pot to control the current sent to the two pairs of LED/LDR.
It is CURRENT that sets the LED light level and that in turn sets teh audio resistances.
It is CURRENT that sets the LED light level and that in turn sets teh audio resistances.
It seems that there is a way to increase PWM resolution on analogWrite capable pins to 10bits:
Increase PWM output resolution?
potentially, this would allow simplification of the LDR drive circuit?
Increase PWM output resolution?
potentially, this would allow simplification of the LDR drive circuit?
I cannot find any mapping between resistor values and markings for controller pcb. Am I missing something somewhere?
With the consent of Vincent I am posting my modified source. Tested with genuine Apple silver remote and encoder PEC11R-4220F-S0024 using ide 1.6.5 (may also work with our builds).
Wineds, is this still working with latest IDE, 1.6.8?
Not sure. I haven't tried it. But I tried to make it ide version independent. You should be able to download earlier ide versions from the ardiunio site if need be.
Probably not:
Arduino: 1.6.8 (Windows 8.1), Board: "Arduino Nano, ATmega328"
VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char* inputName[INPUTCOUNT] = { "DAC IN", "CD IN", "AUX IN" }; //** each name maximum 9 characters. There must be exactly INPUTCOUNT names in the list.
^
VxD_optical_volume\VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
VxD_optical_volume\VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
VxD_optical_volume\VxD_optical_volume.ino: In function 'byte doCalibration()':
VxD_optical_volume:399: error: 'setLCDMaxLight' was not declared in this scope
setLCDMaxLight();
^
VxD_optical_volume:420: error: 'printTick' was not declared in this scope
printTick();
^
VxD_optical_volume:634: error: 'printBar' was not declared in this scope
printBar(percent);
^
VxD_optical_volume:883: error: 'printBar' was not declared in this scope
printBar(percent);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setMute(byte)':
VxD_optical_volume:1087: error: 'printTwoNumber' was not declared in this scope
printTwoNumber(VOLCOL, volume);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setInput()':
VxD_optical_volume:1097: error: 'lcd_print' was not declared in this scope
lcd_print(inputName[chan_in], 9);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setVolume(byte)':
VxD_optical_volume:1702: error: 'printTwoNumber' was not declared in this scope
printTwoNumber(VOLCOL, vol);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setup()':
VxD_optical_volume:1753: error: 'sinMap' was not declared in this scope
analogWrite(PIN_LCDBRI, sinMap(i, 0, LCDBRI_MAX, 0));
^
VxD_optical_volume:1759: error: 'defineCustomChar' was not declared in this scope
defineCustomChar();
^
VxD_optical_volume:1761: error: 'setLCDMaxLight' was not declared in this scope
setLCDMaxLight();
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void loop()':
VxD_optical_volume:1851: error: 'startLCDFadeIn' was not declared in this scope
startLCDFadeIn();
^
VxD_optical_volume:1907: error: 'startLCDFadeIn' was not declared in this scope
startLCDFadeIn();
^
VxD_optical_volume.ino:1945:22: warning: division by zero [-Wdiv-by-zero]
chan_out %= OUTPUTCOUNT;
^
VxD_optical_volume:1977: error: 'startLCDFadeIn' was not declared in this scope
startLCDFadeIn();
^
VxD_optical_volume:2069: error: 'sinMap' was not declared in this scope
LCDcurrentPW = sinMap(mil_delta, 0, TIME_LCDFADEIN * 1000, LCDinitialPW);
^
VxD_optical_volume:2073: error: 'setLCDMaxLight' was not declared in this scope
setLCDMaxLight();
^
VxD_optical_volume:2081: error: 'sinMap' was not declared in this scope
LCDcurrentPW = sinMap(mil_delta, TIME_LCDFADEOUT * 1000, 0, LCDBRI_MIN);
^
VxD_optical_volume:2085: error: 'setLCDMinLight' was not declared in this scope
setLCDMinLight();
^
VxD_optical_volume:2091: error: 'startLCDFadeOut' was not declared in this scope
startLCDFadeOut();
^
exit status 1
'setLCDMaxLight' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Arduino: 1.6.8 (Windows 8.1), Board: "Arduino Nano, ATmega328"
VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char* inputName[INPUTCOUNT] = { "DAC IN", "CD IN", "AUX IN" }; //** each name maximum 9 characters. There must be exactly INPUTCOUNT names in the list.
^
VxD_optical_volume\VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
VxD_optical_volume\VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
VxD_optical_volume\VxD_optical_volume.ino: In function 'byte doCalibration()':
VxD_optical_volume:399: error: 'setLCDMaxLight' was not declared in this scope
setLCDMaxLight();
^
VxD_optical_volume:420: error: 'printTick' was not declared in this scope
printTick();
^
VxD_optical_volume:634: error: 'printBar' was not declared in this scope
printBar(percent);
^
VxD_optical_volume:883: error: 'printBar' was not declared in this scope
printBar(percent);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setMute(byte)':
VxD_optical_volume:1087: error: 'printTwoNumber' was not declared in this scope
printTwoNumber(VOLCOL, volume);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setInput()':
VxD_optical_volume:1097: error: 'lcd_print' was not declared in this scope
lcd_print(inputName[chan_in], 9);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setVolume(byte)':
VxD_optical_volume:1702: error: 'printTwoNumber' was not declared in this scope
printTwoNumber(VOLCOL, vol);
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void setup()':
VxD_optical_volume:1753: error: 'sinMap' was not declared in this scope
analogWrite(PIN_LCDBRI, sinMap(i, 0, LCDBRI_MAX, 0));
^
VxD_optical_volume:1759: error: 'defineCustomChar' was not declared in this scope
defineCustomChar();
^
VxD_optical_volume:1761: error: 'setLCDMaxLight' was not declared in this scope
setLCDMaxLight();
^
VxD_optical_volume\VxD_optical_volume.ino: In function 'void loop()':
VxD_optical_volume:1851: error: 'startLCDFadeIn' was not declared in this scope
startLCDFadeIn();
^
VxD_optical_volume:1907: error: 'startLCDFadeIn' was not declared in this scope
startLCDFadeIn();
^
VxD_optical_volume.ino:1945:22: warning: division by zero [-Wdiv-by-zero]
chan_out %= OUTPUTCOUNT;
^
VxD_optical_volume:1977: error: 'startLCDFadeIn' was not declared in this scope
startLCDFadeIn();
^
VxD_optical_volume:2069: error: 'sinMap' was not declared in this scope
LCDcurrentPW = sinMap(mil_delta, 0, TIME_LCDFADEIN * 1000, LCDinitialPW);
^
VxD_optical_volume:2073: error: 'setLCDMaxLight' was not declared in this scope
setLCDMaxLight();
^
VxD_optical_volume:2081: error: 'sinMap' was not declared in this scope
LCDcurrentPW = sinMap(mil_delta, TIME_LCDFADEOUT * 1000, 0, LCDBRI_MIN);
^
VxD_optical_volume:2085: error: 'setLCDMinLight' was not declared in this scope
setLCDMinLight();
^
VxD_optical_volume:2091: error: 'startLCDFadeOut' was not declared in this scope
startLCDFadeOut();
^
exit status 1
'setLCDMaxLight' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Or maybe something else missing. I don't see a declaration for printTick() anywhere, for example.
Now I am down to bunch of these:
..\VxD_optical_volume\screen.ino:177:144: warning: narrowing conversion of '255' from 'int' to 'char' inside { } [-Wnarrowing]
char bn4[] = { 4, 3, 3, 7, 3, 3, B, 3, B, 3, 3, 3, 4, 3, 3, 7, A, A, A, B, 4, 3, 3, 7, 4, 3, 3, 7, A, A, B, A, 4, 3, 3, 7, 4, 3, 3, 7 };
^
..\Arduino\VxD_optical_volume\screen.ino:177:144: warning: narrowing conversion of '255' from 'int' to 'char' inside { } [-Wnarrowing]
..\VxD_optical_volume\screen.ino:177:144: warning: narrowing conversion of '255' from 'int' to 'char' inside { } [-Wnarrowing]
char bn4[] = { 4, 3, 3, 7, 3, 3, B, 3, B, 3, 3, 3, 4, 3, 3, 7, A, A, A, B, 4, 3, 3, 7, 4, 3, 3, 7, A, A, B, A, 4, 3, 3, 7, 4, 3, 3, 7 };
^
..\Arduino\VxD_optical_volume\screen.ino:177:144: warning: narrowing conversion of '255' from 'int' to 'char' inside { } [-Wnarrowing]
Also, default IDE installation does not have Wire.h library and I don't see it mentioned here nor contained in Vincent's library pack. I found some version on the net, but I don't know if it's the right one.
I guess the price of the whole project can be further cut down a lot by omitting half of the relays on IO board that are switching negative signal, if single-ended inputs/outputs are used. There are also quite cheap relays without fancy contacts on ebay, like 3.5 eur for 10pcs, that could be easily implemented instead of panasonics.
Very minor bug - when the volume is set to 00 (but not in mute mode) and the 'MENU' button is pressed on the remote then the volume digits disappear. They return when the volume is incremented.
This can be fixed by modifying: void setVolume
...by moving the printTwoNumber(VOLCOL, vol); statement to outside of the second 'if' block to force a refresh regardless of the value of the vol variable.
Chris
This can be fixed by modifying: void setVolume
...by moving the printTwoNumber(VOLCOL, vol); statement to outside of the second 'if' block to force a refresh regardless of the value of the vol variable.
Chris
Have been working on tidying the display while waiting for parts to arrive. These are custom fonts.
Sent from my Nexus 6 using Tapatalk

Sent from my Nexus 6 using Tapatalk
- Home
- Source & Line
- Analog Line Level
- Arduino based LDR volume and source selection controller