# Outputting various voltage levels on a pin

I'm newer to Arduino, but I'm looking for a way to output voltage on the arduino at varying levels of voltage from 1.0v to 9.0v or even step up and down from 3v, 5v and 9v.

Is this possible to do on the Uno with using its pins, I know it has 6 analog pins but is it for input only?

The UNO can do an analogWrite which is a 0 to 100% duty cycle waveform (this can be passed through a low pass filter to get an analog voltage then pass this through an opamp to achieve the voltage range you want).

Well basically, we're going to be using the Arduino as a testing application to see if another device can read in voltages

So, what I'm doing is creating a testing box with an arduino and user input saying: "Would you like to use voltages? (Y/N)"
user inputs: 'Y'

"What voltage would you like to specify? (1-9v)"
user inputs '3'

and then a pin would go high with that specified voltage. If it can only step up and down 3.3, 5 and 9, I would put that in the user input for 3 different choices.

I would go with an external 12 or 16 bit DAC powered from +/- 12V so you can control a wide, precise range of +/- output voltages that are not based on a filtered PWM signal.

Is there anything I can do internally with the arduino without the use of an external DAC? I'm trying to implement the use of the Arduino's hardware solo, maybe a few resistors and capacitors but that's about it. Even if the voltage ranges are just 1-3v

If the device that you are feeding the voltage to has a high enough input resistance, then the technique suggested by LarryD should suffice. Try connecting a 10K resistor to one of the PWM pins, and connect a 100uF capacitor from the other end of the resistor to ground. The junction of the resistor and capacitor becomes your voltage output. You can vary the output voltage from 0V to 5V (assuming a 5V Arduino) in steps of just under 20mV using the analogWrite command on that pin.