Maker Pro
Maker Pro

Voltage offset shifting

Hallo everyone,

I have question, for my project I need square wave oscillator (-2.5,2.5V), I generated pwm signal (0.5V) from Arduino Uno, but I can't shift it. I tried to make sumator with PWM signal and -2.5V, but it didn't worked out. Can somebody help. :)

Thank you
 
Hallo everyone,

I have question, for my project I need square wave oscillator (-2.5,2.5V), I generated pwm signal (0.5V) from Arduino Uno, but I can't shift it. I tried to make sumator with PWM signal and -2.5V, but it didn't worked out. Can somebody help. :)

Thank you
Only thing I can think of is using a capacitor to decouple a 5V pwm signal from the Arduino... The problem here is that if the PWM value is anything other than 50% the center point of the PWM signal will drift, in theory you could end up with a -1v to 4v PWM signal.
What are you trying to do? Can you provide example code or schematics for what you tried? You may need additional circuitry to push-pull the values.
 

Harald Kapp

Moderator
Moderator
Show us your summing circuit. And tell us what exactly didn't work. Which signal did you expect, which signal did you see instead?


With some assumptions from my side:
A typical OpAmp based summer has a transfer function that creates:
Vout = -Rf/Rin*(Vin1+Vin2+...)​

Therefore with Vin2=-2.5V you will see Vout = -Rf/Rin*(Vin1-2.5V) Assuming for simplicity Rf=Rin this simplifies to Vout=-(Vin1+2.5V), therefore for
Vin1 = 0V -> Vout = -2.5V
Vin1 = 5V -> Vout = -7.5V

I think you expect
Vin1 = 0V -> Vout = -2.5V
Vin1 = 5V -> Vout = 2.5V
The respective transfer function is Vout= Vin1-2.5V.
You can create this function by inverting the output from the arduino:
Vin1 = -Varduino -> Vout = -(Vin+2.5V) = -(-Varduino+2.5V) = Varduino-2.5V

Regards,
Harald
 
Show us your circuit.

If all you wish to do is to make the waveform symmetrical about zero, then feed it through a capacitor with a high resistor to ground.
 
here is my circuit


I understand what i should do, but i can't find proper OP Amp.

yes, I want to make from 0 -> -2.5V and from 5V-2.5V
 

Attachments

  • Screenshot_1.png
    Screenshot_1.png
    22.7 KB · Views: 133

Harald Kapp

Moderator
Moderator
Bob, please compare the phase of the +-2.5V output with the 0...5V input. If I'm not mistaken, this circuit introduces 180° phase shift (inverts). If that is no issue for the OP, you're right.
 
Yes, it does shift the phase, but this circuit will do the same without shifting the phase. And I eliminated the extra supply by using a voltage divider to bias the + input. The same mod can be done to the previous circuit with the same value resistors.

Any linear transformation of one range of voltages to another can be done by a single op amp (as long as the input and output voltages are within its range.)

offsetnoninvert.JPG

Bob
 

Harald Kapp

Moderator
Moderator
O.K., the trick here is the resistive divider from V3 to -5V.
The OpAmp in this circuit works not as summer, but as buffer and amplifier *2.

Nice and simple!
 
Top