Thursday, 26 November 2020

$20 Synth Project - Complete Build Guide

Complete Synth Build Guide For Beginners

Helios One Arduino synth

This guide is for complete beginners in electronics & synth making.  We'll be building the 'Helios One', a total bastard of a synth a MIDI controlled synth made from a low cost Arduino micro-controller and the Mozzi audio library.   Even if you can't read a schematic you should still be able to build the synth by following along with the pictures.  We'll go through all the stages of building it together: getting the parts / coding / electronics / case making.  

**Update 1** Added some back panel images - Nov 28th 2020
**Update 2** Protoboard ordering information updated - Dec 1st 2020
**Update 3** More info on laser engraving - Dec 1st 2020
**Update 4** Added tip about completing the case before electronics - Dec 14th 2020
**Update 5** Changed the Audio jack to one with better depth to fit case - Dec 14th 2020
**Update 6** Improved text about checking with a multi-meter - Dec 22nd 2020
**Update 7** Updated text about troubleshooting - Dec 29th 2020
**Update 8** Alternative link to slider switch - Dec 29th 2020
**Update 9** Added pictures of the finished board (second to last pic) - Jan 16th 2021
**Update 10** Added test code to the problem solving section - Feb 8th 2021
**Update 11** Test code altered - should be working now - March 19th 2021
**Update 12** Added link to turn the synth into a drone synth - March 5th 2022
**Update 13** Added link to drone synth with full ADSR - March 20th 2022
**Update 14** Added info about using an older Version of Mozzi Audio Library - Feb 18th 2023
**Update 15** Latest version of Mozzi Audio Library working with Code - March 17th 2023
**Update 16** Use Mozzi library V1 and not V2 - Sept 19th 2024
________________________________________________________

Hall of Shame Fame

It's a fairly simple synth, and while I don't think Hans Zimmer will be using it for sound design or anything it can still make some cool sounds.  Here's some audio examples;


Reddit user u/boxed-sound completed the build and posted the following video:


Here's a video of the synth built inside an Altoids mint tin (also serves as a nice demo without reverb or delay).  

Hackaday also posted a story.

Over at DIY-electro-music they give a great breakdown of the code & give ways in which it can be improved: https://diyelectromusic.wordpress.com/2021/07/15/universal-synthesizer-panel-helios-one/

________________________________________________________

The Code / Making Of

You can find the code over on my github page - the latest version is v4.6.  Here you'll find files for the front panel if you need them, but the code that contains the synth is labelled '.ino' (load that into the Arduino software).  

There is also an alternate version of the code featuring an added drone synth, which I'd recommend (read the next section below titled 'Drone Version').

If you want to dig a little deeper & learn about the code, I wrote some articles detailing that;

Upgrade to the original Code:




Helios Drone Synth:

Something I find really cool: Reddit user u/CallPhysical combined the synth with a drone synth (video is also found in the link). 

**UPDATE** This code has now been updated so you can now freely select between synth mode / drone mode without having to re-upload the code.  So now you basically get two synths in one! How great is that? 

A reddit article/link to the code is shared here.  

One version of the code needs you to add two extra potentiometers and a switch so you can control the 8 drone oscillators (when in Helios synth mode, those two extra pots give you a full ADSR).  

