Introduction: Build a Square Wave Oscillator - Part 1 of DIY Modular Synths

Picture of Build a Square Wave Oscillator - Part 1 of DIY Modular Synths

Synthesizers have become an incredibly prominent instrument in modern music; it's difficult to hear a track without one anymore! Unfortunately, many synthesizers are incredibly expensive and hard to acquire, making it rather difficult for the hobbyist or budget musician to get any of those sounds. This instructable won't teach you how to build one of those feature-rich, user friendly synths, but it will start you off with a very simple device that can be used with other units to create interesting and unique sounds.

The following is the simplest and most fundamental piece of a synthesizer - an oscillator. This particular oscillator is a "Square Wave" oscillator, and has limited functions, but can still be used every now and then for fun sounds.

This model is powered either by a 9v battery or an external 9v power supply, has one 1/4" output jack, and has two controls: volume and frequency.

Let's get started!

Step 1: Gather Your Parts

Picture of Gather Your Parts

The square wave oscillator is a rather simple device, so not much is needed to construct it.

I've attached a saved shopping cart for for all of the components you'll need. The total cost of this shopping cart is $36.54 before shipping, so it's a pretty cheap build!

Here's a (linked!) list of everything you'll need:

You will also need a few tools:

  • Drill Press
  • Drill Bits of Varying Sizes
  • Drill Bit Index
  • Sharpie
  • Breadboard
  • Safety Goggles
  • Soldering Iron
  • Solder

Step 2: Plan Your Layout

Picture of Plan Your Layout

Now that you've got all the parts, you'll need to do a bit of planning to properly arrange all of the pieces inside the enclosure. Because the output 1/4" and 9v power jack (or battery) take up space within the enclosure, it is a good idea to both visualize and physically place the pieces within the box such that nothing is overlapping with anything else, and that it will all fit nicely inside the closed project enclosure.

For this model of the oscillator, I placed the two jacks at the top, and the two potentiometers opposite from the jacks, as shown in the photo below.

With a sharpie, mark with either a dot or small "x" where you want the potentiometers and jacks to sit in the final product. These will be your guide when drilling holes in the enclosure.

If you decide to arrange the jacks in a different manner than what I have here, be sure to take time with this step, otherwise you may end up having to drill more holes than you want in your final product.

Step 3: Drill Project Enclosure Holes

Picture of Drill Project Enclosure Holes

Next, we take the now marked enclosure to a shop that has a drill press. Before actually making any permanent punches, you need to determine what size these holes need to be. In order to do this, we'll use the drill bit index.

To ascertain the correct sizing, take the piece that you're drilling the hole for, and strip it of all nuts and washers, so the thread is on the outside. Take the piece and find the hole on the drill bit index that it fits into snugly. Make sure it's a snug (but not forced) fit. Once you figure out what size of drill bit to use, write down the size and its corresponding component. Repeat this process for all of the components that will be mounted in the enclosure, which includes the 1/4" audio and 9v jacks, the LED, and the two potentiometers.

Find all of the different size drill bits you'll need and head over to the drill press. Order of drilling doesn't really matter, so start with whichever hole you'd like.

Begin by securely clamping down the enclosure in the drill press's vice, as shown below. Next, place the desired size of drill bit in the "chuck" (the drill bit holder), and tighten it down with the chuck wrench as shown. While powered off, lower the drill bit and adjust the location of the enclosure so the bit will drill through your marks. After this, put your safety glasses on, turn the drill press on, lower, and drill! Repeat for all marks until you have a hole for the two potentiometers, both jacks, and the LED.

After you have an enclosure with all holes drilled, like shown below, test all of the sizes by placing all of the pieces in their respective spots.

Step 4: Lay Out and Solder Circuit

Picture of Lay Out and Solder Circuit

This next step requires the most skill out of the others, namely the ability to read a schematic and the ability to solder. Both have an incredible amount of resources both on and offline, so even if you aren't the most technically minded, you should be able to learn both incredibly quick. One that I would suggest is Sparkfun's "How to Read a Schematic."

Above is the schematic used for the square wave oscillator. If you're unfamiliar with schematics, it may look daunting, but take some time reading up on schematics and you'll be able to put together this circuit rather easily.

Note that I have also included a pdf version of the schematic, in case the first one is hard to read in your browser.

