Sunday, August 26, 2012

The Must Build Arduino Project - The Illutron B

Is there a must build Arduino project ? Something simple that can be built in minutes and tinkered with for days or weeks ?

There is now.

Presenting the Illutron B -

The Illutron B is a development of the Illutron synthesizer originally created by Nikolaj Mobius. All of the sound in the clip is being generated by the Arduino with no outside assistance or post processing - the bass notes are extraordinary.

Even more incredibly is that all of the sound is being generated using just one analog output.

How does it work ?
If you think of an analog output as a power switch, the longer it is switched on, the more power we output. By varying the duration that the power is on over time we can output a waveform, for example a sine wave.

Its a technique known as Direct Digital Synthesis. The is a good example here

Taking it further - Skip the theory if you like, or read on -
The Illutron B is a wave table synthesizer, this is a synthesizer which uses the Direct Digital Synthesis described above to generate sound waves using descriptions 'wave tables' that are stored in the memory. 

The wavetables are simply arrays, if you take the values from each of the wave header files and copy them into your favorite spreadsheet you will see the following - 

Synth designers know that as listeners we do not find endlessly repeating sine, square or triangle waves very interesting. To make the sound more musical wave table synthesizers combine the waveform with an envelope. 

The envelope describes the power or loudness of the waveform over time - think of a snare drum, its starts very powerfully and decays away to nothing very quickly - a flute can start softly, reach a level then decay softly - its the envelope that describes this. The simple trick of combining the wavetable with an envelope is responsible for the huge range of musical possibilities in wavetable synthesis.

How do we do this in software ? - It couldn't be easier, we mulitply the waveform by the envelope, as the envelope value gets smaller, so the output waveform shrinks away to nothing.

Have a look through the code, its extensively documented.

Built in envelopes - the faster the sound drops away, the more percussive (drum like) the envelope -

You can add your own envelopes, or modify the supplies ones, there is no rule that an envelop cannot start quietly and get louder - or look like a heart beat for a pulsing bass sound.

Build your own pocket night club -

How long does it take to build ? anywhere from 5 to 10 minutes, seriously, if you have two potentiometers a few capacitors and resistors you can be playing your own Illutron B in 10 minutes.

What does it do ?

While the synth is very powerful, Nikolaj has included a demonstration tune which is the basis of the clip.

In the clip I am using the Illutron B which provides control over the beats per minute and also the pitch of one of the four channels using just two potentiometers to jam with the demo tune.

This is where RCArduino comes in. When I first heard the Illutron I was blown away, it is far and away the best Arduino Audio project of all. The drum sounds are awesome, the bass is incredible, you will not get tired of exploring those low notes. I know that as a community we can make great things from this.

For this reason I have spent the past few days refactoring, optimizing and documenting the Illutron version B.

Some ideas for your own Illutron projects -

1) Hook up some peizo knock sensors for an electronic drum kit
2) Bass loop generator with push buttons for different bass drops
3) A four channel sequencer
4) Sound effects for games, installations and robots
5) Its a great basis for a Thermin or similar physical instrument.
6) Add some soft pots, cross faders or a stylus to control the pitch of the different channels

Nightclub in your pocket

My own idea is to build on the current example - Ideally I would like to see a set of beats or tunes included in a 'Night club in a box' where the user can select the beat with a push button. The user is then free to jam with the selection in the same manner as the video - Arduino, two potentiometers, one resistor, two capacitors, synched LED Light show and you have an instant pocket night club that everyone can enjoy.

In order to support the further development of Nikolaj's original concept I have refactored the original Illutron code into a more user friendly class library while at the same time taking the opportunity to do some optimizing and improve the readability of the code.

If you would prefer to use Nikolaj's original code for the Illutron Wave Table Synth, its available here -

The Illutron B code is being added to the Illutron repository on github I will provide a link once its uploaded,  in the meantime, you can get it from me - DuaneB on the Arduino forum.

If your a musician it should be immediately obvious how to setup and trigger the different voices, the sample sequencer is also easy to understand and modify. If like me you are not a musician, build one anyway, the demo tune is great to play with and I hope to get some new tunes included for you to upload.

Whats an Illutron ?

Its actually an art studio on a ship in Copenhagen harbour. The original Illutron synth was created by a member of the Illutron collective Nikolaj Mobius. You can find out more about Illutron and their work in light, sound, electronics and a surprising amount of fire here -