The other version of the code uses the original amount of pots/switches from the Helios synth... you chose between drone/synth mode depending on how the lfo switch is set on start up (you'll need to restart to change modes again).  Because you're lacking the two extra pots you can only control 6 drone oscillators but it's still a fantastic upgrade for minimal effort, so I recommended giving it a try to bring some more versatility to your little synth. 

**Drone Update** 20/03/2022
The code with the extra pots now features full ADSR! Use the code named Helios_Drones5_2

________________________________________________________

Parts:

There are no hard to find/custom parts; everything is easily available from electronics suppliers. Because of this it's also very cheap to make, about $15 before shipping.  If you want to put it in a case like in the photos and have no spare wood etc laying around, the parts for this came to €5.

Legal: You build this machine at your own risk, therefore I cannot be held responsible for damage or injury resulting from these instructions.

Suggestion: Read through each chapter before starting so you'll have an idea what to expect and maybe save yourself a problem or two. 

Tip: You may find it easier to build the case first, before you've added any of the parts to the front panel (saves you removing them).

Help Me:  If you spot any mistakes please let me know in the comments.

1. What You'll Need

Let's start first with all the components that we'll need, commonly known as a bill of materials, or BOM (don't say that in an airport).

I've chosen most of the components from Tayda electronics in Thailand; they're cheap and have always been reliable with parcels making it to me in Germany in about a week or so.  They also have monthly 15% off discounts, so keep an eye out on their Facebook page for that.

Some components that I couldn't find I've posted eBay listings for, I'm sure you'll be able to find the equivalent parts listings in your own country, or perhaps you have local parts shops?

(please let me/others know if you spot a mistake)

Tayda Parts:

x1    Arduino Nano with usb cable         $3.69                The 'brain' of our synth


It was pointed out to me that this pot is silent until the last few millimetres and then suddenly the volume is full.  Try using a 100k version like this one instead. 

x1    1M Ohm Logarithmic Taper Pot     $0.50                Audio volume pot (use 100k)


x6    10K Ohm Linear Taper Pot            $0.50 ($3)         Synth control pots



x4    220 Ohm 1/4W 5% Resistor          $0.01 ($0.10)    Resistors (10 pack)

x2    270 Ohm 1/4W 5% Resistor          $0.01 ($0.10)    Resistors (10 pack)

x1    100 Ohm 1/4W 5% Resistor          $0.01 ($0.10)    Resistors (10 pack)

x1    470 Ohm 1/4W 5% Resistor          $0.01 ($0.10)    Resistors (10 pack)


x1    1N914 Diode 200ma 100V            $0.03                 Diode

x1    3.5mm Mono Audio Jack               $0.12                 Audio Out jack

**Update** This above jack was not long enough to fit the 3mm-deep Perspex sheet, replaced with a slightly longer version;

x1    3.5mm Mono Audio Jack               $0.22                 Audio Out jack

Tip: You can also use a larger guitar audio jack if you'd prefer.

x1    0.1uf (100nf) Poly Cap                   $0.10                Poly Capacitor for audio


x1    Proto board                                    $0.99                Solder board for parts to sit on

**Update** Unfortunately Tayda didn't sell the same board as I used so this one was used as a replacement. It's a lot bigger than the 5cm x 7cm board I used, but it's possible to trim it down:  What you can do is get a box-knife and a metal ruler and score down the sides you want cut off, then place it over the edge of a table and snap it off.  Use a marker to add the numbering and characters.  If you don't want to do this, have a search on eBay for a more similar board.  Here's a link to banggood selling some (another site I use with much success), however it looks like the numbers / and letters are reversed from the board I used, so you might want to search further.  Here's an eBay link to similar boards 

x2    On-On Toggle Switch                     $0.70 ($1.40)   Two switches for front panel

x1    Slider Switch                                  $0.19                Switch for Arduino MIDI/pc upload

**Update**  Reddit user u/Corican has said this switch is larger than the one I used in the examples...  they had to dremel the proto-board with a 1.5mm bit to get the legs to fit, plus change the layout ever so slightly.  The good news is they managed to make it work in the end.  Unfortunately it looks like Tayda doesn't sell the exact switches I used, but I believe these are very similar on Ali Express or these on ebay.


x5    AWG hook up wire Black               $0.10 ($0.50)    Black wire (150cm)

x5    AWG hook up wire Red                 $0.10 ($0.50)    Red wire (150cm)

x5    AWG hook up wire White              $0.10 ($0.50)    White wire (150cm)


Ebay parts (Google it & you might find better prices closer to you/store pickup possibilities etc).  If the listings have ended, search by component name and if it looks like the photo shown here, you should be OK;

Tip: You can get parts from China really really cheaply but delivery times of a month or more are very common. Also I guess for me personally, maybe 1 in 20 items tend to never arrive.  Ebay has a great refund policy, but if something gets lost you might be looking at a two month wait until you get your hands on a part.  If you've ordered the other parts from Tayda that will get to you in a week, you may find paying a little bit more from a same-country seller is well worth it.

x1    6N138 optocoupler                        $1.80                 For Midi signal (5 pack, Ebay)


x1    5pin MIDI Din Connector                $0.99                Midi connector (ebay)


Parts Total: Tayda $11.92 / Ebay: $2.79

Total: $14.71 (without P&P)

Obviously postage will be different where you are in the world, but using the Tayda discount code hopefully everything will come to about $20...  maybe $22, but I think it's better say $20 purely for the click-bait title. Let's agree to disagree OK?

What Else?

You'll need a soldering iron, solder, wire-cutters, pliers, wire-strippers (or use a sharp blade to expose wire).  If you make a mistake soldering you might need a solder sucker. If you make lots of mistakes you might need a multi-meter.  If you have none of these things, you can often pick them all up in starter kits.  

The Case

You're free to put the synth in any case you like, although perhaps not metal as it can cause problems.  Cheap options include an old lunch box or VHS tape case.  Those dollar-store places often sell wooden boxes that can be used for a synth case.  If you want to build a case like in the pictures, you might well have some spare wood lying about.  If not, mine cost 3 Euros from an arts supply shop.  You might be able to get them to cut it for you if you're lucky.  I used a perspex sheet for the front panel, again from the arts shop for about 2 euros.  I used a laser engraver for the panel text, but if you don't have one no worries, you could use a silver marker pen, or a label printer.  Other things you might need are wood glue and a saw.  Some screws?  All things you should be able to get at a hardware store (or pay 3 times the price at an art supplies store).

No laser engraver? Here's another synth with labels from a label printer


Knobs: There are loads of types to choose from, here's a Moog-style pack of ten for under 2 euros. Or some Dave Smith types for 1.40e.

Hand made synth


2. The Code

Parts arrived? Lets start with testing the Arduino.  First you'll need to download the Arduino IDE, which lets us upload the code from your computer to the Arduino Nano.  Head over to the Arduino site and download the software for your pc/Mac/Linus computer.  Go ahead and install it.  

Installing Libraries

Update 18/02/23: The latest version of the Mozzi library won't work with the Synth code.  Please read the fix at the top of this guide marked 'Update 14' which will show you how to install an older version of Mozzi - IGNORE, Code is working again ;-)

Update 19/09/24: Mozzi  2.0 has been released but might not work with the Helios code.  I recommend using Mozzi V1 library for now, which you can find here: 
https://github.com/sensorium/Mozzi/tree/Mozzi_1

The code we are using requires some external libraries.  Libraries let you use code that other people have written, letting you achieve stuff that you might not be able to do on your own (god knows I couldn't).  Lets install them now.

To use MIDI with our synth, we need to download the library from 47 effects.  Click the 'code' button, then download the zip file.

In the same way, go and download the zip file from the Mozzi synthesis library.

So now you should have two zip files waiting to be added to the Arduino software.  Open the Arduino software, click 'Sketch' -> Include Library -> Add .Zip Library


Choose the 47 effects zip file, and import it in.  Then do the same with the Mozzi Library.  You might have to restart the software for it to appear, but you'll know it's there if you can see it in your Arduino libraries list;


Great, so now that's installed, lets connect the nano and upload some code.  If you're having any problems, google it or use the Arduino forums.  I promise you someone else will have had the same problem, and someone else will have the answer.

Connecting the Nano

Connect your Arduino Nano to the computer with the USB cable.  Hopefully the software will auto-detect, but we still need to check.  Go to Tools -> Board -> Arduino Nano.  Now we choose the port (Tools->Port) and chose where the USB is plugged into (com1, com2, com3 etc).  There's loads of tutorials online about this (aka better than I can write).  

If you have problems uploading your code

You may need to install drivers, but hopefully not.  The internet is your friend if you're having trouble.  If you purchased your Arduino form Tayda, there's a link to drivers on the product page.

With the Nano plugged in, you're given the option to choose the processor (tools -> processor), you might find changing from atmega328p, to atmega328p(old boot-loader) will help..  To see if it's working, we'll upload our first software program (called a 'sketch' in Arduino speak)

Our First Sketch: Blink


Choose:

File -> Examples -> 01. Basics -> Blink

The program will now load into the Arduino software, you'll see this as code on the screen.  Next we have to upload it to our Nano.  Click the upload arrow on the software.  The program will compile and then send it to your Arduino Nano (as long as the Nano is connected OK, and you've selected 'nano' as your board under tools etc).  You'll get an error message if there's a problem (if so google about connecting an Arduino to your computer).  If it's successful you'll see a 'done uploading' sign.  The sketch 'Blink' turns the built in LED on the Nano light on and off every second.  If you see the 'done uploading' message and the LED on the Nano flashing, you know your board is working.  This is good!

Playing with the code

Just to show the computer who's boss, we'll change the code ever so slightly.  In the blink sketch page, change the two parts of the code that say delay(1000) to delay(500).  This will flash the light every half second.  The code looks like this;

// the loop function runs over and over again forever

void loop() {

  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(1000);                       // wait for a second

  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW

  delay(1000);                       // wait for a second

}

...Those bits that say '1000' you should change to '500' like this;

        // the loop function runs over and over again forever

         void loop() {

         digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)

         delay(500);                       // wait for a second

          digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW

          delay(500);                       // wait for a second

        }

Upload the new code and check the LED.  It should now be flashing twice as fast as before.  Congratulations, you're now a programmer!

Upload the Synth Code

Good stuff, we now know the Arduino is working, so we can upload the synth code.

Head over to my github page and download the zip file. Extract the file on your computer; we need the file called helios4_6.ino (Arduino uses .ino files).  Save it in a location you can find again on your computer (maybe in an documents/Arduino projects folder?).  

Then go to the Arduino IDE software File -> Open, choose the .ino file and it should load into the Aduino IDE window.  Now press the upload button...  the magic the code should upload to your Arduino Nano.  That's all we need to do the genie is now in the bottle.  Now we can start putting the synth together.

Code Explanation

There's a great explanation over on the Mozzi website about a simple sketch - it explains the basic setup of how everything works.  Also, because we installed the Mozzi library we can view lots of example code ->

Uploading midi code to arduino

The synth we are building started as one of these examples...  I think the first one used was a Mozzi-Midi-Input sketch.  Then combined that with an oscillator sketch.  Then added the filter sketch, envelopes etc.  Basically, all I've done is assign pots to commands in the code.  It might seem daunting at first, but if I can do it, there's a very good chance you can too.

If you're interested in learning more, each part of the code is explained elsewhere in the following links, as is building the synth on a temporary breadboard;

Part 1: Midi and Wave Switch

Part 2: Adding Envelopes

Part 3: Low Pass Filter

Part 4: LFO

...But you don't need to know any of this stuff to build the synth, although maybe in the future you might want to learn a little bit more (and help improve the code).

3. Electronics

Now we're going to put all the parts we ordered together... but we'll also quickly make the front panel (so we have something to hold the parts while we solder).  

If you can read a schematic, this next picture is everything you'll need (just be aware I'm using an Arduino Uno and not a Nano, so keep an eye out for any differences in pins).  You don't need to be able to read a schematic though as coming up we'll go through every step with pictures....

