To obtain a 0 to 5V variable power supply from arduino i used a PWM pin from Arduino and a PWM RC Filter, then with a potentiometer input i was able to get a variation of 0V to 5V at any of the 6 PWM pins on the UNO.
Now the question is, Can i get -5V to +5V in the same way? Or is there any additional circuit required to do so? Ideas Welcomed.
You can't get a negative voltage from the Arduino but it should be possible to use the PWM output to control an external device that outputs -5V to +5V,
An H bridge, as used to control DC motors, can output both positive and negative voltages and can be controlled by a PWM signal but you will need an external power supply.
A voltage doubler circuit can provide a positive and a negative voltage at the same time. But the voltage can't be controlled by PWM, i.e. from a +5V rectangle you can only get a voltage of about -5V. This negative voltage may be sufficient to drive an op amp, which then can provide -5V to +5V under control of another PWM signal. In no case you'll get a power supply from such circuitry, the output current is limited to something lower than 1mA.
What load do you want to drive from your adjustable "power supply"?
This is my application:
There are 2 pots say Pot1 & Pot2. Now, i want to add both of these values and output the resultant.
Example 1: Pot1 = 2V & Pot2 = 3V so the output must be 5V
Example 2: Pot1 = 2V & Pot2 = -2V so the output must be 0V
Example 3: Pot1 = 1V & Pot2 = -3V so the output must be -2V
This gives rise to another question, can i read negative voltage in arduino?
No, applying a negative voltage to any of the Arduino pins would damage the chip, per datasheet.
The Arduino is not a dual supply chip, and there is no negative voltage anywhere on the Arduino board.
You would have to shift the negative voltage to within the range of 0~5v (or whatever voltage you're using).
Why do you need to involve negative voltages at all? What's the application? Usually, when working with modern electronics, people avoid negative voltages whenever possible.
Any reason that the pots are +5 to -5?
Can they be 0 to +10, or 0 to +5?
What are you measuring, what is the application?
VFD's are involved here. And these VFD's which i am using require their data input to be -5 to +5V and the same range of voltage they give at output.
Okay, can you post a link to spec/user manual?
Most are configurable, the common I/O is 0to20mA, 4to20mA or 0to10Vdc.