Arduino pulsing output

Thread Starter

Alasttt

Joined May 13, 2015
68
Hi all,

I want to get a square wave that goes between +2v and -2v. From the arduino outputing HIGH then LOW gives a square wave between 0v and 5v. Any ideas on how I could change the arduino configuration to output different voltages for high and low. or alternatively how to use electronics to convert the 0-5 into -2 to +2
 

Papabravo

Joined Feb 24, 2006
22,082
Sure -- run your [0-5V] signal into a summing amplifier with a constant input of -2.5 volts and a gain of 0.8
(0 - 2.5)*0.8 = -2.00
(5 - 2.5)*0.8 = +2.00
 

Thread Starter

Alasttt

Joined May 13, 2015
68
Sure -- run your [0-5V] signal into a summing amplifier with a constant input of -2.5 volts and a gain of 0.8
(0 - 2.5)*0.8 = -2.00
(5 - 2.5)*0.8 = +2.00
Hi thanks. I have also heard putting a capacitor after it will AC couple it and have the same affect to make it +2 to -2. Would you agree ?. Since this might be easier then a summing amp.
 

Papabravo

Joined Feb 24, 2006
22,082
No. A series, or DC blocking, capacitor will change the square wave into a series of sharp impulses with exponential decay. Not what you are looking for.
 

Thread Starter

Alasttt

Joined May 13, 2015
68
No. A series, or DC blocking, capacitor will change the square wave into a series of sharp impulses with exponential decay. Not what you are looking for.
Right ok thanks. Please could you tell me where could I get the constant input of 2.5v from ?.
 

Thread Starter

Alasttt

Joined May 13, 2015
68
A voltage divider.
Right thanks. Youve specified gain to be 0.8. Gain is Rf/Rin.

So for the op amp, I connect the - input to +2.5v. connect the + input to the 0-5v square wave via a 10 ohm resistor, and make Rf 8 ohms.
This gives 8/10 which is a gain of 0.8.

Correct?
 

MikeML

Joined Oct 2, 2009
5,444
The best you can do without an opamp. If you use an opamp, remember that you will need a negative power supply, like -5V211.gif
 

Potato Pudding

Joined Jun 11, 2010
688
Top