If you've never soldered before, I would suggest testing out your skills on a couple of extra wires and components before you try your hand on your actual circuit.

Also, I would suggest getting a "Breadboard," which is a tool that allows you to lay out a circuit and test it before making anything permanent. The second image above is an example layout of the breadboard that will work. Because breadboards are designed to be easily changed and are for prototyping purposes only, your breadboard will probably not look exactly like the one shown here.

If you're new to breadboarding, has a really great tutorial to check out.

After you've assembled your circuit, you need to transfer it to the "Perf" Board to be permanently soldered on. Take your time with this step and make sure that all of the connections are correct and that no excess wires are touching.

When you're ready, solder all of the points, and then cut all of the excess wire off. Shown above is the Perf Board, both soldered and unsoldered.

Step 5: Put Everything Together

Picture of Put Everything Together

Almost there! You have your circuit and your enclosure ready to go, now it's time to put it all together. After soldering the excess components (the jacks, LED, and potentiometers), place all of them in their respective drilled holes and secure them with their washers and nuts. Gently place the perfboard in the enclosure and press to make sure that it will all fit.

To prevent short circuiting, you will need to tape up the lid with some sort of non-conducting material. I chose duct tape.

After everything's secured, place the lid on the back of the open enclosure and secure it with the provided screws. Shown below is what it should look like after this. I had a few extra knobs laying around, so I put those on the potentiometer posts.

Congratulations, you now have a square wave oscillator!

Step 6: Decorate As Desired

Picture of Decorate As Desired

Have fun with this step! Get some paint, sharpies, anything you can get your hands on and make your oscillator look fun and exciting!

For mine, I just drew a simple little design with black sharpie.

Step 7: Make Weird Noises

Picture of Make Weird Noises

This oscillator works with any standard 9Volt wall adapter, commonly used for guitar pedals, shown in the pictures below. Simply plug it in to the 9V jack, take a standard 1/4" cable, plug it in to some speakers, and you're ready to make weird noises!

You've now opened a can of worms as far as electronic projects go, as there are countless other synthesizer modules that can be built: filters, envelopes, more complex oscillator structures; the list goes on and on.

For some idea of what kind of sounds you can get out of this box, here's a video showing the unit in action:


dnhushak (author)2015-04-18

Hello everyone! I never anticipated this would become such a popular instructable! Because of its popularity, I'm going to be making some updates addressing the most common questions I've been asked.

First, I have uploaded a much nicer looking schematic, with more detailed notes on it. There is one embedded in the instructable as well as a pdf download for easier/more convenient reading.

Other planned updates:

-A fritzing diagram for the breadboard layout

-An eagle file so you can order a PCB custom made for this project!

-Information on how to get different frequency ranges

-A troubleshooting guide for some of the most common problems people have

If any of you have any suggestions for things you would like to see added/improved, please let me know!

dnhushak (author)dnhushak2015-05-01

Update #2!

I have just designed an eagle pcb for this, I've ordered a set and will confirm that it does what it's supposed to do, and then I'll post the eagle file, so everyone can have a nicely laid out PCB!

SympanS made it! (author)2017-11-23

Completed, it features a couple of "extra": on/off switch and CV input parallel to the pitch pot.. Quiet nice, simple and clean Oscillator!

KrisL38 made it! (author)2017-06-09

i made it, first project of this kind. I first made your breadboard version, then decided to double it and make it into eurorack format, so now it's a double oscillator which sounds pretty good. It is still powered by 2 separate 9v, but i am planning to get it powered by a single 18v, which i don't have lying around at the moment.

SympanS (author)KrisL382017-11-12

hi, did you put some CV input jack? if yes where in the schematics?

dnhushak (author)SympanS2017-11-13

SympanS - can't speak for KrisL38 directly, but it looks like he's got two 9v inputs (the smaller jacks on the right side of the board), and two 1/4" outputs on the top. Based on that I'd guess no CV input, as the schematic would have to be pretty heavily modified to allow for a standardized CV input to be meaningful at all.

The oscillator circuitry is pretty simple and straightforward and is more aimed at the "first electronics project" type of thing as opposed to the professional synth community.

Thanks for the interest though!

SympanS (author)dnhushak2017-11-15

