Warning: include_once([path]/mobiquo/smartbanner.php) [function.include-once]: failed to open stream: No such file or directory in [path]/global.php(1091) : eval()'d code on line 38

Warning: include_once() [function.include]: Failed opening '[path]/mobiquo/smartbanner.php' for inclusion (include_path='/usr/lib/php:.:/usr/local/lib/php') in [path]/global.php(1091) : eval()'d code on line 38
Simple Square Wave Oscillator
Register to reply

Simple Square Wave Oscillator

by Adder_Noir
Tags: oscillator, simple, square, wave
Share this thread:
Adder_Noir
#1
May16-07, 02:45 PM
P: 238
Hi,

I promise I did search for this before posting what I thought would have been something which had been answered before.

Can anyone tell me how to build a simple square wave oscillator? Do I need a differentiator to get the straight vertical lines? I'd appreciate any help anyone could offer me.

Please also remember I'm a novice, thanks
Phys.Org News Partner Engineering news on Phys.org
Printing the metals of the future
New gadget helps the vision-impaired to read graphs
3D printing helps designers build a better brick
chroot
#2
May16-07, 02:49 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Most people just buy them for a couple cents a piece -- they're called crystal oscillator modules.

Is there a reason why you want to develop your own from scratch? If so, the easiest method is to make a simple resonant circuit that produces a sine wave, and then use that to drive a digital inverter. The output of the inverter will be a square wave.

- Warren
Adder_Noir
#3
May16-07, 02:52 PM
P: 238
Quote Quote by chroot View Post
Most people just buy them for a couple cents a piece -- they're called crystal oscillator modules.

Is there a reason why you want to develop your own from scratch? If so, the easiest method is to make a simple resonant circuit that produces a sine wave, and then use that to drive a digital inverter. The output of the inverter will be a square wave.

- Warren
Ah apologies I did not know they were so cost effective. Thanks for that. Out of curiousity I'm working with AC so the sine profile is already there so would it possible for me to customize it a bit more using a digital inverter, or would I now need to just buy a digital inverter due to my input being a sine wave from the mains?

Sorry for so many questions.

chroot
#4
May16-07, 02:58 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Simple Square Wave Oscillator

Hey, we love answering questions!

If you already have a suitable 60 Hz sine wave, you could indeed just pass it through an inverter to obtain a 60 Hz square wave. You could use a very cheap chip, like the 7400, which has six inverters on it.

Be careful, though -- chips like the 7400 can only tolerate voltages between 0V and 5V, which means you'd need to find some way to scale your sine wave down so it has an average value of 2.5V, and goes no lower than 0V and no higher than 5V. This can be done with a couple of resistors and a single capacitor, so it's pretty easy.

I have to issue the standard boilerplate warning though: why are you working with the mains? You can hurt yourself pretty badly with mains voltages, so be very careful! Circuits that use such high voltages require a lot of expertise to avoid injury or fire. I strongly advise that you use a transformer or some other pre-made device to drop mains voltage down to something safer before playing with it.

- Warren
Emicro
#5
May16-07, 02:59 PM
P: 30
If your sinewave is 0-5 volts you may want to use a schmitt trigger or J-K Flip Flop to make a square wave, but with both of the devices there may be some phase change due to how they are being changed from a sine wave to a square wave.
Adder_Noir
#6
May16-07, 03:01 PM
P: 238
Quote Quote by chroot View Post
I have to issue the standard boilerplate warning though: why are you working with the mains? You can hurt yourself pretty badly with mains voltages, so be very careful! Circuits that use such high voltages require a lot of expertise to avoid injury or fire. I strongly advise that you use a transformer or some other pre-made device to drop mains voltage down to something safer before playing with it.

- Warren
Nice one mate thank you Don't worry about the mains stuff I'm a qualified spark and the application is for a small portable device so there won't be too much potential for danger especially as all the work will be done with the 50Hz 240V supply disconnected

Great technical advice on the chip
Adder_Noir
#7
May16-07, 03:05 PM
P: 238
Quote Quote by chroot View Post
Be careful, though -- chips like the 7400 can only tolerate voltages between 0V and 5V, which means you'd need to find some way to scale your sine wave down so it has an average value of 2.5V
I was thinking of a good potential divider using power resistors. The output then being fed into the inverter then being feed into the base of a transistor. Of course due to the motor being there I need a diode to sink the inductive load on permanent switch off.

Quote Quote by chroot View Post
and goes no lower than 0V and no higher than 5V. This can be done with a couple of resistors and a single capacitor, so it's pretty easy.
What would I need the capacitor for by the way? As a filter perhaps?

Thanks.
Adder_Noir
#8
May16-07, 03:06 PM
P: 238
Quote Quote by Emicro View Post
If your sinewave is 0-5 volts you may want to use a schmitt trigger or J-K Flip Flop to make a square wave, but with both of the devices there may be some phase change due to how they are being changed from a sine wave to a square wave.
Hi that's probably not an issue given the rudimentary nature of the device being worked on.
chroot
#9
May16-07, 03:15 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Quote Quote by Adder_Noir View Post
I was thinking of a good potential divider using power resistors. The output then being fed into the inverter then being feed into the base of a transistor. Of course due to the motor being there I need a diode to sink the inductive load on permanent switch off.
You don't need power resistors, since you don't intend for the resistors to actually dissipate any power. You just need two very very large-valued resistors with the right ratio, used as a voltage divider to scale down your sine wave so that it's 5V peak-to-peak. It'll still be centered around 0V, though, which is not going to work.