Building your own Illutron B - 

The easy part - 
2 * 10 K Potentiometers
4 * LEDs (or eight if you like)
4 * LED Current Limiting Resistors (500 to 1000 Ohms should be fine)

The only slightly less easy part -

Jelly Beans

What are Jelly Beans and why do I need them ?

Jelly Beans are those common components that all circuits need and you should have a jar full of. If your just starting out, you might not have these, but get some, they are very cheap standard components which are widely used in all sort of circuits.

1 * 2.2K resistor (or two 1K resistors in series - anything thats close)
1 * 0.1uF capacitor - you should have hundreds of these, they are used for stopping interference from other components from reaching the sensitive parts of your circuits, if you don't have any, buy 20, they are cheap and you will use them for everything.
1 * 100uf  capacitor - again these are widely used. In this case the capacitor is there to filter out a DC voltage so that your Audio equipment only receives the alternating signal part of the Arduino output. If you don't have any of these, get 10.

Here is the Schematic -

Note : The Fritzing software used to draw the circuit labels C2 with 0.1mF, this is the 100uf capacitor, 100uf is the most common way to represent this value but 0.1mf is also correct (1uf = 0.001mf so 100uf = 0.1mf)

You can also follow the original build instructions here -

Here is mine as used in the video. For the nightclub in a box project I will be adding two amplifiers based on the previous rcarduino post - Adding Audio To Arduino Projects -

The final part of the build to to plug the Illutron B into your MP3 Player docking station - I used a section of head phone cable soldered to a three pin header for this -

The code is now available for download on the RCArduino downloads page here -

If you have any problems with the download, contact me 'DuaneB' through the Arduino forum or leave a comment.

In a future post I will explore more of the capabilities of the Illutron B, the Illutron team will also be working on new Illutron synth based projects.

Stay tuned

