Hey there,
I'm trying to build an adjustable power supply, which works between 0.8 and 5V, to drive some loads up to 100 mA. The catch here is that I want precision steps, which means that I need to jump from 0.8V to 0.9V, etc. The control of the output voltage is done with a microcontroller, for now an Arduino Uno, using an encoder. This is proving to be a not so great idea for several reasons.
To achieve the adjustable voltage output, I'm using an MCP1825 voltage regulator, the Arduino Uno with it's ADC, a rotary encoder, a MCP4922 12-bit DAC and a couple of resistors. The idea is to have the two resistors of the voltage divider of the adjustable pin of the voltage regulator, R1=10k Ohm and R2 = 1k Ohm and then have a third resistor connected to the adjustable pin and the output of the DAC, R3 = 1k Ohm. This setup leads to the following:
Vout = Vadj * (1 + R1/R2) + (Vadj - Vdac) * (R1/R3)
The expression allows me to determine the output values of the DAC to use.
There are many problems with this setup:
1) The circuit is implemented in a breadboard with jumper wires, adding a lot of noise. The output of the DAC is noisy, making the output of the voltage regulator noisy as well. I've tried adding 10uF electrolytic capacitors to the input and output of the voltage regulator, to the voltage input of the DAC but nothing worked. I'm using the 5V pin of the Arduino as the voltage reference for the DAC, but maybe that's not the best idea either. I've ordered a voltage reference IC to have a more stable reference, but don't know if it's going to be enough.
2) The output of the voltage regulator is not precise enough, mainly due to the Arduino ADC. For lower voltage values, the Arduino can detect that the output is not what it should be and adjusts the DAC accordingly. But with an increase in the output voltage, the reading error gets bigger and bigger, leading to output voltage errors of up to 80mV. Since the objective is to have 100mV steps, having 4.36 V going to 4.48V is not acceptable, even those values aren't acceptable. I've ordered a 14-bit ADC, the MAX1416, but I'm afraid to be missing something that would lead to these errors and that even with a better ADC they wouldn't be solved.
3) The voltage divider used means that the DAC voltage output values are (roughly) between 0.3V and 0.7V. Even if it's a 12-bit DAC, it doesn't have enough resolution to work properly with a such small range. I'll be changing the value of the R3 resistor to 10k Ohm, which will improve drastically the "useful" range of voltage outputs of the DAC. Is it necessary to order a DAC with more resolution or just increasing this "useful range" is enough?
I appreciate any feedback on this circuit and how to make it work correctly with the precision output.
Thanks,
Luís
I'm trying to build an adjustable power supply, which works between 0.8 and 5V, to drive some loads up to 100 mA. The catch here is that I want precision steps, which means that I need to jump from 0.8V to 0.9V, etc. The control of the output voltage is done with a microcontroller, for now an Arduino Uno, using an encoder. This is proving to be a not so great idea for several reasons.
To achieve the adjustable voltage output, I'm using an MCP1825 voltage regulator, the Arduino Uno with it's ADC, a rotary encoder, a MCP4922 12-bit DAC and a couple of resistors. The idea is to have the two resistors of the voltage divider of the adjustable pin of the voltage regulator, R1=10k Ohm and R2 = 1k Ohm and then have a third resistor connected to the adjustable pin and the output of the DAC, R3 = 1k Ohm. This setup leads to the following:
Vout = Vadj * (1 + R1/R2) + (Vadj - Vdac) * (R1/R3)
The expression allows me to determine the output values of the DAC to use.
There are many problems with this setup:
1) The circuit is implemented in a breadboard with jumper wires, adding a lot of noise. The output of the DAC is noisy, making the output of the voltage regulator noisy as well. I've tried adding 10uF electrolytic capacitors to the input and output of the voltage regulator, to the voltage input of the DAC but nothing worked. I'm using the 5V pin of the Arduino as the voltage reference for the DAC, but maybe that's not the best idea either. I've ordered a voltage reference IC to have a more stable reference, but don't know if it's going to be enough.
2) The output of the voltage regulator is not precise enough, mainly due to the Arduino ADC. For lower voltage values, the Arduino can detect that the output is not what it should be and adjusts the DAC accordingly. But with an increase in the output voltage, the reading error gets bigger and bigger, leading to output voltage errors of up to 80mV. Since the objective is to have 100mV steps, having 4.36 V going to 4.48V is not acceptable, even those values aren't acceptable. I've ordered a 14-bit ADC, the MAX1416, but I'm afraid to be missing something that would lead to these errors and that even with a better ADC they wouldn't be solved.
3) The voltage divider used means that the DAC voltage output values are (roughly) between 0.3V and 0.7V. Even if it's a 12-bit DAC, it doesn't have enough resolution to work properly with a such small range. I'll be changing the value of the R3 resistor to 10k Ohm, which will improve drastically the "useful" range of voltage outputs of the DAC. Is it necessary to order a DAC with more resolution or just increasing this "useful range" is enough?
I appreciate any feedback on this circuit and how to make it work correctly with the precision output.
Thanks,
Luís