thanks for the explanation too! do you know any circuit available on the web which is similar to your OSC and adds CV (or even LFO or similar) to change pitch primarily?

by the way I just completed your oscillator today, it works pretty well without any unwanted noises etc.!

thought I would like to add some more options to the circuit until it is still on the breadbord..

dnhushak (author)SympanS2017-11-15

I don't know any schematics *specifically,* but my suggestion would be to get some voltage controlled resistors and replace the "pitch" potentiometer, or put the VCR either in parallel or in series with it for various types of control. Hopefully that makes sense!

Glad you got it working!

SympanS (author)dnhushak2017-11-23

I placed a piezo mic functioning as "CV" parallel to the pitch pots and it works as I hoped.. Now probably I would implement some kind of step sequencer module or even a midi/cv converter to work with midi devices..

Thanks for the previous advice!

dnhushak (author)KrisL382017-06-19

That's awesome! Regarding the 2 9v, you should actually be able to power both of them off of a single 9v - if you make just one of the "Power Supply" section on the schematic, your +4.5v and -4.5v nodes can power both oscillators at their respective ±4.5v nodes. Hopefully that makes sense!


MarkB651 (author)2017-06-23

hi, I'm just starting as an electronic engineering student as was wondering what effect different values of resistors and capacitors would have? Also do you need to be a premium member to download the eagle file?

dnhushak (author)MarkB6512017-06-23

Hi there! Unfortunately, I haven't gotten around to uploading the eagle file, so sorry about that! If you're starting as a student I would still recommend getting the experience of breadboarding and perfboarding before you order a custom PCB. Trust me, it'll make you appreciate the PCBs a lot more ;).

As far as changing the resistor and capacitor values, the short answer is "a lot of different things would happen," as the different caps and resistors have various purposes:

R2 and R4 "divide" the 9v battery signal into ±4.5v rails for the op amp, and as such their value isn't *super* important, as long as they are both the same. Lower values will drain your battery faster though.

R1 serves as a current limiter through the diode, so again lower values will drain your battery faster. higher values will most probably dim your LED, but feel free to play around with those. The highest value of resistor with an acceptable LED brightness is your ideal.

All of the resistors and capacitors in the "oscillator" section of circuitry are what actually define the frequency of the oscillator. Without getting into too much depth here, the easiest way to see how they affect things is playing around with the calculator on this website:

R9 works with the volume potentiometer to "divide" the signal as a voltage divider. Messing around with these will just change the output volume.

C2 and R11 just form an RF filter circuit, so you don't inadvertently create an antenna and radio tuner circuit from your mess of wires and have it end up in your audio signal down the chain. Changing those won't have any audible difference for you.

Hope that helps, happy tinkering!

Max Bliss (author)2017-03-31

Hey, I was reading the LM741 data sheet and was wondering what would be the sonic consequences of feeding the opamp more then +-4.5V? Especially since the recommended minimum is of +-10V.


dnhushak (author)Max Bliss2017-03-31

There wouldn't be any direct sonic consequences - the circuitry and the op amp would work exactly the same - the only difference is you'd be able to increase the output voltage of the oscillator; Op amp operation only allows the output to be between its "rail" voltages (in the case of the circuit in the intractable, -4.5 to 4.5 volts). If you increased it to ±10v, you'd be able to output up to those voltages.

Hope that helps! Happy Synthing!

Max Bliss (author)dnhushak2017-04-14

Thanks! I have 2 more questions...

I'm interested in adding a pushbutton for momentary ON. The most quiet way I found to shut down the signal was to turn off power to the op-amp, is this a good solution or would this harm the components?

And, Is there a way to eliminate noise from the circuit? Or a way to have more signal relatively to the noise. The noise I'm referring to is a hum, it remains also when I disconnect the out wire if ground is connected to the amp.

dnhushak (author)Max Bliss2017-04-14

Hmmm... Cool idea. What might work is if you put something like a 10Ω resistor with one side on the ground shunt, and the other side connected to the momentary switch, with the other side of the switch connected to the node between the volume pot and the capacitor. Hopefully that makes sense in text-form.

Regarding the noise - not quite sure where that might be coming from =/ It sounds like there's some sort of ground loop between this circuitry and whatever amplifier you're using. Perhaps a ground lift plug?

