E780d78f c5a5 4c95 a218 09e53905da52


Arduino lo-fi 80s drum machine

by pjd

Published on August 2, 2016

Jam back to the 80s with the Arduino Beat Box drum machine. The Beat Box plays classic drum patterns using lo-fi TR-808 sounds. Here is a list of features:

  • 16 grungy, TR808-like rhythm instruments
  • Up to eight instruments per kit/pattern
  • Up to five selectable patterns
  • Adjustable tempo (60 BPM to 188 BPM)
  • Full source code available including waveforms (samples)
  • Write and compile your own patterns, drum kits and waveforms
  • Built-in PWM signal generation into an external low pass filter
  • 22,050Hz, 8-bit signed, mono waveforms for true lo-fi grunge

The Beat Box produces audio using the Arduino's high resolution timer, TIMER1. TIMER1 is programmed to produce an interrupt at the sample rate (22,050Hz) and to generate a high frequency PWM bit stream. The bit stream (Arduino pin D9) is converted to audio by a simple two-stage low pass filter. The low pass filter consists of two resistors and two capacitors which are assembled on a solderless breadboard. The filter is connected to the littleBits modules through a littleBits Proto module.

If you ever wanted to try your hand at basic electronics, this is a great project for beginners -- just a few basic components and a very simple circuit.

The Beat Box has two controls. The dimmer connected to Arduino pin A0 adjusts the tempo from 60 beats-per-minute (BPM) to 188 BPM. The dimmer connected to pin A1 selects one of five classic drum machine patterns.

The Beat Box is a great companion for the littleBits synth. I hooked the Beat Box to littleBits Filter and Delay modules to mess with the sound in real time. Listen to the demo MP3 file to hear the result. I recommend playing the Beat Box itself through good quality monitors as the Synth Speaker module doesn't do justice to the low frequency content in the drum samples.

The Beat Box design is a good starting point for your own projects. It shows how the Arduino can be made to produce audio, how to store samples in program memory (PROGMEM) and how to playback digital audio samples using interrupts. The full design is described at:


Here's a few ideas for your own project. Compose a rhythm pattern of your own and build it into the code. Make a new drum kit. Add new a new drum waveform (samples). Add a Filter module, Delay module, or whatever and mangle the audio. Program the button to add beats of your own so that you can play along with the rhythm pattern. Better yet, replace the button with a sensor to trigger beats.


Duration: A few hours

How To Make It


Assemble the Arduino subsystem Assemble the Arduino module, button module, dimmer modules, fork module and power module as shown in the project picture gallery. If you have the Arduino Coding Kit, then you're good to go! Configure the PWM/analog switch for pin D9 to PWM. This passes the raw PWM bit stream to the external filter.


Assemble the low pass filter Assemble the low pass filter by inserting the resistors and capacitors into the solderless breadboard. Use the circuit schematic and breadboard layout picture as your guide. Double check the assembled circuit against the schematic and correct any wiring errors.
8b83688e 5495 4e82 8142 da21353e7dc3

6d06930d 5917 4c1b 888c 82f074ab0afe


Connect the low pass filter to the Proto module Connect the low pass filter to the Proto module using jumper wires. Use the Proto module layout as your wiring guide. In the pictures, the yellow wire connects the PWM bit stream (Arduino pin D9) to the input of the filter, the green wire carries the audio from the filter to the rest of the littleBits circuit (the audio electronics), and the black wire is electrical ground. The finished breadboard and proto module should look like the picture above.
Dc021875 143a 4a7c 8a52 f8046a594604

5450bafa 0178 4e31 a86d da37571b014e


Assemble the audio electronics Assemble the Proto module, Dimmer module and Synth Speaker module as shown in the overall project picture. The Proto module sends the audio to the input of the Dimmer which acts as a volume control. Initially, turn the volume down using the dimmer. Don't forget to turn up the volume trimmer on the Synth Speaker or you won't hear anything when you eventually turn up the dimmer.


Connect the Arduino to the audio electronics Connect Arduino pin D9 to the input of the audio electronics using a Wire module. The Wire module carries the PWM bit stream and sends it to the input of the low pass filter through the Proto module.


Download and install the code Download the code and install it in a directory named "BeatBox". There are four source code files: BeatBox.ino (the sketch), waveforms.h (lo-fi TR-808 drum samples), kits.h (drum kits, where a kit is a group of eight drum instruments), patterns.h (prebuilt rhythm patterns to get your started). All four files must be in the BeatBox directory.


Compile and upload the code to the Arduino Compile the code using the Arduino IDE. If you're just getting started with Arduino, be sure to read one of the great tutorials on the littleBits web site. Connect the Arduino to your PC or Mac with a USB cable. Turn on the power. Upload the code to the Arduino.


Jam away! Turn up the volume dimmer. You should hear one of the five prebuilt rhythm patterns. Adjust the tempo using the dimmer connected to Arduino pin A0. The Arduino's TX LED flashes in time with the rhythm pattern. Select one of five rhythm patterns using the dimmer connected to Arduino pin A1.

Related Projects

Acoustic coupling with littleBits and Scratch

This is another way to connect littleBits and Scratch (includes Pyonkee, Scratch compatible app for iPad) without Arduino module.S...

LittleBits wearable Synth Kit

Using a 3D printer I designed and printed some mounting plates directly onto a teeshirt. The .stl files for a number of the mou...

Tin can organizer for synth kit platform

Found object organizer/platform for KORG Synth Kit