Download Electronic Component Ordering R32C Web Server
Transcript
AVR, dB and LDR collide at D/A Junction By Daniel Rodrigues (Elektor Labs) Nothing exceptional about it, I thought, and in line with most of the article proposals we have the pleasure of seeing in the earliest stages of publication. The circuit and the idea behind an ‘Innovative Digital Volume Control’ proposed by one of our very remote freelance authors was duly taken through our evaluation system and considered a fine candidate for the Summer Circuits edition by the joint editorial team. So we pressed ahead and the paperwork was landed on my desk. In the original circuit, the key component was an LDR (light dependent resistor) in series with the loudspeaker connection. The LDR is illuminated by a white LED whose brightness is controlled by a PWM In plain English, the power variation using that finest of LDRs is, oh dear, 16 dB, which is disappointingly low. As a practical example, 16 dB equals the variation of raising speech from a soft whisper to whispering, well, a little louder. The idea proposed by our valiant author is still nice, but sadly not for an audio volume control as he had hoped. After all, what we have here is a nice and inexpensive gadget which can be safely called a digital potentiometer, or ‘Digipot’ in electronics journalese. Corny +5V LCD 2*16 23 J1 10K 10K 10K PC1 PC0 3 5 21 PD0 PD1 PD2 PD4 PD5 PD6 PD7 30 31 32 2 9 10 11 +5V R1 10K IC1 +5V AVR - ISP 7805 7805 C1 1000µF 16V R3 .. R6 +5V IC2 9-12VDC +5V R2 10Ω 10K PB2 P2 Down 24 VCC VCC PB1 ATMega8-SMD 14 GND P1 Up R8 220Ω +5V 6 18 GND S2 13 GND L R R7 220Ω AVCC 4 Out VSS VDD VO RS R/W E D0 D1 D2 D3 D4 D5 D6 D7 A K C4 100nF S1 C2 100µF 16V C3 100nF (PB3,15) (PC6,29) (PB5,17) (PB4,16) MOSI NC RESET SCK MISO +5V GND GND GND GND 080654 - 11 Lw = 10log(Pmax /Pmin) = 10log[(U2/Rmin) / (U2/Rmax)] = 10log[(U2/50) / (U2/2000)] = 10log(40) = 16 dB elektor - 11/2007 as it may sound, the use of the LDR based DigiPot is only limited by your imagination: control of currents, voltages, brightness, gain, you name it. All optically — sort of — but with better resolution, stability and dynamic control than some more traditional approaches. Fine AVR programming, no doubt, but with insufficient attention paid to the real world of human hearing and some basic physics, specifically where the dB comes in. (080654-I) Daniel Rodrigues (1983) has a B.Eng. degree in Electronics and Telecommunications Systems from ISEL Higher Polytechnic Institute in Lisbon, Portugal. Daniel’s fortes and hobbyhorses include radio, digital communications and microcontroller systems. Daniel started working in the Elektor Labs in June 2008. When not pondering over electronics on his desk or computer screen, he enjoys hiking and cycling. 43 E-LABS INSIDE signal produced by a microcontroller — there you have it: state of the art contactless audio volume control! However, when I started testing the device I realised the span of the volume control wasn’t too impressive, to put it mildly. In an attempt to overcome the problem I looked for an LDR with a larger resistance variation and the best I was able to locate at the time was rated 50 to 2,000 ohms. Now let there be Science instead of AVR programming. If we take into account that the human ear is able to comfortably handle sound levels within a range of 30–90 dB we should expect something like 60 dB of span to be afforded with ease by our volume control. Let’s not forget that power is inversely related to resistance, meaning the lower the resistance, the higher the power. So, the sound power level ratio can be expressed as