Arduino Nano Multi-tone or PWM PCB

My latest Lo-Fi Orchestra piece is calling out for more brass and woodwind, so I’m thinking about ways to expand the setup. One thing I always wanted to improve on is the banks of Arduino Nanos I’m currently using for brass and strings.  This PCB design will hopefully provide a much neater solution to my current system and make it easier to use the same ideas for some of the woodwind too.

Update: The build guide is now available here: Arduino Nano Multi-tone or PWM PCB – Part 2.

NanoMultiTone-3d

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

These are the key Arduino tutorials for the main concepts used in this project:

If you are new to Arduino, see the Getting Started pages.

The Circuit

NanoMultiTone-sch

I had the following design goals:

  • Support four Arduino Nanos from a common power source and (TTL) MIDI IN.
  • All for up to three loudspeakers to be connected to each Nano, each via a current limiting resistor on board.
  • Provide an option for PWM output from each Nano via an audio filter circuit and coupling capacitor.
  • Provide simple mixing for the PWM signals to an audio out stereo jack socket (there is a jumper to mix all four signals into a mono signal, or to allow two Nanos on L and two on R).

PWM output is linked to D9 or D3 (selectable via a jumper).  Loudspeakers can be connected to D4, D5 and D6.

There are three modes for passing serial MIDI data between the boards (jumper selectable):

  • “daisy-chained” with TX from one Nano going to RX of the next.
  • “bus” with RX of all the Nanos connected to the serial (TTL) MIDI IN line.
  • “independent” with four separate RX connections to the board.

Power Supply

There is a single 7-12V in via a barrel jack that goes to the VIN pin on each Nano.  In theory, I’ve seen it said to allow for 200mA for an Arduino as a worst case current draw, but ultimately it will depend on what IO is used and what else is drawing power via the 5V and 3V3 pins.  Assuming nothing else is hooked up to the board, then a 500mA power supply or greater ought to be fine for driving this board.  That allows for at least 125mA per Arduino.

IMPORTANT: This requires a centre-negative PSU.  Sorry. I meant it to be a centre-positive one but got it wrong!  This means the +ve PSU connection has to go to the outer ring of the barrel jack and GND goes to the centre pin.

Current Limiting Speakers

In terms of current limiting the speakers, the Arduino Nano (well, the ATmega328P used on the Nano) can drive an absolute maximum of 40mA per IO pin up to a total current draw of 200mA, but the general recommendation is to aim for less than 35mA and ideally around 20mA each.

So for 5V / 20mA requires R = 250Ω (or larger for lower currents).

But too large a resistor means the power driving the speakers is reduced. I went with 220Ω in the end which simplistically gives me the following depending on the impedance of the speaker:

  • 4Ω speaker -> 23mA
  • 8Ω speaker -> 22mA
  • 30Ω speaker -> 20mA

I am taking liberties a little here treating resistance and impedance as the same thing… but you get the idea.  In short, there should be a reasonable margin for error and the currents should be well within the limits of an Arduino Nano even if all three speakers are used.

PCB Design

NanoMultiTone-pcb

There are a number of configuration jumpers as described above:

  • The square blocks on the left: configure the RX connection for each Nano to select between independent TTL MIDI IN; common TTL MIDI IN; or to link to previous Nano’s TX.
  • The three-way jumper to the right of each Nano: configure the PWM output to either D3 or D9.
  • Single mono/stereo jumper top right.

In principle any combination of a single PWM out and up to three speakers per Nano could be connected.

NanoMultiTone-ger

Closing Thoughts

I have three main aims for this board, for use with my Lo-Fi Orchestra:

  • Expand the number of “brass” loudspeaker options to eight.  This could be using two of these PCBs each with four Nanos and one speaker each; or updating the code to run two speakers of each of four Nanos.  This would take the “daisy-chain” MIDI approach.
  • Replace the existing four strings.  This might take the parallel “bus” common RX approach.
  • Expand the two FM synths, which tend to be reed woodwind parts, to four.  This could take the common RX approach or independent inputs approach.

In fact, I haven’t quite decided yet if I will use several of my Raspberry Pi Pico MIDI Splitter (TTL)s to generate independent MIDI signals which could be fed four at a time directly to one of these boards.  Then the Nanos would do no routing themselves, it all being handled by the Picos.  When I get the boards back, I’ll do some testing and see which approach seems to be simplest and work the best.

This is the second of two boards I’ve recently sent off to Seeed Fusion for manufacturing, using some discount vouchers I’ve been sent.

Kevin

Leave a comment