DIY synth schematic



Front Panel

I'm using a piece of plexiglas that's 12cm by 25cm but you can use anything you can find, although I'd recommend something no thicker than 3mm, as you'll start running into trouble screwing the parts in.  

DIY synth panel

Panel Layout

Follow how I've laid out the panel controls as it'll simplify the wiring later, but if you're confident enough then feel free to move it around to however you desire.

If you have a laser engraver you can download the dxf file here, if not you can drill the holes in the approximate locations.  Don't worry about adding the text colouring, or even removing the protective film, we'll do all that later.

**Update** 
More about laser engravingFor the design I used the free software by Schaeffer AG, so if you wanted to change anything (font size, layout etc), download that. To burn it I used 'Ben-box' software. Also, the front panel is 12x25cm, and I think I made the .dxf file 13 x 26, so you get a panel outline that you can use as a reference to keep everything straight (without the outline touching the panel). I always tape down a bit of cardboard, run a faster test burn onto that, then place the perspex sheet on top of this for the reference.


DIY synth panel drilling

Drilling the Panel

If you're using plexiglas, start with a smaller drill bit and work your way up to the correct part size, otherwise you can crack the board + there's less chance of the bit slipping and scratching the panel.

Drill bit sizes;

Switch:         6mm
Pots             7mm
Midi:            16mm
Midi Screw   3mm
Screw holes to attach to wood: 3mm (my screw size anyway, see what ones you can find and measure the bolt thickness)