Next, you need to shift this up 2.5V. You can make another resistor divider between +5V and 0V to get 2.5V. Finally, you can couple the sine wave to this divider with a capacitor. (Capacitors "pass" AC, but "block" DC.) The result is a 5V peak-to-peak sine wave, centered around 2.5V.

- Warren
Adder_Noir
#10
May16-07, 03:17 PM
P: 238
Thanks Warren that's great I'll post up a prelimnary sketch later this week. Nice one pal thanks a bundle
chroot
#11
May16-07, 03:19 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Keep in mind that all of this circuitry will result in a square wave from 0V to 5V. It also will require a +5V DC power supply. If that's not the kind of square wave you want, let us know.

- Warren
Adder_Noir
#12
May16-07, 03:29 PM
P: 238
Quote Quote by chroot View Post
Keep in mind that all of this circuitry will result in a square wave from 0V to 5V. It also will require a +5V DC power supply. If that's not the kind of square wave you want, let us know.

- Warren
Thanks again. Here's a rough attempt at a design. I haven't drawn in where the +5V bit should go (I think on the second divider as a bias for the sine wave to ride on?). This is also I believe a half wave rectified circuit. Not sure if that's needed but can't see how the transistor bit will work any other way. Also managed to get my protection diode in too!

Have a look please just dont' shoot it down in flames too much lol

http://i207.photobucket.com/albums/b...r6/circuit.jpg
chroot
#13
May16-07, 03:41 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Well, the capacitor should be between the midpoint of the mains divider and the midpoint of the 5V divider. And both dividers need to be connected to ground at the bottom.

- Warren
Adder_Noir
#14
May16-07, 04:32 PM
P: 238
I see, I'll change those for the next go. Thanks.

*Done*

http://i207.photobucket.com/albums/b.../circuit-1.jpg

I assume that if I made the initial signal voltage divider resistors too high then not enough current would flow through the base to turn on the transistor. Can anyone recommend some values? Several hundred k's perhaps?
chroot
#15
May16-07, 04:50 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Quote Quote by Adder_Noir View Post
I assume that if I made the initial signal voltage divider resistors too high then not enough current would flow through the base to turn on the transistor. Can anyone recommend some values? Several hundred k's perhaps?
You don't need any current to flow into the inverter -- inverters are composed of MOSFETs, and have insulated gates. They respond to voltages, not currents.

- Warren
Adder_Noir
#16
May16-07, 05:09 PM
P: 238
Ah super, so I just need high values of R. Brilliant. I'll be in touch and let you know how it goes. Will be assembling something next week. Just before we let the thread go cold can you think of anything about the design that presents a major issue, or do you think from a design (not a safety) perspective I can proceed?
Adder_Noir
#17
May17-07, 02:38 AM
P: 238
Hi I've had a look at some power transistors and I was wondering what Vceo means? Really I'd like to simply put 240V across it and play with the current using the variable resistor (control knob) earlier in the circuit rather than have the maximum potential snubbed.

I noticed most had a max Vceo of 60V does this mean that's all I can put on the collector?

Once I've understood this little piece and I've sourced a cheap inverter I'll be building!

*Edit*

Update, just to recap though, given that the unit will be half-wave rectified (thus providing lower speed) and the inverter will only turn on the transistor when the signal voltage acts against the 2.5V to drop it..... doesn't that mean that the transistor will only conduct during a negative cycle and that negative cycle can not deliver any power due to the rectifiying diode thus meaning the motor will never run?

If the above is true can I get around it by running two inverter's in series? (the 7416 chip comes with 6 or 8 inverters).
berkeman
#18
May17-07, 10:09 AM
Mentor
berkeman's Avatar
P: 40,717
I've only skimmed the thread, but Adder_Noir, I think there's been a bit of a disconnect here.

BVceo is the breakdown voltage from collector to emitter with the base left open (or with relatively high resistance bias), and yes, it will typically be in the range of 40V to 60V for small signal transistors. If you wanted to have a BVceo high enough to handle 240Vrms (quiz question -- what rectified voltage does that give you?), you are talking about using very high voltage transistors (big) like we use in off-line switching power supplies.

But the others who have been helping you have been talking about a low-power, low-voltage circuit for you to make a square wave of a few volts. And now you are talking about using that small square wave to drive power transistors interfaced to the 240Vrms AC mains?

BTW, you mention that this is for a portable device, and that would normally mean it is battery powered. How does a portable device get access to the AC mains 50/60Hz?


Register to reply

Related Discussions
Harmonic oscillator inside square well Advanced Physics Homework 1
Odd square wave oscillator Electrical Engineering 3
A square wave oscillator Electrical Engineering 3
Who knows how to make a simple sine wave oscillator? Electrical Engineering 2
Simple Sine Wave Oscillator Circuit... I think this diagram is incorrect Electrical Engineering 8