Duane B


  1. hello,
    Why not put four buttons for each of the channels. This way you can select a single channel and tune it individuality.

  2. Hi,
    There is only one of me and I am not very musical so its better that I document the code for everyone else to build cool projects from. I will add some explanations and examples in the coming weeks - For myself I would like to build one with a stylophone type interface and a set of controls to manage the sequence and voices.

    If you want to code to build your own, PM Me - DuaneB - on the Arduino forum.

    Duane B

  3. Woah, I need two ! So, is the code done uploading on github ? Are you going to give away the URL ? ;)

  4. Send me your email address through the Arduino forum and i will send you a zip folder of the latest code. My username is Duane B

  5. What a great little project! Where is the forum through which I can send you my email for the code? Would very much like to try this funny thing myself.
    Thanks for sharing :-)

  6. Nice project, Where can I find your forum?, I would like to try this.

  7. Hi,
    If you send me your email address through the Arduino forum I will send you a zip of the files.

    The forum is here

    My user name is Duane B

  8. Hi
    - Do i need to build another RCfilter for a second output or oc0b?
    - What I want to try is select a waveform with a switch with 6 stands and play it whit a midi keyboard and use few pots for modulating the sound. I think it's possible but do I start with a cleen sheet and copy everything or with the demo or i don't know???
    It sounds really nice for shure in lower region.

  9. Hi,
    Yes you will need an additional RC Filter for the second output, the main reason to use the second output is to drive a second speaker. I found that as more channels were added, so they all started to average towards zero, one way around this is to split the channels and drive two separate outputs.

    Instead of using a switch, I would suggest you use another pot, it gives you ten positions on a single pin. Have a look at the Arduino Based Nebulophone, they have implemented switching and adjustment on single pots, for example you could select the waveform and the rate of decay by dividing the pot reading into 4 (for the waveform) and within each for you have 255 steps to control the duration.

    There are lots of options for how you could control and cross modulate the waveforms, but I am not sure that the Illutron B code is the best starting point for your project, have you had a look at this one which might be closer to what you want -

    Let me know what you think

    Duane B

  10. Hi Duane,

    Wonderful work. I am Sound Design student at Savannah College of Art and Design. My Sound Art professor and I are working on some projects with the Arduinos to hopefully implement into the course work for the undergrads sometime in the future. I'm very impressed with Nikolaj's beginnings and your advancements. I was hoping you still had the zip files available? I will message you on the on the Arduino forums as well.


  11. Hi,
    For anyone messaging me for code on the Arduino forum, please include your email address so that I can send you a zipped project folder.


    Duane B

  12. Hi,

    I was looking at playing with the original illutron synth code for my next project, but after seeing this post I'd like a look at your refactored code. Looking at the illutron github repo, I'm having a hard time seeing how to change things like tempo... Did you ever get it up on github, or should I still be creating an account on the forums to contact you that way?

  13. Hi,
    I need to come up with a better alternative, but for now, yes thats the way to contact me - DuaneB on the arduino forum.

    Duane B

  14. Hi Duane,
    I would appreciate if you could send me the code for your Illutron B project. My email is
    Thanks in advance

    1. Hi, You can test something for me, I have put a zip file of the code on google docs. To access the zip file, follow the link below, then look for the file menu at the top of the screen, open the file menu and select the download option. A popup should appear asking if you want to download the zip file. Let me know if it works for you. Link -

      Thanks Duane B

  15. This comment has been removed by the author.

  16. Hello Duane,
    the code give me an error:
    IllutronB.cpp:3:23: error: illutronB.h: No existe el fichero o el directorio.
    There is not illutronB.h file. After, I changed

    the line in the cpp file
    #include "illutronB.h" by #include "IllutronB.h"
    but now the first error is
    IllutronB.h:74: error: ‘uint8_t’ has not been declared

  17. Which Arduino Board are you using ?
    Which version of the Arduino software are you using ?


    1. Hi,
      sorry, the board is arduino uno and the compiler is 1.0.5.
      The Nikolaj's Illutron compiles ok:
      Arduino synth V4.1, Dzl/Illutron 2014

    2. I have just compiled the version from the downloads page using Arduino IDE Version 1.5.8

      If you upgrade your IDE and try this you should get a few error messages that look like this -

      error: variable 'Inv3' must be const in order to be put into read-only section by means of '__attribute__((progmem))' PROGMEM char Inv3[]=

      All you need to do is change the line

      PROGMEM char Inv3[]=


      PROGMEM const char Inv3[]=

      where ever this error crops up.

      I would change the file on the upload page but do not have access to other versions of the IDE at the moment to confirm there is no impact on older versions from this change.

      Let me know how you get on


    3. Hi,
      1) using the 1.5.8 IDE:
      In file included from IllutronB.cpp:3:0:
      illutronB.h:33:21: fatal error: arduino.h: No such file or directory

      2) using the 1.0.6 IDE the error is the same that 1.0.5:


      Compiles fine on 1.5.8 on Windows 8


    5. Thanks Duane,
      It willI be difficult to get a W8 but I will try it (it is because I uses only debian distro but i have a virtualized xp)

      I would like to add that the 1.5.8 IDE runs in debian properly the "blink" arduino example after a soft linking a library
      thanks again

    6. Hi, Have you tried on XP ? In an ideal world the OS that the compiler is running on should not make any difference, but in practice its different code streams that are probably maintained by different teams. If you try XP let me know how you get on.


    7. Hi Duane,
      the rar file from
      contains only an empty file. Please reload the file.

      thank you

    8. I have downloaded the file to check, its the correct archive with the correct contents. Can you try again.

      Duane B

  18. i couldnt understand what did you use for output ?can use a simple speaker

    1. There are two common approaches to Audio output from the Arduino

      1) Use an external amplifier that has a line in or Aux input.
      2) Build your own simple amplifier circuit.

      The circuit and video on this page is using approach 1 to connect to an ipod docking station.

      For approach 2, I usually use a simple amplifier circuit based on an LM386 Chip, here is an example -

      Duane B

    2. thank you but we have a problem about pot varying we couldnt get any changes on sound is there any mistake on coding?

    3. My guess is that your using the original Illutron code which does not take any inputs. You should download the version from the downloads page here -

      Duane B

    4. i downloaded this version like you said do you have any other suggestion?

    5. Which Arduino are you using and check you circuit, 9 times out of 10 its the circuit.


    6. We used arduino uno we didnt do any change on code and applied the schematic thats given

    7. What happens when you run the code, does the circuit generate sound at all ? does the sound change at all ?


  19. This comment has been removed by the author.

  20. Hi Duane, thanks for your work on this, it's a lot of fun! I've noticed that changing the value for "mod" doesn't seem to have a noticeable effect-- is there something I need to uncomment to make modulation work, or is it just subtle enough that it's difficult to hear?

  21. Hi Duane
    I get the following error if verify the script.
    do you know what is wrong?

    Arduino: 1.6.0 (Mac OS X), Board: "Arduino Uno"

    In file included from IllutronBDemo0_2.ino:32:0:
    sin256.h:4:23: error: variable 'SinTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char SinTable[]=
    In file included from IllutronBDemo0_2.ino:33:0:
    ramp256.h:4:24: error: variable 'RampTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char RampTable[]=
    In file included from IllutronBDemo0_2.ino:34:0:
    saw256.h:4:23: error: variable 'SawTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char SawTable[]=
    In file included from IllutronBDemo0_2.ino:35:0:
    square256.h:4:27: error: variable 'SquareTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char SquareTable[]=
    In file included from IllutronBDemo0_2.ino:36:0:
    noise256.h:4:25: error: variable 'NoiseTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char NoiseTable[]=
    In file included from IllutronBDemo0_2.ino:37:0:
    tria256.h:4:28: error: variable 'TriangleTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char TriangleTable[]=
    In file included from IllutronBDemo0_2.ino:40:0:
    env0.h:4:19: error: variable 'Env0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Env0[]=
    env0.h:264:19: error: variable 'Inv0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Inv0[]=
    In file included from IllutronBDemo0_2.ino:41:0:
    env1.h:4:19: error: variable 'Env1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Env1[]=
    env1.h:264:19: error: variable 'Inv1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Inv1[]=
    In file included from IllutronBDemo0_2.ino:42:0:
    env2.h:4:19: error: variable 'Env2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Env2[]=
    env2.h:264:19: error: variable 'Inv2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Inv2[]=
    In file included from IllutronBDemo0_2.ino:43:0:
    env3.h:4:19: error: variable 'Env3' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Env3[]=
    env3.h:264:19: error: variable 'Inv3' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
    PROGMEM char Inv3[]=
    Error compiling.

    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.

  22. PROGMEM const char Inv3[]=
    but now the sound is very low (i directly connected an old laptop speaker), so I think I need a amplifier...

  23. amplifier works, but the potmeters do not seem to have any influence. any ideas here?

    1. Which potentiometers the one on the amplifier or the ones on the Illutron B Arduino inputs ?

      If its the inputs, did they work before you connected the amplifier ?


  24. no, the potentiometers never have worked.

  25. they are connected to A0 and A1, but I can not find A0/A1 in the program lines.....

    1. If your using the files from the download link,

      you should see -

      #define PLAY_BACK_BPM_PIN 0 // analog pin 0
      #define PITCH_PIN 1 // analog pin 1

      if your pots still dont work, write a small test sketch that reads the pots and writes the values to serial just to make sure your pots are good.


  26. can anyone plz provide me the "towerpro mg995 servo motor" arduino interface code

    1. example code given with arduino software is not working with mg995
      its only working with futaba s3003

    2. Start here -


  27. I built the IllutronB, there is a beat running, though my pots A0 and A1 have no influence on the circuit?. Is it also absolutely necessary to have an op amp with this circuit. or can my jack go right to a small speaker?. Thanks!

  28. I also wrote a small test sketch to see if my pots are working and they are. All seems to be in place and functioning, though the pots still have no effect on varying the sound. Please help. Anyone.. Thank you.

  29. The LM386 is not an op-amp but a basic audio amplifier. Its a cheap and simple way to generate enough power to drive a standalone speaker while protecting your Arduino. More here -

    Alternatively you can use the simple output circuit to drive a speaker through any existing audio amp that you have.

    As for your pots, are you running the code from the downloads page of this blog, if not, your pots are not going to do anything


  30. Hello, I would really appreciate some help!
    How difficult it is to make this WONDERFUL synth+sequencer work in Arduino Mega? I have 0 knowledge of programming the registries of the Arduino. Is there like a table or guideline with the different names so that I could change the library? Is that possible at all?
    Thanks a lot in advance!

  31. Thanks for sharing the article.....worth a read..!!

  32. thank you for sharing the project and the video....i will definately start working on it.

  33. cooll.., visite me broo,

  34. cooll.., visite me broo,