Adding offset to analog voltage out.

Hi there. I have a project where I require a variable 2-7V output from an Arduino to interface with a motor controller. I think I'm comfortable with the idea of creating a low-pass smoothing filter or using a DAC to get an analog voltage out of the PWM outputs. What I need to do is level shift the 0-5V to 2-7V.
Doing a little bit of research, I'm thinking I need to bias a voltage follower. Any ideas on how to do this, while maintaining the Ground levels of both the arduino and motor controller?

Many Thanks

Biffa.

For example you need a noninverting summer with an opamp, first input to 2V, the second to the filtered pwm (0-5V).
Google “op-amp noninverting summer”.
The 2V: you may use a resistive divider from the stable 5V.

That's great, thanks. I'll try it out.

Just thinking aloud, would another way to achieve this be by referencing Arduino GND to 2V (with a 2V Vref IC), making the PWM 0-5V Output 2-7V, and also run the filter /DAC of the same rails? Or will this likely destroy the Arduino?!

Thanks

Biffa

would another way to achieve this be by referencing Arduino GND to 2V (with a 2V Vref IC)

Yea, that may work, but definitely not the best engineering practice.

Biffa:
Just thinking aloud, would another way to achieve this be by referencing Arduino GND to 2V (with a 2V Vref IC), making the PWM 0-5V Output 2-7V, and also run the filter /DAC of the same rails? Or will this likely destroy the Arduino?!

As pito says, not good engineering practice. Additionally, you’d need a Vref IC that sinks current, and it would need to be able to sink the entire circuit current.

So much easier to use an Op Amp summing circuit.

If you use a resistive divider to generate 2V for that circuit, it should replace R5 with a divider which has a Thevenin equivalent resistance of 10k. If you simply connect a 3k and 2k in series to 5V and pick off 2V across the 2k to connect to R5, the circuit will not work correctly.

This gives you 2V offset (actually 2.04V). You may trim with R7=16k resistor if 2.000V is required…

pito, I think you are missing a graphic?

I would drive the PWM into a transistor whose collector is connected via a resistor to 7V. Then I would filter that to give you a 0 to 7V signal.

I like that Grumpy_Mike’s approach requires less hardware. It will require a well-regulated 7V line, though.

In pito’s circuit, you are relying on the already existing 5V line to be well-regulated to generate the 2V offset. The 9V Op Amp supply is not critical at all, could be 9-15V, whatever the Op Amp will take.