Square Wave Generator: Design Help for Senior Project

Click For Summary

Discussion Overview

The discussion revolves around designing a square wave generator for a senior project, specifically targeting a 32kHz output with a 5V peak-to-peak signal. Participants explore various circuit designs and components, including comparators and oscillators, while addressing issues encountered in implementation.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant describes their attempt to build a square wave generator using an LM339 quad comparator, noting issues with the circuit's performance.
  • Another participant suggests that using a bipolar power supply may improve the output waveform, which they describe as trapezoidal rather than square, and recommends adding a trigger or inverter for better waveform quality.
  • A different participant proposes using a 4060 CMOS oscillator/counter with a 32kHz watch crystal as an alternative solution.
  • Questions arise regarding the purpose of a variable 39pF capacitor in the oscillator circuit, with some participants speculating that it is for frequency tuning.
  • Discussion includes a historical anecdote about adjusting crystal frequencies using a pencil, indicating a hands-on approach to frequency tuning.
  • Another suggestion is made to use a 555 timer IC in astable mode as a potential solution for generating the square wave.

Areas of Agreement / Disagreement

Participants express differing opinions on the best approach to design the square wave generator, with no consensus reached on a single solution. Multiple methods and components are proposed, reflecting a variety of perspectives on the problem.

Contextual Notes

Some participants note the importance of bandwidth for the LM339 comparator and the need for loading capacitors in crystal oscillators, indicating potential limitations in the designs discussed.

Who May Find This Useful

This discussion may be useful for students and hobbyists working on electronics projects, particularly those interested in waveform generation and oscillator design.

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
13K