I am planning to convert my old potentiometer based work-bench power supply into a digital Multiple Voltage Power Supply.
It has LM 317T adjustable positive voltage regulator. By changing the resistance of the Adj. the outputted voltage will change.
Changing the resistance will be controlled by Arduino. Arduino will have 2 main functions collecting user input and changing the output. Collecting user input will be through two buttons (S1-S2), to go to the next voltage and the other to go to the previous voltage. The buttons are connected to the microcontroller pins 2 and 3. When a button will be pressed the microcontroller sees a high signal (+5 volts) on the corresponding pin. The rest of the time, when a button is not pressed the microcontroller sees a low signal (0 volts) on the corresponding pin because the pin in connected to ground through a resistor (R2-R3), called a pull down resistor. When the microcontroller sees an input pin change from low to high, it sends a high signal (+5 volts) to an output pin. five output are connected to pins 9,10,11,12,and 13, each going through a small current limiting resistor to a LED , which shows the selected voltage, then to the base pin of a small 2n2222 transistor. Each transistor is connected through a resistor to its collector pin and its emitter pin connected to ground. When the transistor receives voltage on its base pin, power will flow from the collector to the emitter. This basically turns a resistor on or off which changes the current on the ADJ pin of the LM317T. LEDs will display the selected voltage i.e.3.3V,5V,7V,9V and 12V Changing the value of R9-R15 will change the preset voltages. I do not understand how to start the programming.
Int Sw1 =2;
Int Sw2 =3;
int LED1= 9;
int LED1= 10;
int LED1= 11;
int LED1= 12;
int LED1= 13;
Void setup () {
PinMode(Sw1,INPUT);
PinMde(Sw2,INPUT);
PinMode(LED1,OUTOUT);
PinMode(LED2,OUTOUT);
PinMode(LED3,OUTOUT);
PinMode(LED4,OUTOUT);
PinMode(LED5,OUTOUT);
I don't understand how to proceed further. Please help ! :~
