Square Wave Generator: Design Help for Senior Project

Click For Summary
SUMMARY

The discussion focuses on designing a square wave generator that outputs a 32kHz, 5Vpp square wave using an LM339 quad comparator. Users recommend using a 4060 CMOS oscillator/counter with a 32.768kHz watch crystal for improved performance. The variable 39pF capacitor on the crystal is identified as a fine-tuning mechanism for frequency adjustment, crucial for applications requiring precise timing. The conversation highlights the importance of ensuring the LM339's bandwidth is sufficient for the desired output waveform.

PREREQUISITES
  • Understanding of LM339 quad comparator functionality
  • Familiarity with 4060 CMOS oscillator/counter specifications
  • Knowledge of crystal oscillator operation and loading capacitance
  • Basic electronics principles, including RC timing circuits
NEXT STEPS
  • Research the specifications and applications of the LM339 quad comparator
  • Learn about the design and implementation of 4060 CMOS oscillators
  • Investigate the role of loading capacitors in crystal oscillators
  • Explore the use of the 555 timer IC in astable mode for waveform generation
USEFUL FOR

Electronics students, hobbyists designing waveform generators, and engineers working on timing circuits will benefit from this discussion.

Rawsome
Messages
1
Reaction score
0
im working on my senior design project and was looking for some help in designing a square wave generator that outputs a 32khz, 5Vpp square wave. i found a site that shows a circuit

http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/square.html

but when i connect the circuit for some reason it doesn't work.

im using a lm339 quad comparator
R=14kohm
C=0.001uf
r1=r2=100kohm
5V supply

please help
 
Engineering news on Phys.org
i tried this before and it works. did mine with +-5V. i think you were using +vcc and gnd. the square isn't really square, a bit like trapezoidal, so i'd recommend putting some sort of trigger or inverter to get a nice square wave
also make sure your lm339 has the bandwidth to do what you want to do
 
I'd just use a 4060 CMOS oscillator/counter with a 32kHz watch crystal:

http://www.national.com/ds/CD/CD4020BC.pdf
 
Last edited by a moderator:
berkeman said:
I'd just use a 4060 CMOS oscillator/counter with a 32kHz watch crystal:

http://www.national.com/ds/CD/CD4020BC.pdf
Could you explain the reason for the variable 39pF cap on the xtal? I'm thinking it's for tweeking the freq. but not sure.

Thanks
 
Last edited by a moderator:
dlgoff said:
Could you explain the reason for the variable 39pF cap on the xtal? I'm thinking it's for tweeking the freq. but not sure.

Thanks

Interesting, I didn't even notice that variable cap in the datasheet. It would allow you to bend/tweak the oscillation frequency as a fine-tune, like in a watch or clock. That 32.768kHz crystal (note the binary number, so it divides down to exactly 1 second with a ripple counter) is used in many time-keeping devices. Maybe the cheaper ones need a little fine tuning, or maybe the 200ppm typical spec for many crystals is not accurate enough for clocks.

Let's see, +200ppm is 1.000200, so at the end of 60 minutes, your watch would read 0.7 seconds fast. At the end of a day, you would show 17 seconds fast, which is probably why they add the variable cap for watch/clock applications. Interesting.
 
Most crystal oscillators need a loading cap.
 
When I was a youngster, an old ham showed me how to take a crystal (the ones that have a small removable plate) and use a lead pencil on the crystals surface (an erase as needed) to tweek the frequency. Ever heard of that?
 
try a 555 IC in astable mode...
 

Similar threads

Replies
6
Views
4K
  • · Replies 9 ·
Replies
9
Views
4K
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 9 ·
Replies
9
Views
18K
Replies
3
Views
3K
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 6 ·
Replies
6
Views
12K