EmozziđŸ¶

WIP ALERT! This project is currently in development, but this page is written as if it were ready for consumption, which it isn’t. Images might be out of sync with Rev 2.

EmozziđŸ¶ is a little board meant to experiment with the Mozzi library on the Arduino Nano, for use in Eurorack and similar synths. You can use it to create oscillators and other programs that make a digital racket!

The front of the PCB, with an Arduino Nano, a pair of pots and buttons, and a bunch more stuff
The back of the PCB, with a bunch of SMD components

You can mount pots, buttons and jacks directly on the boards. Once you come up with a design you like, you can use the schematic to figure out how to make a simplified version that fits your circuit.
Alternatively, you can use the boards directly in your final build, by running wires to the faceplate.

Like the Mozzi library itself, they’re for non-commercial use only.

EmozziđŸ¶ is an independent project, it is not affiliated to Mozzi.

Demo

YouTube video mirror

Features

Adopt your own EmozziđŸ¶!

I don’t sell stuff at this time, so I have none to offer. You will have to order the PCBs and source components yourself.

You have two choices:

Remember: non-commercial. Doing a group buy is fair, but buying a bunch and selling them for profit will get your shop shut down real quick.

Ordering from JLCPCB

Once again: JLCPCB isn’t the only provider around. I get no commission from mentioning them. I chose them because they take care of collecting European import duties, which makes them cheaper for me in France, but not necessarily cheaper for you. The SMD components are all generic parts you can source from any vendor. Shop around!

Still, assuming you do want to order from JLCPCB, here’s how to go about using the order form. Prices vary daily, but I had 5 EmozziđŸ¶ boards shipped to France for 24 French Dollars with those kinda settings.

Bill of Materials

QtyDesignationNotes
1EmozziđŸ¶ BoardWith the SMD parts already soldered. Use the KiCad project if you need a detailed SMD BOM.
1Arduino Nano (ATmega328P)Get a clone off Aliexpress, they’re just as good for 1/8th the price. Official boards are a tourist trap! Get one with the pin headers already soldered and make sure you don’t get a less powerful ATmega168P.
1MCP4725 Breakout BoardOptional. Get a clone of the Sparkfun board from Aliexpress, just check the pinout is correct. Only necessary if you wish to output precise DC voltages.
110-pin shrouded headerOr unshrouded if you do not know fear.
9PJ301M-12 or P518M “Thonkiconn”-style jacksOptional, to mount on the board. Can use different types of jacks for panel mounting.
23K9 ±0.5% ResistorMust be precise within 0.5%! To use more common values, you can use a 4K7 and a 22K resistor measured to be within 0.5% of 3K9.
1499K ±0.5% ResistorMust be precise within 0.5%! To use more common values, you can use a pair of 1M resistors measured to be within 0.5% of 499K.
8B100K Alpha RD901F Linear PotOptional, to mount on the board. Can substitute for generic clones and use other values, just keep it linear (B prefix). Can use other types of pots for panel mounting.
1B100K 6mm TrimmerCan use other values safely, but physical size must match.
86mm tactile pushbuttonsOptional, to mount on the board. NC and NO pushbuttons work, adapt the code to match. Can use other types of pushbuttons or toggle switches for panel mounting.
1H11L1 Opto-isolatorOptional, if you want a MIDI In circuit.
LotsaPin HeadersYou’ll have to snap them to size!
BunchaPin SocketsYou’ll have to cut them to size!

Usage

Behold! The cursed footprint

What shall you mount on it?

You can mount a pot, button, or jack on this footprint

It’s your life. Make your own decisions. Live with the consequences.

Populating the board with thingies

STOP! Think twice how you wish to use your board before you add stuff to it. You have options, but they’re mutually incompatible.

Also, we’ll assume the SMD components are already placed. If you plan to solder them yourself, you need no handholding anyway. Just pay attention that every unmarked diode is a 1N5819WS, except for D5, the lone 1N4148WS.

Okay, did you give it, like, 5+ seconds of real serious thought? Good, let’s yolo the build in this rough order:

Power Usage

Depends how you rig it up, obviously. In all cases, the current draw from the negative rail should be below 5mA, since it’s just the op amp using it. When just chillaxing, the minimum draw on the positive rail is about 25mA. In a common configuration, driving a few LEDs and doing signal processing stuff, budget for up to 60mA.

Handling the EmozziđŸ¶

Getting started with the Arduino

Is your problem :)

Nah, seriously, there’s a lot of good info out there, no need to hear it from me. The quality of the docs available is the whole point of using an Arduino instead of a more powerful board!
So grab a book. Or read some posts. Or even, if you must, go watch a video, if you’re into that kind of thing; I don’t juge (overtly—I judge silently).

You will want to do a pair of simple Arduino tutorials without external libraries or additional hardware before you try out the EmozziđŸ¶. Get LEDs to blink, servos to serve, capacitors to explode, things of that nature.

