I am using Arduino Due's DAC0 to create a variable intensity LED driver.
The post "Rapid Prototyping Analog circuitry without a multimeter or an Oscilloscope" shows how I quickly prototyped, tested and ploted waveforms from a variety of test points without using an oscilloscope or multimeter.
The 4 pictures below are an output from my setup. The top left picture is for the circuit below.
Configuration "A"
3.3V - 20 Ohms - RedLED - (C)2N2222A(E) - Gnd
|(B)
10K
|
DAC0
Blue is the DAC0 input counter value
Green is the DAC0 pin as measured by A9
Red is the 2n2222 collector voltage as measured by A7
Yellow is the 2n2222 base voltage as measured by A8
I extended this analog amplifier to control multiple LEDs as shown below.
The PWM inputs are switched "Low" one at a time (They are "active low").
The plots for Red Grn and Blue are the pictures at the top right, bottom left and bottom right respectively.
Configuration "B"
PWM3
|
1K
|(B)
3.3V - (E)2N2907(C) - 20 Ohms - GrnLED +
….. +
3.3V - (E)2N2907(C) - 20 Ohms - RedLED + (C)2N2222A(E) - Gnd
|(B) |(B)
1K 10K
| |
PWM2 DAC0
Notes:
- 4096 is effectively 3.3 V; 0 is effectively 0 V
- Green tracks but does not equal Blue because page 1059 of SAM3S datasheet lists the voltage range of the DAC is from (1/6) x VADVREF to (5/6) x VADVREF.
- As seen by the collector voltage, Red has a large linear control range; green less and Blue not much at all.
- If I use the Blue LED in Configuration "A", its plot is essentially the same as Configuration "B".
Questions:
- How can I improve Green and Blue's control range?
- The second picture shows the RED LED's collector voltage. It is visibly "ragged" and you can see the intensity "jump" as I increment Dac0. How can I smooth out the response so that it is more linear?
Thanks