You may have to remove the tabs from the pots;




Now we've completed drilling you can screw in all the components;




Then the back panel will look like this;

DIY synth back panel

Start Soldering

Let's add some resistors first. Make sure you add the correct resister to the pots (100, 220, 270 etc).  Wrap one end of the resistor around the leg of the pot, squeeze with the pliers to bend it in place then solder it to the pot. trim the excess, but don't trim the other side of the resistor...  we'll need those to make connections in a bit:

Info: Ohm my god! Resisters resist the flow of electricity using a measurement called 'Ohms': Think of them as like rocks in a stream, with the higher the number, the more of the amount the water is slowed down. 

DIY synth panel build guide 1
Tip: The colour of the wire doesn't matter, it's only used to tell it apart from others.

Now join some of the resistors using the unused legs.  When the two legs meet, twist them together, then solder them:

DIY synth panel build guide 2
Now we use our wire to join together some of the pots.  The pots have two ways to join with the wire...  you can push it through the hole (assuming your pot has one), or bend the wire around the leg.  It can be a bit tricky, especially when there is more than one connection at one point, but with a bit of patience you'll get there:

DIY synth panel build guide 3
and now add a few more....

DIY synth panel build guide 4

A quick test (if you have a multi-meter)...

At this point it would be a good time to grab the multi-meter and set it to continuity mode - probably shown as a speaker on the multi-meter panel (the mode where it beeps when you put the connectors together).  

Check your connections:  Hold one multi-meter connector to the solder on the Volume pot, and the other to the resonance pot solder joint.  If there's a good connection it should beep.  If not re-flow the solder and try again.  

The next check: Keep one connector on the volume pot leg, and move the other near the frequency pot... put it on the other-side of the resistor (the one that has the 3 connections). You won't get a beep if you test between the Freq pot and the resistor, as the resistor resists the signal.  Test on the other side.  The other side should beep, meaning there's a good connection. Maybe this picture will clarify things;   

The green areas will beep, but not the red.

Info: Resistors in a circuit that's soldered can't be checked with the continuity function on a multimeter - they block the signal path - you can only check unobstructed wires. Also, you can use a multi-meter to read how much resistance a resistor has, but again you lose this ability once it's been added/soldered to a circuit.

One last check: Now move the multi-meter connector to the switch, then midi port.  If it doesn't beep you might not have joined it correctly -> check for any obvious problems, or try and re-solder the joints. Check your multi-meter is working by pressing its connectors together.  Throughout making the synth you can perform checks like this, just remember if a part is in the way it breaks the signal.

Back to Soldering

Time to solder some more wires. These next two wires we won't connect to anything yet...  they'll connect to the proto-board once we build that section.  Be sure to leave the wires long enough that we'll be able to join to the proto-board without problem.  Say about 20cm each (you can always trim them down later):

DIY synth panel build guide 5