Synthfreak (author)2017-03-13

Is there a possibility to add a CV input and output, to add it to an already existing synthesizer. I ask because I own a single-oscillator synthesizer and I want to add a second one.

dnhushak (author)Synthfreak2017-03-22

You'd have to build some sort of "CV to resistance" conversion circuit, so in a sense, yes it's "possible" but there would unfortunately be a lot of math involved and slightly more complicated circuitry to get it to be precise to pitch and everything.

BillN13 made it! (author)2015-09-02

Got it working! I couldn't find a 741 so I used 778a instead. Changes the pin out quite a bit but allows for a dual OSC.

That changed pinout tripped me up for a little bit

dnhushak (author)BillN132015-09-02

Cool! Glad you got it working! The dual oscillator could be cool if you add another pot for frequency - you could then either sum them or just mix between the two!

corescan (author)dnhushak2016-12-29

Ugh! I'm super interested in different waveforms and mixing the signals together (two voices). Please feel free to expound xD

RickyW6 (author)2016-11-10

I have the circuit complete but can't get any sound

dnhushak (author)RickyW62016-12-16

Could you provide some more specifics? In electronics, there's a wide range of things that could go wrong, in any number of spots. Are you breadboarding or using a perfboard? What are you hooking it up to, headphones or normal powered speakers? Did you use the exact list of parts mentioned in the instructable?

Spano (author)2016-12-04

I've tried doing this, but when I triple checked the diagram everything
looked okay, so I'm very frustrated. For some reason, my integrated
circuit gets extremely hot and it starts to melt my breadboard... I'm
scared of the accidental exposure I may have had with the fumes.
Anyway, I can post pictures if that would help, I would appreciate it
very very much.

dnhushak (author)Spano2016-12-16

Hmm. There's any number of things that could be going wrong - if your IC is heating up a lot, I would say it's probably due to over-voltage or mis-wiring. What voltage are you using for the power supply? Or are you using a 9v battery?

Are you 100% sure that the op amp you're using is the same model (and therefore has the same pinout) as the one in the tutorial?

Are you breadboarding the project first before moving to a perfboard?

Go ahead and post some pictures!

afridave (author)2016-09-20

if I built 3 of these all slightly different resistors and different potentiometers....and played 2 of them through the third?...and 2 sets of 3 through another?...etc etc...I imagine you could expand this concept unlimited..

dnhushak (author)afridave2016-09-20

Absolutely! But not "through" one another per se. You'd have to get some kind of mixer together to play them at the same time, but do some googling, circuits for mixers are definitely out there and relatively easy to implement!

afridave (author)dnhushak2016-09-20

i have been thinking about it...and better still....use a multiple selector switch between various independent circuits containing different resistors and potentiometers...each oscillator then becomes a multiple synth...ive played with some software synths on frootloops and most seem to consist of two oscillators and a low frequency oscillator....a it possible to generate your source tone using different frequency crystal oscillators?

dnhushak (author)afridave2016-09-22

There's no crystals in these circuits, it's just the relationship between the resistors, op amp, and capacitors that causes the oscillation to occur. This oscillator build is *drastically* simpler than anything you'll see on a DAW like fruity loops, logic, pro tools, etc. The design doesn't allow for control inputs from things like LFO's, or a dual-oscillator modulation, or anything of that nature unfortunately.

Like the ideas, but they're definitely a lot more complicated than this project allows for!

afridave (author)dnhushak2016-09-22

indeed...but three of these items all playing independently but in tandem begin to resemble something more sophisticated.....

afridave (author)dnhushak2016-09-20

this is where my mind is....multiple selector switch between multiple crystal oscillators connected to multiple selector switches between various circuits containing various potentiometers and resistors?....output...just thoughts..

afridave (author)dnhushak2016-09-20

check out a song called being boiled by the human league...the original track was recorded in 1978 and was one of the very first completely electronic recordings...there is this kind of electronic feedback in the background that sounds like electronic wind...its subtle but really fascinating to listen to..

ohoilett (author)2016-08-06

Hi, are you still working on this?

Nice synth by the way.

dnhushak (author)ohoilett2016-08-07

If you mean "where might parts 2, 3, etc. be?," I fully intend to [eventually] make some more instructables, but have never gotten around to it. This particular instructable I don't do much work on other than replying to comments and the occasional update.

