How to get 0-5V out of Uno3?

After researching the DUE and discovered the two DACs only support 0.55v to 2.75v, I decided to stick with my UNO R3 and use PWM output to try to manage 0-5V.

I'm a little unclear on what I need to make this happen, read several options but they seem overly complex ... is there a simple solution?

Cheers, Rob.

It depends on what you are driving. A simple solution is to add a series R and shunt C at the output of the PWM.

Too big an R &/or C will result in less ripple on the analog signal but slower response

To little an R &/or C will result in more ripple on the analog signal and faster response

Any hints on where to start on the R and C front?

Cheers, Rob

EDIT: driving Koolance VLX-450 0-5 "speed in" https://koolance.com/450W-chiller-subassembly-vlx-450

"A toggle switch selects between two methods of chiller control: 0-5V input signal or manual speed knob. Wire terminals are readily accessed if an alternative control scheme is desired."

A low-pass filter can convert the PWM to variable DC. The default PWM frequency is around 500Hz so you'll need to filter that out and/or you can increase the PWM frequency. It's kind of a crude solution but if it works for you it's easy.

You do need a "light load" (high resistance, low current) because the filter resistor makes a voltage divider with the load. Or you could add a buffer amplifier, but if you're going to do that you're better-off going-back to the Due and using an amplifying amplifier!

I read the default output frequency is 490 (as DVDdoug mentioned).
However I believe it can be upped to 1000 Hz.

If you use 50k and 1µf your ripple will be pretty low. This assumes the 0 - 5 input on your cooler has a high input impedance.

For this same level of filtering you can change the R and C if you keep R * C = constant
So you could use 10k and 5µF. The values are not so critical , a 4.7µF would probably indistinguishable.

look at this on line calculator.

Other options are:

  1. and opamp on the DAC output.

  2. Several resistors forming a voltage divider resulting in maybe 5 or 6 "steps" instead of a continuous control (actually the PWM out is 255 steps).

An UNO has 2 PWM pins running at 960 Hz. 9 and 10 but check up which pins.

I used a 330 R and 1uF C ... I'm using pin 6 PWM.

The results are too coarse ...analogWrite 226 = 2.39V ... 227 = 4.43V.

I'll bump up R and retest ... assumed 490Hz

Can you look at the output with a scope?
I suspect the waveform change is linear, but your meter is measuring peak-to-peak voltage.

You need a better filter,or a buffer amplifier to feed the load.

I swapped out 330 for 56K R and no difference from DMM. I'll hook up my scope and check ...

EDIT: I'm using pinMode as OUTPUT ... assume thats correct?

Scope shows about the same with frequency confirmed at 978Hz

Yes.

Is the voltage stable on the scope, or bumping around on the +V peaks ?

I don't think using the UNO PWM is going to work ... the Koolance 0-5V seems to want analog ... even when using 255 I can hear the Koolance oscillating ... it's going to need analog power.

I put a DC to DC converter (no arduino) to the chiller and varied it's output from 0-5V and it worked perfectly.

Any DC to DC converts that support control via standard PWM?

Voltage was stable.

I think I found what I need:

If you're using analogWrite(), that's not a PWM problem, because the function turns PWM off and applies a solid HIGH in the special case of 255.

It suggests to me, the problem is a lack of buffering.

Here is the documentation:

490 Hz (pins 5 and 6: 980 Hz)

Pin 5 and 6 have a default PWM frequency of (almost) 1000Hz.
Google "Arduino PWM frequency".
Using one of these two pins is preferred.

I would use 1k (and 100uF) if you don't know the impedance of the destination.
Leo..

"Voltage was stable".... the fact the Koolance was whistling - suggests the voltage wasn't... it was still ticking hi then lo - in time with the PWM output. Buffering needed.

Analog means a scalar voltage maintained somewhere between 0 and 5V as needed, not wobbling around for any reason.
Digital means a binary state either 0V or +Vcc - possibly alternating (PWM or a tone)

Yes, or there was parasitical feedback from the device into the relatively high DC impedance in the low pass filter circuit. Sometimes known as, "motorboating". Same conclusion - buffering needed.