Arduino helped me to get back in touch with electronics as a hobby. I have completed some projects, and now I'm back to the beginnings I want to build a variable power supply.
I've found this examples that use an ATMEGA8, so I figured out that it can be done using Arduino (and this will also allow to develop further upgrades).
Since my knowledge of electronics is limited, I can't evaluate the pro's and con's of this design, and wether it wil be usefull as a part of a hobby laboratory.
Since my knowledge of electronics is limited, I can't evaluate the pro's and con's of this design, and wether it wil be usefull as a part of a hobby laboratory.
There is no question that a programmable DC bench power supply can be a very useful thing to have around. I found a used industrial model on E-bay several years ago, 0-60 vdc, 0-6 amps, cost a couple of thousand new, but I think I paid like $25 + shipping for it, about the size of a large shoe box.
However that appears to me to be a pretty complex project to take on. Lots and lots of components, and of course you will have to 'port' the code over to arduino. Good luck if you do take it on. You might want to continue searching for a possible more modern design that uses IC regulator chip(s) to see if you can cut down on the component count and costs.
Keep in mind that the most difficult part of such a project will be in the troubleshooting as such things never work 100% at first. You will need a variable 'dummy load' so you can test at max to min voltage and current levels while you test out all the controls.
Surely using a modern variable regulator and a DAC or digital pot would be easier, that's a heck of a complex circuit for what is essentially a simple problem.
That sound to me a very interesting project. I may be interested to make one myself. Complex ? Well no if you brake-it down into block diagrams. To program the chip, put the chip on a board, remove the program chip, install into your project. Here a link about programing ATmega on a breadboard using Arduino IDE. I bough this system. http://www.dalewheat.com/
I see in the schematic it has a LCD display. That will be usefull to display info like : Voltage, current. The design need a better 5 volt section ( more current using a bypass transistor ).
I made myself a 5 volt using bypass transistor for my XM Radio for my car. ( 12 V in - 5 V out @ 1 A ) The only problem : Transistor get very warm. I heatsink it...do you worrie. Heh , it work very well.
Here an another link to help in electronics. It a free simulator using JAVA. The con side is cant not save or print the circuit. Circuit Simulator Applet
Besides the fun of building such a project, I live in Argentina and things like a bench supply are too expensive (about 200 dollars for a cheap one).
The thing of using an Arduino is having the possibility of including a Volt and Amp meter, plus having a short circuit protection, besides having a digital control.
Building the circuit or even making a PCB looks doable. I've been through other projects with a simmilar amount of components and even burned the code into an Atmega.
If I break the design into blocks things get easier. You have a 5V supply for the processor part, that might prduce up to 1A, so enough for every toy you connect as user interface (LCD, buzzers, etc).
The real thing is: is the electronic design a good solution, using an amplifier and a darlington array?
Surely using a modern variable regulator and a DAC or digital pot would be easier,
Can you handle an example of such a solution?
Regards
I didn't know that there were things like this digital potentiometers. I have to investigate if I can get some of these arround here.
The LM317 solution migtht hve a current limitation, but this can be improvedby using a power transistor, like the 2n3055 right? (I hapen to have one in stock!)
This part will limit the voltag, how do you achieve a limited constant current?
By feedback control. Your processor will know what the current is at any given time by the current feedback measurement it reads. If the current raises above the set value then it reduces the voltage output of the regulator to keep the current at the set value.
Keep in mind that there can be up to three different possible control modes your power supply can be operated in if that is your desire, Constant current, current limited, and constant voltage.
In constant current mode, your program will either raise or lower the regulators output voltage to keep the current exactly at the desired current value. It can maintain a constant current only up to the maximum output voltage capacity of the voltage source. However it can maintain a constant current value into a direct short to ground by lowering the output voltage to just above 0vdc depending on the actual resistance of the 'short circuit'.
In current limit mode, your program will keep the regulators output voltage at the desired constant voltage unless the programmed current limit is reached, where it will only then reduce the output voltage by the amount needed to keep the current at the programmed limit.
In constant voltage mode your program will just keep the regulator's output voltage at the desired amount. Only if the current draw exceeds the maximum rating of the regulator where it should either shutoff or enter a current limit control mode where it reduces the output voltage as needed to keep the current at less then the supplies maximum limit.
Some bench supplies don't include the constant current mode, just the constant voltage or constant voltage with current limit mode. However working with high power LED circuits the constant current mode is a nice feature.
You will have to study the software program you are planning to port over to see which modes it supports and either add or take out any mode you don't wish to implement.
Now I have a variety of configurations I can use. It's a matter of seeing what kind of components can I get here. The only easy part of te original design i that the components are cheap and easyto get. But I think that the R2R ladder is not only boring to build,but itca also be quite inacurate.
Any recomendations on a good DAC for this purpose? Or can I use a pwm port for this purpose?
By feedback control. Your processor will know what the current is at any given time by the current feedback measurement it reads
The example of the link is using timer interrupts to measure at a given frequency. How should I calculate the minimal frequency to have good results?
That's a really hard question to answer. The electronic loads you are trying to power and protect need as fast a response as possible while still maintaining accurate control. This is more important for the constant current and current limit modes of operation, constant voltage mode is not as time critical I would think.
One problem is that most A/D conversions on arduino takes some time and often averaging of multiple readings are need to get 'clean' measurements, and all that will tend to slow the control response for your power supply. Again this is not a trivial project.
So I'm not able to get the digipots arround here. The ones available are pretty expensive and have small resolution, plus they have a limited lifetime of 50K writes into their memory.
I've found some 12-bit DACs. I guess they can be used as an input for the LM317 (ADJ), since it's just a voltage divider, right? Or first I can try using PWM as an input for the voltage regulator.
I've found some 12-bit DACs. I guess they can be used as an input for the LM317 (ADJ), since it's just a voltage divider, right? Or first I can try using PWM as an input for the voltage regulator.
Yes, but... 1st. Expiriment with the LM317 as stand-alone <--- Test it out without the DAC and Ardiuno. Just check if it work first. ( check datasheet of LM317 )
2nd. PWM ? no. a LM317 work in linear PSU circuit. A PWM work with a switching PSU.
Question ? Do you have a big transformer to generated 30 V ac @ 2 A ? What type of transformer & Volt @ current you have ?
If you run the PWM through a low pass filter it will produce a stable(ish) DC voltage. The RC time constant may have to be pretty large to smooth the PWM out and this will impact the response feedback time and therefore it will be slightly harder to handle in the software. Also there may be impedance issues so you may have to buffer with an opamp.
Personally I would go for the DAC.
As to wether either will work on the 317, I don't think so but this is getting a little analogue for me. The 317 tries to maintain a small voltage on the middle pin I think, and it does that by adjusting the output voltage. Maybe you could simulate that small voltage with a DAC, i don't know but even if it works I think you would have to scale the DAC output down (or use a small reference voltage if they have one) to get the full resolution.
Certainly either technique should work if you keep the existing transistor circuit as that's all the R2R network does anyway.
I'll go with a DAC (your argument was very clear Graynomad, thanks). Found some cheap TDA1543 (16-bit), that if I get them to work using i2S I will achieve a very good resolution. I have enough time to do research until the DAC arrives.
This way I'll have a better resolution in the DAC as in the Arduino ADC, and can achieve a good feedback control.
I'm planning to use a 24V 5A transformer, a diode bridge (for 10A) and some big capacitors for smoothing (the traditional linear way).Whether I should go with the 317 or with the transistor amplifier of the first circuit I referred is something I have to do some research. Help with pros and cons of this solutions would be appreciated.