Now solder the next wires (again leave 20cm of wire on the one cable that isn't joined to anything).  If you have a multimeter, check the Vol to Audio Jack.  Then hold a connector to the two connections side of the resistor of the 'res', and see if you get a beep at freq, dky, atk, the switches and the middle of the Amt/Rate.
DIY synth panel build guide 6
The final part of the back panel, all of these wires will connect to the proto-board, so leave at least 20cm of wire free on each wire for that:

DIY synth panel build guide 7

Making the proto-board:

You might need to solder the legs to the Arduino if they didn't come pre-installed.  Once in place, put the Arduino on the proto-board like this, with the pins going into 'G' and 'M', and running from 01 to 15 (notice the USB port hangs over the edge).  If your proto-board doesn't have letters/numbers write them on with a pen, and make it match with the below image. 

Arduino nano board

Now flip it over and solder all the legs to the board (the helping hands tool can come in handy here, or if not use a bit of tape to hold the Arduino down).  Start with the corners to hold it into place.  Make sure you don't accidentally solder any of the legs together:

solder the nano


Once soldered, using the multi-meter in continuity mode, check that none of the legs have accidentally been soldered together (put each multi-meter connector on the legs next to each-other and make sure there's no beep).  If you hear a beep you may need to use a solder sucker to remove the excess solder.  Sometimes the solder can get so close it looks like it's touching the other leg but it actually isn't.

Check arduino nano connections



Here's how the board should look from the top:
  
Synth build guide 1



The bottom of the board when soldered

Synth build guide 2

Audio Out Section

This part lets you output audio from the little Arduino unit. We add resistor/capacitor combination to reduce noise from the output; without them it would have a lot of digital hiss. Technically we're adding an analogue filter... the most simple analog filter in existence, but an analogue filter none the less.  So if any synth snobs turn their nose up at our little synth you can scream at them how 'warm' it sounds.

First we add a 270 ohm resistor, look carefully at the picture, the legs go into F04 and C04:

Synth build guide 3

And solder it underneath, joining to pin D9 of the Arduino Nano (I'd bend the resistor leg over to the nano pin, solder, then trim the excess):

Synth build guide 4



Now add the 0.1uf (100nf) Capacitor (it looks a bit like a well fed tick):

Synth build guide 5

To save on solder I use the legs of the capacitors/resistors to jump to different parts of the board.  So with this capacitor, the leg that comes through A7, I bend down to A12 and solder into place. Then from A12, use a previously cut leg to jump to G12.  You can hold down the previously cut leg with pliers as you solder it (otherwise you'll burn your fingers).

proto board leg jump example
Using the legs to jump to different areas

Under the board after adding the capacitor.  Here you can see how the legs are used to jump to different points (shown in the below diagrams as the 'thinner line' between solder points):

Synth build guide 6

We still need to connect this to the panel components, but we'll do after we finish adding parts to the board.

The MIDI circuit

This part lets our synth be controlled by external MIDI keyboards.

First we add a switch.  This is added so we can upload new code to our synth (for any future firmware updates etc).  The switch disconnects the Arduino from any random MIDI signals, meaning our code can be uploaded without interference. Once built, if you find you can't control the synth try changing the switch position!

Synth build guide MIDI circuit 1


The three legs of the switch go into E, D, and C 14. There's no wrong way around.  If your switch leg is long enough, you can bend it over to the Nano RX pin.  I think from now on you'll be able to tell when you should do this, so I won't keep telling you.

Underneath the board will now look like this:

Synth build guide MIDI circuit 2


Now we add the 6n138 chip.  At the top of the chip you'll see an 'o' or notch indicating which way the chip needs to be placed (it's the top left in the below picture).  This is very important, so make sure you place it the correct way!

Synth build guide MIDI circuit 3

The bottom of the board with the 6n138 added:

Synth build guide MIDI circuit 4


Now let's add a 270 ohm resistor between R6 and R8.  The problem we have here is there's not enough room between the pins to lay the resistor down flat, so we'll have to solder it standing up:

Stand up resister

Easy right?  Your board should now look like this:

Synth build guide MIDI circuit 5



Underneath we join the resistor to the nearest pins:

Synth build guide MIDI circuit 6



Now let's join the center of the switch to the 6n138.  Because the distance is quite great, we'll use some wire to link the two;

Synth build guide MIDI circuit 7




Then we solder the points together;

Synth build guide MIDI circuit 8



Now let's add the 1N914 diode.  Diodes let the current flow one way and not the other, so it's important we install this the correct way around.  Luckily for us diodes have a black line to indicate where they should face, so pay attention to the diagram. We'll install into pins W7 and W8, with the black line on W7.  you'll notice these pins are close together, but luckily Diodes are smaller than resistors, so with a bit of bending of the legs you should be able to get it into place without having to stand it up;

Synth build guide MIDI circuit 9




Now join the diode pins to the chip;

Synth build guide MIDI circuit 10



Now we add a 220 ohm resistor to X7 and X11:

Synth build guide MIDI circuit 11




Bottom view after adding the resistor (X7 joins to W7, while X11 will be used later to join to the front panel):

Synth build guide MIDI circuit 12



The board is almost finished, just a few more wires to add now.  We'll run a wire from Q6 to  N12;

Synth build guide MIDI circuit 12

And then solder it together;

Synth build guide MIDI circuit 13



Another wire from R9 to N14:

Synth build guide MIDI circuit 14

Solder them in place:

Synth build guide MIDI circuit 15


And that, I think, is the board finished.

Joining The Front Panel to the Proto-Board

Now we'll join the two parts together and then we should have a working synth.

First we'll join the cable from the Volume pot:

DIY Synth build guide panel connections 1
Which goes into A3:

DIY Synth build guide panel connections 2

Then you solder it:

DIY Synth build guide panel connections 3


Now we'll go for the right MIDI cable;

DIY Synth build guide panel connections 4
Which goes into X12:

DIY Synth build guide panel connections 5


And gets soldered:

DIY Synth build guide panel connections 6


Now for the left hand MIDI connector:

DIY Synth build guide panel connections 7
...Which goes into W9.  Careful where you solder here, I admit I could've laid out the board better, but that would require foresight (which I failed to predict).

DIY Synth build guide panel connections 8


..solder it in place - make sure you get the correct pin soldered (look closely on the board for the direction of the connection:

DIY Synth build guide panel connections 9




Now we'll connect the spare red wire that's been hanging around.  This will give our board 5 volts of power:

DIY Synth build guide panel connections 10

That plugs in O12:

DIY Synth build guide panel connections 11


Then gets soldered to the 5 volt connection:

DIY Synth build guide panel connections 12



Now we have a couple of black wires that still need to be connected.  These join our synth to ground (0v).

DIY Synth build guide panel connections 13
Because these wires do the same thing it doesn't matter which is connected where, as long as one goes into P14 and the other O14:

DIY Synth build guide panel connections 14

Nerd Info: The reason for two wires even though they do the same thing is because one goes to the headphone jack, and we want to keep that free from other electrical noise as much as possible...  When I was prototyping the synth it would pick up a 'clicking' sound from (possibly) the 6n138. The second wire reduced this so I've kept it in the design.

Now solder the two new wires to the ground connection:
DIY Synth build guide panel connections 15

OK, so we're almost finished (the second time I've said that now) we just have a few wires from the pots left to solder.

These will connect to the analogue pins on the Arduino (written on the board as A0, A1, A2 etc), shown here;

DIY Synth build guide panel connections 16

We shall be using pins: A0, A1, A2, A3, A4 and A5.  Why not A6 and A7 you may ask, well...

Idiot alert:
I've just noticed a difference from the Arduino Nano and the Arduino Uno, despite being smaller, the Nano has two extra analogue pins.  That means, if I wasn't so stupid, we could've had two extra pots on our synth (full ADSR or something).  Oh well, maybe in the future, although you could look on the bright side and think we've saved some money + less work. No? I'll get my jacket...

DIY Synth build guide panel connections 17
A0 = LFO Amount
A1 = LFO Rate
A2 = Filter Cutoff Freq
A3 = Filter Resonance
A4 = Envelope Decay/Release
A5 = Envelope Attack

Here's a simplified board view with these connections added:

DIY Synth build guide panel connections 18

Connected underneath;

DIY Synth build guide panel connections 19


And with that we're finished we only have the switches left to go;

We're nearly Finished (This time I promise)

Ok, I forgot to get you to wire up the switches. Then we're finished.  I promise.  Let's do that now.  



We'll start with the LFO switch;

DIY Synth build guide panel connections 20

This wire connects to F10:

DIY Synth build guide panel connections 21



...and is soldered against the nano pin:

DIY Synth build guide panel connections 22


Now for the Wave Switch:

DIY Synth build guide panel connections 23
Put the wire into F11:

DIY Synth build guide panel connections 24

And then then solder to the nano pin:

DIY Synth build guide panel connections 25



Back view of synth
Back view of synth - spaghetti junction!

Finished view of the proto-board (Note: wire colors don't match examples)

Your board should look a little like this (Note: might not exactly match examples)




Now go get a beer.

Right, the synth is now complete - time now to give it a try.  Is it working?  Congratulations! Time for another beer.  It's not working?  Time to for some problem solving;

Troubleshooting Guide

Just remember that every part used is a potential problem waiting to spoil your fun, but hopefully we're going to get to the bottom of any faults.  Lets break different problems down into categories;

1. Code: 

The code definitely works (other people have confirmed this).  Did you check the 'blink' sketch is working on your Arduino (the one where a light flashes on and off)?  If not go back & read the code section of this guide again and get that working.  

The switch is set incorrectly: Now that your synth is soldered, you maybe have to change the switch position (the one found on the proto-board) to get it to upload.  From memory I believe the switch has to be pointing away from the nano to upload code, and closer to the nano to play the MIDI keyboard.  Try reversing this if it's still not working.  

Once the blink sketch is working, you can be fairly certain the problem isn't with the Arduino.  

The only other problem you might have if you copy and paste the synth code and either you miss some of it, or your browser adds some extra (unseen) characters.  Download the .ino file from my github (download everything as a zip).  Then open the .ino file directly with the Arduino IDE.  Once it's confirmed its uploaded OK, you can be pretty sure the code/Arduino are working correctly.

 A few people have had problems with the midi switch. If you have a multimeter check for continuity on the switch legs. Only two pins should beep and one shouldn't. If all 3 beep that's the problem. If you don't have a multimeter you could desolder the switch and join the two connections closest to the Arduino.

2. MIDI connection

The proto-board switch is set correctly.  You're playing the synth with a MIDI keyboard.  Have you used this keyboard before and can confirm it works?  How about the MIDI cable?  And is it plugged in correctly?  From the keyboard it should leave from the MIDI-OUT port and go into the DIY synth (which is MIDI-IN).

3. Power

You need to plug in the synth with the USB cable.  Plug it into a mobile phone power supply, or maybe a laptop port (these can add noise to the audio).  The Arduino should have a red power LED that lights up.

4. Is the Volume turned up/down?

It seems simple, but it has caught me out before!  Also, there's a chance I've made you solder the volume pot in reverse, so maybe try turning it all the way down just in case.

5. There's a problem with this guide:

While I've tried really hard to write everything down without errors, it's entirely possible I've missed something.  If you're having a problem leave a comment and I can update the guide with any fixes.  Also leave a comment if you notice any mistakes.  Thanks.

6. You've done something wrong:

Along with me making a mistake with the guide, this is probably the most likely cause for problems.  We've made a lot of connections with the solder, and just one mistake could stop the whole thing.  Check the following;

Dry Solder: Sometimes there can be 'dry' solder connections, where the part is connected but not really.  You could try re-soldering/re-flowing these connections, or use a multi-meter in continuity mode to confirm they are good. 

Accidental joins: It's possible some pins have accidentally been bridged while soldering.  Again, use a multi-meter to check and de-solder any problems.  

You've used different parts:  If you know what you're doing then that's fine, but if you've used different parts without really knowing what they do, then this may have caused a problem.  If you've used an Arduino Uno instead of a Nano, be aware the pins are in different places on the board (TX and RX pin I believe).

The Diode is the wrong way: Check the black line is facing the correct direction.  The diode needs to face the correct way to work (while the resistors and capacitor we used on the board will work in either direction, known as having no 'polarity').

You've joined the wrong wires:  Check check check!  Look through the guide and confirm everything is correct.

The Audio jack isn't wired correctly: Check!

The LED light on the the Arduino Nano is showing midi is being sent, but I'm not getting Audio:  If I had to guess it might be you've wired the audio pot wrong (or I've told you to do something wrong; other people have reported back success so hopefully not). If the midi light is lighting when you're pressing keys, then that part would appear to be working. Start with the simple things first: try turning the volume pot at different levels while playing the keys. Try this with all the knobs and buttons just to be sure. If that doesn't work, double check your connections around pin 9 of the Arduino nano... it should lead to a resistor and capacitor - this is where the audio leaves the Nano, then it goes to the volume pot, then to the audio jack. If you can't see a problem there then it's time to check the audio jack... the most likely candidate. Are the wires correct? Perhaps they need reversing? Are the jack connections the same in the photos? Perhaps the jack has been screwed in upside down (ie so the top leg is now bottom etc). Hopefully you'll find the problem. If you have a multi-meter you can check in continuity mode (the buzzer mode) that the bottom audio jack pin is going to ground... put one connector on the bottom jack, then the other connector on the Arduino nano pin that says 'gnd'. Hopefully it should beep. 

7. There's a fault with one of your parts:

Maybe you left the soldering iron too close to a part for too long?  I've never had it happen, but if you think you've mangled the soldering then look for burnt parts.  Perhaps it was never working in the first place?  While it's possible, it's also quite rare, even for dirt cheap parts.  It's far more likely you've made a mistake somewhere else.  If you've checked everything else is ok, you could start swapping out parts, or start checking voltages etc with the multi-meter.  If you don't know how to do this, there are no doubt good YouTube videos/guides for you to learn from.  You could also get into synth repair through this route, so while it's frustrating your synth isn't yet working, you are at least learning some new skills.

8. Wiggle

Try wiggling the wires to see if it suddenly starts working.  That's the sign of a bad connection somewhere, or possibly a break in the wire.

9. Find a friend

If all else fails find someone else to help you fix it.  If you don't know anyone personally you could try a local hack-space or friendly University department.  If they know a little about electronics, you'll probably only have to show them the hand drawn schematic found at the top of this guide.

10. Try Running The Test Code

Tom Reid very nicely commented that he'd written some code to check the connections of the synth (copy & upload the blue code text into the Arduino IDE, and also open the serial monitor to view the results);

Great project and works well. I did knock together a short test program which checks all the switches and Pots. It gives an IDE monitor display so you can see the states and voltage. If you want a copy to post then you are more than welcome to post it.

Apologies for the delay - I need to add some comments into the code. Here is the code The test program checks the 2 switches and 6 controls. Also it generates a tone on the output socket. Compilied on IDE 1.8.42

>>>>>>>

/*
Test program for checking Pots, switches and Audio circuit

The program is designed to read the 6 volume controls and the 2 switches(LFO/WAV).

Yes I could have down this program cleaner with FOR loops, arrays etc - but it is only test program and took 20 minutes to knock up

Please feel to modify and improve on it.

Key elements the tester output will show on the monitor display

Note make sure switch is set to LOAD.

Switches
Wave Switch select0 Sq or Saw
LFO Switch select0 ON or OFF

Pots - set all Pots fully counter clockwise looking straight on to front panel

LFO RATE - Rate- clockwise increase volatage
LFO Rate - Amount - clockwies Voltage decreases

Filter-- Cutoff - clockwies Voltage decreases
Filter-- Res - clockwies Voltage increases

Envekope - Attack - clockwies Voltage decreases
Envelope - Release - Filter- clockwies Voltage increases


Audio output generates a Signal every

*/
//#include

float Volt0; // LFO Amount
float Volt1; // LFO Rate
float Volt2; // Filter cutoff
float Volt3; // Filter Res
float Volt4; // Envelope Release
float Volt5; // Envelope Attack


//wiring pins defined for the NANO version

int LFO;
int WAV;
int LFOPin = 3;
int WAVPin = 2;


void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);

pinMode(LFOPin, INPUT);
pinMode(WAVPin, INPUT);


pinMode(9,OUTPUT);

}

// the loop routine runs over and over again forever:

void loop()
{
// read the input on analog pin 0-5:

Volt0 = analogRead(A0);
Volt1 = analogRead(A1);
Volt2 = analogRead(A2);
Volt3 = analogRead(A3);
Volt4 = analogRead(A4);
Volt5 = analogRead(A5);

// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):

Volt0 = Volt0 * (5.0 / 1023.0); //LFO amount
Volt1 = Volt1 * (5.0 / 1023.0); // LFO Rate
Volt2 = Volt2 * (5.0 / 1023.0); //Filter Cutoff
Volt3 = Volt3 * (5.0 / 1023.0); //Filter Res
Volt4 = Volt4 * (5.0 / 1023.0); // Envelope Release
Volt5 = Volt5 * (5.0 / 1023.0); // Envelope Attack

LFO = digitalRead(LFOPin); // on/oFF
WAV = digitalRead(WAVPin); // Square or Saw wave

// print out the value
Serial.println(" LFO SW WAV SW LFO Rate LFO Amt Filter Cutoff Filter Res Env Rel Env Attack");

//Print switches

if ( LFO == 0) {
Serial.print(" OFF ");
}
else
{ Serial.print(" ON ");
}

if ( WAV == 0) {
Serial.print("SQR ");
}
else
{ Serial.print("SAW ");
}

Serial.print(Volt1);
Serial.print(" ");
Serial.print(Volt0);
Serial.print(" ");
Serial.print(Volt2);
Serial.print(" ");
Serial.print(Volt3);
Serial.print(" ");
Serial.print(Volt4);
Serial.print(" ");
Serial.print(Volt5);

Serial.println();
Serial.println();

tone(9,50,1000); //sound tone for short burst.-

delay(2000); // 2 seoond update on screen


// No test routing for the MIDI at this time - easy wiring so easy to troubleshoot

}


All good?

Hopefully you should have the synth up and running by now.  If not, check the comments to see if any common problems have started to emerge.  I'll try and help where I can, but obviously my time is limited.

4. Making a Case

DIY Synth case making guide 1


You can make a case out of anything (VHS box!), but this is how I do it:

The wood used: mine cost 3 Euros from an arts supply shop in Berlin. It measures 9.0 x 250 x 500 mm.  The same shop also sold perspex sheets for the front panel for 2 euros.  These sheets measure 3 mm, 3.0 x 120 x 250 mm.  Notice both the wood and perspex feature a 250mm measurement.  This means if we cut the wood correctly it will already have a length exactly the same as the panel.  This can save you some sawing, and you can also use the professionally cut sides at the front for a neater appearance (save your hack-saw work for the back!).  If you don't have access to these supplies, I'm sure you can come up with you own method.

I used a laser engraver for the panel text, but if you don't have one no worries, you could use a silver marker pen, or a label printer.  Other things you might need are wood glue and a saw.  Some screws to join the panel to the wood.  All things you should be able to get at a hardware store (or pay 3 times the price at an art supplies store).

Knobs: There are loads of types to choose from, here's a Moog-style pack of ten for under 2 euros. Or some Dave Smith types for 1.40e.

Ok, lets make the case:

DIY Synth case making guide demensions

The longer parts of wood are 25cm (250mm - the exact same size as the perspex width).  Then we have the ends, remember, as well as the 12cm width of the front panel we also need to cover the two long bits of wood - these are 9mm each;

12cm + 9mm + 9mm = 13.8cm

Tip: Depending how good you are with a saw, I'd cut each part 14cm long and then be prepared to sand down the excess.  

Depth:  I used 7cm as the depth of the wood.  The nano and proto-board are about 5cm, so by using 7cm we give ourselves some room.

So you should now have wood like this:

DIY Synth case making guide wood panels

If you have the same wood skills as me, you'll probably have a few rough edges.  You can use sanding paper or nail files to correct this:

DIY Synth case making guide rough edges

DIY Synth case making guide sand edges

Putting it all together:

We'll need wood glue.  Remove all the components from the front panel and lay it down flat (or if you don't want to take the parts out: lay down four books and balance the panel in the middle, so it lays flat with the knobs hanging freely in the middle).  

Stand the wooden sides around it and glue them together.  You want a good fit where the panel meets the wood, so either hold it in place or use string and tie it together.  Wood glue dries pretty quickly (5 - 10 min), so you won't get too bored.  Think of it as birthing the synth.

Tip: You can buy a strap spanner to hold the wood tightly together for you, but it's a luxury item that you can do without.


DIY Synth case glueing case together


Wipe away any excess glue (especially on the outside, where it can effect varnishing the wood).  Now we cut a strip of 1cm-ish squared wood, cut into four 6cm pieces:

Tip: You can buy precut 1cm x 1cm wood from the store

DIY Synth build case glued

Glue each of these pieces to the corners, making a good connection with the wood and also the front panel (these are where we'll screw in our synth panel):

DIY Synth build edge parts

When finished our case should look like this:

Tip: If you find the center of the perspex a little wobbly when playing the synth you can glue another 1cm piece to the center top or bottom of the case.  Do this after you've finished so you don't get in the way of components.

Wipe away the excess glue.

Our case should now look like this:

DIY Synth build finished case making


Sand down any over-hanging edges if you like, or any glue that has leaked out.

The synth could be finished if you want to keep the wood looking natural, if not we can remove the panel and start to stain it.

I use a Mahogany stain like this;


The wood is thirsty, so you'll need maybe 3 or 4 coats.  Add each layer evenly.

wood stain for DIY synths 1

wood stain for DIY synths 2

Stained wood synth panel case

Eventually it'll turn a colour you're happy with: 

Finished stained wood synth case

I also varnish the wood with a lacquer which gives it some protection and a bit of shine.  You don't need to do this, but you can.

DIY Synth wood varnish guide

Apply a small amount with an old rag and finely distribute:

DIY Synth wood varnish guide 2


DIY Synth wood varnish guide 3


Leave to dry overnight and we're finished with the case!

DIY Synth wood varnish guide - leave to dry


Add the front panel.  Drill the screw holes if you haven't already, using the smallest drill bit and slowly working up to a size 3 bit (or however large your screw holes need to be).  Work your way up slowly otherwise the perspex will crack.

synth panel drilling

If you've lazered the text, you can fill it in with acrylic paint, then wipe away the excess:

diy synth case panel text

synth panel painting

rub away excessive paint


Then peel away the protective film:

Helios one arduino synth

Tip: If you've missed some paint on the panel (like I have in the above picture on the LFO switch), you can still paint on the perspex, but just be aware it scratches easier this way.



To tidy up the back, you could use some cable-ties and then screw down the broad. If you screw down the board, make sure the screws aren't too long... either they'll go through the wood, or more annoyingly, leave bumps.

Cable ties added.  Still a bit of a mess!




If you want a back cover you could cut some mdf board and screw it to the back.  Mdf is an irritant to the lungs (possibly cancerous?), so wear a mask then wipe down your working area. Drill a hole for the usb port.  You don't need a back cover (I probably won't bother for this build).



Attach the knobs and then finally we're finished.  This time for real!

Cheers.

A hand built DIY synth using arduino