Glad you like the project!

ohoilett (author)dnhushak2016-08-07

Got it. I'm looking forward to your future 'ibles.

puttitin (author)2016-07-20

is there anyway i can hook up a midi keyboard or any kind of controller to control the frequency?

dnhushak (author)puttitin2016-07-23

Without a looooot of extra electronics, not easily. The MIDI protocol is based on "events," like "note on" and "note off," whereas something like this is analog audio and relies on continuous signals, often called "Control Voltage" or "CV" signals in the analog synthesis world. So, you'd first have to purchase or construct a MIDI to CV converter.

Additionally, you'd have to alter the circuit to allow for a CV input (which I've intended to do for a while, just have never gotten around to it!), so unless you're quite familiar with analog circuit design, I'd say it's probably best to just stick to what's in here.

If you've got a MIDI keyboard, I'm guessing you've got some sort of software that could almost definitely synthesize a square wave (I know, not the answer you were looking for, but that's part of this device being so simple, is it doesn't have a whole lot of bells and whistles).

So sadly, in short, no. =/

lgalea (author)2016-04-14

Any idea how this can be modified to get a SIN and TRIANGLE Wave Oscillator as well ?

Thanks and great instructable!

playinmyblues (author)lgalea2016-05-03

Try looking up 4 op amp function generator. That should give you enough to figure out how to get a pseudo-sine and triangle waves.

dnhushak (author)lgalea2016-05-03

I have not personally done it, but it should be possible! In step 4, I denote which portions of the circuit are the Power Supply, Output Volume, and Oscillator portions of the circuit. If you pull out the oscillator portion (that's a square wave in this case) and replace it with circuitry that's readily google-able for a Triangle or Sin wave oscillator, it *should* work. No absolute guarantees, but if you were able to get this one to work, that's a good next step!

KevinV29 made it! (author)2015-12-15

not really square but more ramp square combo.

dnhushak (author)KevinV292016-05-03

Looks like it's working! My guess is that the oscilloscope sampling/triggering might be slightly off, and that's what's causing the artifact ramps.

MrBludhaven (author)2015-12-07

.the generator works great...i just wanted to ask why have you connected the frequency control part to the inverting input in your schematic as opposed to the traditionally used non-inverting input? Is there any distinct advantage?

dnhushak (author)MrBludhaven2016-05-03

Nope, no distinct advantage. The circuitry is a little simpler when using the inverting input. There's a fair amount of mathematical and theoretical circuitry explanation as to why, but that's the short end of it.

playinmyblues (author)2016-03-30

Great project. The video at the end was very good to see - shows that what you build really is useful.

dnhushak (author)playinmyblues2016-05-03

Thank you! Glad you like it!

dirpty (author)2016-05-02

Hello, I have been working on this project for a few days and am having a little trouble. A quick question if I may.. is the ground rail connected to anything? Perhaps it would be the negative side of either the 9v battery or 4.5v rail. Or does it just standalone? Any help would be appreciated, cheers :)

dnhushak (author)dirpty2016-05-03

Nope! The "ground" in here is just the "reference" point - doesn't refer to any actual grounding. If I were to be *technically* correct, I would use the word reference instead of ground, haha.

Anyway, the ground rail is its own rail, and it is the "0V" reference. It's sort of a goofy thing to wrap your head around at first, but by putting the reference "in the middle" of the 9V battery, it makes the + side of the battery technically +4.5 volts, as compared to the reference, and the - side -4.5 volts, as compared to the reference. This allows the op amp to create both "positive" and "negative" voltages, but all in reference to the ground. Hope that makes sense.

Short answer - nope, it's its own thing!

CyclopsTiger (author)2016-04-10

Could I easily add an external input to this oscillator?

MoritzK1 made it! (author)2016-01-19

I Made it! It was my first project. Everything worked fine, except for the volume. It is very low after I soldered it. Might it be, that I only use a 10k R, instead of the 2 x 10k in series or the 20k connected to the ground?

Anyways, connected it to my sound interface and it sounds pretty cool. Planning now on building some effects to modulate the sound.

cheers from Germany :)

About This Instructable




More by dnhushak:Build a Square Wave Oscillator - Part 1 of DIY Modular Synths
Add instructable to: