convert 0 to 5V square to square wave centered at 0V

Thread Starter

cktboy

Joined Apr 24, 2020
27
Hello,
I have 0V to 5V square wave output from 555 timer. How to convert it with center at 0V, that is from -2.5V to 2.5V. I tried capacitor but I am getting -5V to 0V.
 

Thread Starter

cktboy

Joined Apr 24, 2020
27
The frequency is 100khz and it is not driving into anything. I just wanted to learn how to level shift the output with center at 0V.
 

Papabravo

Joined Feb 24, 2006
18,793
This HPF has cutoff of 26.54 Hz.
how did you determine the value of C1 and R3? I guess C1 is a choose, then how to determine R3?
Time constant. Multiply the value of C1 and R3, the units of the product are seconds. You want it to be less than the period of the square wave. If you change the frequency, you may need to change the values.

EDIT: The above statement is wrong and resulted from a simple calculation error. The time constant is 6 milliseconds, not 6 microseconds, which caused me to jump to an incorrect conclusion. The time constant is important, but not for the reason that I stated.
 
Last edited:

Thread Starter

cktboy

Joined Apr 24, 2020
27
Time constant. Multiply the value of C1 and R3, the units of the product are seconds. You want it to be less than the period of the square wave. If you change the frequency, you may need to change the values.
From the suggested R3 and C1 value which gave expected level shifting, we have the time constant as C1*R3=6kohm*1uF=6ms and the period as, T=1/f=1/100KHz=0.01ms. That is the period is less than the RC time constant so the RC time constant cannot be less the period!
 

Papabravo

Joined Feb 24, 2006
18,793
From the suggested R3 and C1 value which gave expected level shifting, we have the time constant as C1*R3=6kohm*1uF=6ms and the period as, T=1/f=1/100KHz=0.01ms. That is the period is less than the RC time constant so the RC time constant cannot be less the period!
You are right and I miscalculated. The combination of C3 and R1 forms a highpass filter with a corner frequency of

\( f_c\;=\;(2\pi RC)^{-1}\;=\;26.53\text{ Hz.} \)

You actually have considerable freedom to set the corner frequency anywhere below say one tenth of the square wave frequency.
1654011456512.png

Edit: I did not realize that the output level depends on the relationships involved in charging and discharging the capacitor at the frequency of interest.
 
Last edited:

crutschow

Joined Mar 14, 2008
30,103
That is the period is less than the RC time constant so the RC time constant cannot be less the period!
True.
The RC time-constant needs to be long enough so there is no significant droop in the flat portion of the square wave.
So for <1% maximum droop, the time-constant should be ≥100 times the square-wave period.

The Ltspice simulation below shows the output droop for a 1ms period square-wave with high-pass time-constants of 1ms 10ms and 100ms:
Note that it takes at least 5 time-constants after the square-wave is initially applied before the output settles into its steady-state value.

1654012326049.png
 

Thread Starter

cktboy

Joined Apr 24, 2020
27
Hello,
I was trying to figure out equation for component selection for astable 555 mode given frequency and duty cycle but it seems it cannot be solved. Here is why.
The frequency is given by,
f = 1.44/((R1+2*R2)C) ---------->1
which gives, R1+2*R2=1.44/fC
The Duty Cycle is,
d = R1+R2/(R1+2*2R2) ------------->2
and using substitution R1+2*R2=1.44/fC solving for R1 gives,
R1= 1.44d/(fC) - R2 ----------->3

Using eqn3 given d,f,C and R2 does not give value R1 that is consistent with frequency and duty cycle from eqn1 and 2.

Meaning,for example, using eqn1 and eqn2 with R1=134kohm, R2=10kohm,C=1nF gives f=9.35KHz and d=93.51%.
while using eqn3 with d=50% i.e 0.5, f=5khz,C=1nF,R2=10kohm gives R1=134kohm. So using C=1nF,R2=10kohm gives R1=134kohm from here should give f=5khz and d=50% but is not,why?
 

Papabravo

Joined Feb 24, 2006
18,793
Also worth pointing out that solutions to waveform shape and voltage are not unique. The following shows the results of using any E12 series capacitor from the decade of 1uF to 10uF, and adjusting the resistor value accordingly. These pairs of values lie on a hyperbola for any choice of a particular time constant.

1654021602370.png
 
Last edited:

Thread Starter

cktboy

Joined Apr 24, 2020
27
The duty cycle equation, d=R1+R2/(R1+2*R2) with d=0.5 always gives R1=0! so is there is no or exact 50% duty cycle for astable operation?
 

AnalogKid

Joined Aug 1, 2013
10,096
The duty cycle equation, d=R1+R2/(R1+2*R2) with d=0.5 always gives R1=0! so is there is no or exact 50% duty cycle for astable operation?
Your are correct for the original, bipolar 555 astable circuit. That circuit cannot get to exactly 50/50 without additional parts.

Another way to go is to use the circuit in the CMOS 555 (LMC555) datasheet. It has the timing resistor connected to the output, and ignores the Discharge pin. That, plus the CMOS output stage that is much more symmetrical, produces an almost perfect 50/50 output with a very light load.

Page 16, Figure 17:

https://www.ti.com/lit/ds/symlink/lmc555.pdf

This circuit will work with the original bipolar 555, but the output still will not be exactly 50/50 perfect because the output does not swing as close to Vcc as it does to GND.

ak
 
Top