Tutorials will walk you through installing the Arduino IDE, but if you wanna get serious about MCU stuff, consider PlatformIO with VsCodium or VS Code.

You’ll want to figure out the Arduino API. It’s as simple as it gets: read pins, write pins, count things, access timers, that’s all there really is to it.

After that, you’re ready to try out Mozzi. Peep their examples: many can be run as-is on an EmozziđŸ¶ board, might just need to alter the pins used.

20 MHz will mega hurt

Making use of every input and output available isn’t gonna happen. The Arduino Nano is an heirloom antique. Just outputting a few waveforms will push the ATmega328 to its limits.

The cool thing about the ‘Duino is its ecosystem, it’s easy to find info about it and troubleshoot it. But for its price, you could get a lot more CPU muscle.

Accept the Nano as the underpowered board it is: keep the scope in check.

Use the latest Mozzi code in HIFI mode

You’ll want to install the Mozzi library, of course, but bear in mind, the stable version might be very old: as of 2023, the one in PlatformIO is 4 years old. Instead, you probably want to grab the master branch off their Github. It goes into lib/mozzi/ in your project.

But that’s not enough to put it there: you need to edit the code to activate HIFI mode. This board is built around that!

To change the mode, open the file lib/mozzi/mozzi_config.h. Near the top, you’ll see:

//#define AUDIO_MODE STANDARD
#define AUDIO_MODE STANDARD_PLUS
//#define AUDIO_MODE HIFI

Simply comment back STANDARD_PLUS and uncomment HIFI:

//#define AUDIO_MODE STANDARD
//#define AUDIO_MODE STANDARD_PLUS
#define AUDIO_MODE HIFI

Use the latest bootloader or don’t

There exists two different ATmega328P bootloaders. It’s very important not to understand the difference between them as it doesn’t matter a single bit which you have. Just know that if your code won’t upload with one bootloader, you should try swapping for the other.
In the official IDE, the option hides in the Tool > Processor menu.
In PlatformIO, open platformio.ini and replace both mentions of nanoatmega328 for nanoatmega328new, or the other way around.

Inputs and outputs are just suggestions

Arduino Pins can be configured in software as inputs or outputs. The default EmozziđŸ¶ configuration is to use all 8 analog pins as inputs, and all 13 digital pins as outputs. It keeps things simple. But you can definitely wire things off-label. In particular, switches are good candidate for digital pins.

Depending on what you’re doing, you might have to desolder the resistor corresponding to the pin you want to use. If desoldering SMD scares you, you can also solder a wire directly on the Arduino pin.

Just mind D13: it is hardwired to the built-in LED of the Nano. Avoid using that one as an input.

Select your own impedance

There’s two pins per digital output, and the only difference is the value of the resistor in series. The ones marked LED have a 2K2 resistor, the ones marked OUT a 1K resistor. That makes all the difference between a blinding LED that uses a lot of current, and more aesthetically pleasing Blinkenlichten. Still, all LEDs differ, some might look better from the OUT pin, and 1K is enough to protect them.

Mozzi is optional

If you ignore the hardwired dual PWM output, you don’t have to build around Mozzi if your ideas don’t require it. And you can use the test points to access those two PWM pins. Look at the schematic for more info, and be careful, they have no built-in protection.

Without Mozzi, EmozziđŸ¶ can be useful to prototype CV mangling and MIDI mishandling ideas.

Bipolar is optional if you hate yourself

That’s right! If you power the Arduino Nano directly from USB, you will still get some sound output. However, the op amp isn’t powered from the Nano’s +5V, it’s using +12V and -12V. Still, when the chip is unpowered, audio kinda passes through, but it will get all distorted. Why? I dunno! Is it even safe? Don’t ask me!
It might be good enough in some development scenarios, but you’ll need -12V in actual audio use.

Get a bag

Planning to put together a lot of EmozziđŸ¶, or Mozzi projects? Save yourself the trouble and buy a bag of 100 499K 1% resistors. Yes, you will never use 499K in any other project, and most of them will be duds that don’t reach 0.5% precision, but you can use them wherever you need a random pulldown resistor in another project, synth circuits often specify 100K pulldowns that can be safely substituted.

Crash course on PWM pins and DACs

[FIXME: Triple-check everything about PWM, some of it is wrong due to HIFI using Timer 2.]

Pins noted with a tilde symbol are PWM output pins. On the Nano, they’re D3~, D5~, D6~, D9~, D10~, and D11~. It means you can use analogWrite() with a number between 0 and 255 to make them output a fast PWM wave. You can learn more in the Arduino docs, but the TL;DR is that it’s useful for stuff like dimming a LED, and you can also use a RC filter to turn PWM into a messy DC voltage between 0V and 5V.

Out of the 6 PWM pins:

By picking a good resistor and capacitor for the RC filter, you can get a kinda, somewhat sorta stable-ish DC voltage out of the PWM. But it’s probably gonna be jittery, slow to react, impossible to calibrate, and limited to a low resolution (values between 0 and 255). It’s good for modulation CV at LFO speeds, though.

If you want to output a V/Oct signal, you will need something a lot more precise than a single-pole RC filter: use a MCP4725 DAC board on the I2C bus.

In fact, you could even use two of those boards on a single EmozziđŸ¶, as you can change the I2C address with a solder jumper
 but you’re on your own to figure out the details.

Circuit schematic

Download as a printable black and white PDF

Schematic pictures. Please download the KiCad project and use your preferred assistive technology to read the schematic.
The inputs and outputs of the Arduino go into circuits detailed below.
Analog inputs, 8 of those in total: A0, A1, A2, A3, A4, A5, A6, and A7.
RC Filter for D5~ and D6~ PWM pins.
Both D3~ and D11~ PWM pins have no output filter.
Digital outputs: D2, D4, D7, D8, D12, and D13. You can still repurpose them as inputs if you need, though.
Audio output.

Sample programs

I/O test

[TODO: Add a better example than test code]

[TODO: Style code properly]

#include <Arduino.h>
#include <MozziGuts.h>
#include <Oscil.h> // oscillator template
#include <tables/sin2048_int8.h> // sine table for oscillator

Oscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin(SIN2048_DATA);
int state = LOW;
unsigned long prevM = 0;

void setup() {
  startMozzi(CONTROL_RATE);
  aSin.setFreq(440); 
  pinMode(2, OUTPUT);  // Digital
  pinMode(4, OUTPUT);  // Digital
  pinMode(7, OUTPUT);  // Digital
  pinMode(8, OUTPUT);  // Digital
  pinMode(12, OUTPUT); // Digital
  pinMode(13, OUTPUT); // Digital
  pinMode(5, OUTPUT);  // PWM Filter
  pinMode(6, OUTPUT);  // PWM Filter
  pinMode(3, OUTPUT);  // PWM No Filter
  pinMode(11, OUTPUT); // PWM No Filter
}

void updateControl(){}

int updateAudio(){
  return aSin.next();
}

void loop(){
  // Test audio out with a sine
  audioHook(); 

  // Test digital outs (2s blink)
  unsigned long m = millis();
  if (m - prevM >= 2000) {
    prevM = m;
    if (state == LOW) {
      state = HIGH;
    } else {
      state = LOW;
    }
    digitalWrite(2, state); 
    digitalWrite(4, state);
    digitalWrite(7, state);
    digitalWrite(8, state);
    digitalWrite(12, state);
    digitalWrite(13, state);
  }
  // Test PWM pins (square wave)
  analogWrite(5, 64);
  analogWrite(6, 128);
  analogWrite(3, 64);
  analogWrite(11, 128);
}

//TEST: 80 characters
#234567890#234567890#234567890#234567890#234567890#234567890#234567890#234567890

More programs

[TODO: Add a collection of downloadable examples]

Changelog

The “Non-Commercial” rule

You cannot sell this item, but you can share it with your community if you don’t profit from it.

I do not want to have to compete against low quality products bearing my own name in the event I choose to sell products in the future. I disallow commercial usage via the CC-BY-NC-SA 4.0 license.

Ordering PCBs of my project from a fab house with a minimum order of 5, and selling the 4 leftover PCBs at cost in a DIY community, that’s fair. But ordering 20 PCBs of my project and selling them for profit on a marketplace like Reverb or eBay is forbidden.

Using the EmozziđŸ¶ to workshop a commercial design, and reproducing the relevant parts of the schematic for your new design, that’s also fair, but remember you can’t sell the Mozzi library, license the code accordingly.

Using the Aria Salvatrice signature fairly

I do not sign things I did not make. Never use my signature in ways that imply my participation or my endorsement.

If you are modifying my PCB, remove the signature graphic before you redistribute it, and credit me in a more appropriate way: for example, add text that says “Based on a design by Aria Salvatrice” in the docs and on the PCB. If shoddy mods I didn’t design myself display my signature, it makes it harder for me to establish a reputation for quality.

I often use the “Cool S” symbol on my builds, a popular culture symbol that belongs to everyone. I claim no legal or moral rights over the “Cool S” symbol: do not hesitate to leave it or to remove it from your hacks.
What I do assert legal and moral rights over is my full signature, which I use as a logo, and which is unambiguously distinct from the “Cool S” symbol it integrates.

Frick the heck off, liability lawyers

I disclaim all liability. You play around with this thing at your own risk. Here’s some all caps words I copy pasted off somewhere to scare off lawers:

THE EMOZZIđŸ¶ HARDWARE FILES, DOCUMENTATION, AND SOFTWARE ARE PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

Also, electricity can kill you. In the interest of safety, do not get killed by electricity.

Absolutely not. Prepare for a lawsuit.