DrumKid: aleatoric drum machine

A lo-fi digital drum machine which uses randomness to create unpredictable beats. Runs on Arduino, with audio provided by the Mozzi library.

Public Chat
Similar projects worth following
DrumKid is an "aleatoric" drum machine, meaning it uses random numbers to determine the rhythm and sound of a drum beat. It comes in a handheld, battery-powered unit, designed for live performance. Check out the video here:

Drum machines are ubiquitous in modern music, but playing them live presents a challenge. When playing electronic rhythms live, whether using a drum machine or a laptop, it can often appear that a musician is simply pressing "play" on a backing track, removing much of the perceived spontaneity of a live performance.

My drum machine, DrumKid, aims to tackle this problem by using a variety of controls to alter a drumbeat live, using randomly generated drum hits which augment the original beat. Rather than being designed as a pre-programmed backing instrument, DrumKid aims to be a playable instrument in its own right, with continuously adjustable controls that work well in a live setting. My intention was to create an engaging, interactive device that, like any musical instrument, can be mastered over time with practice.

DrumKid has the following features:

  • 4 real-time control knobs
  • 20 controllable parameters
  • Save/load function
  • Tap tempo
  • 3.5mm line/headphone output
  • Lo-fi mono 8-bit sound
  • Powered by 3xAA batteries

DrumKid is an open-source, hackable product based around an ATmega328 chip, as found in an Arduino Uno. The final product features a minimalist design consisting of a single PCB with buttons, knobs, and LEDs mounted on one side, and all other components mounted on the other side. Two laser-cut sections are used to protect the electronics.

I have made several identical fully working prototypes of DrumKid, and I am happy with the audio quality, playability, aesthetics, durability, reliability, and battery life. These prototypes have been distributed to musicians in the UK who have been giving me feedback on the current design. I am currently using this feedback to tweak the firmware and PCB layout for what I hope will be the final design. DrumKid should be available to buy soon - you can sign up to my mailing list if you want to be kept up to date.

DrumKid can also be constructed as a breadboard/stripboard project using an Arduino Uno - see the build instructions for details.

All necessary files can be found on this page and/or the DrumKid GitHub repository.

Adobe Portable Document Format - 31.67 kB - 09/30/2019 at 11:02


Adobe Portable Document Format - 38.19 kB - 09/30/2019 at 10:27


DrumKid BOM (bill of materials).pdf

Bill of materials for a single DrumKid unit

Adobe Portable Document Format - 52.92 kB - 09/30/2019 at 08:29


drumkid laser parts.dxf

DXF file for the two laser-cut parts of DrumKid. Designed to be cut from 3mm acrylic or plywood. Adjust the drawing for your laser cutter - text should be engraved, all other lines should be cut.

AutoCAD DXF - 28.72 kB - 08/22/2019 at 09:49


drumkid breadboard.png

Illustration (in Fritzing) showing how the breadboard version of DrumKid is assembled - refer to breadboard schematic for capacitor values and clearer wiring

Portable Network Graphics (PNG) - 448.21 kB - 08/22/2019 at 09:45


View all 8 files

  • V5 PCB almost working

    Matt Bradshaw3 days ago 9 comments

    The fifth iteration of the DrumKid PCB arrived from China this week, and I'm pleased to report that it pretty much works! I had changed and added quite a lot since V4, so there were always likely to be a few problems, but overall I'm pretty happy.

    Assembly was made much easier by including the resistor and capacitor values on the silkscreen layer, which I didn't do in V4. However, I forgot to identify a few other components and polarities on the silkscreen layer. This isn't a big deal when I've got the KiCad files to refer to, but worth fixing on the next version, especially if I'm going to make DrumKid available as a kit.

    The two main problems I ran into were related to two of the biggest changes I made. I significantly altered the low-pass filter on the audio output to try and remove more of the PWM carrier signal, but I'm not sure I've done it correctly - the audio sounds much brighter than I was expecting, and has some issues at full volume (possibly related to running off batteries rather than a 5V USB supply).

    Another problem is that when a MIDI input is connected, each MIDI signal causes an audible click, or a loud tone, in the case of MIDI clock messages, which are sent very frequently. I had come across this issue on my breadboard prototype but assumed it was just due to the inadequate ground of the breadboard. I was wrong! I'm currently experimenting with a decoupling capacitor on the optoisolator to solve this problem.

    Oh, and one final, stupid mistake I made: I added a power LED so that it was obvious when DrumKid was on, but somehow managed to connect both legs of the LED to ground in the layout. Clearly KiCad's "electrical rules check" doesn't check for that...

    So, overall, a bit of a mixture of good and bad, but that was probably to be expected for a fairly major revision of the design. It's certainly going to delay the release (I've tried to remove mentions of a November release date from the web where possible!). I'll see what I can do to fix the issues by hacking this PCB, then design and order a minor revision ASAP.

    I always knew that this project would be a learning process. I was attempting to jump from having minimal PCB design skills to releasing a reasonably complex product with a mixture of analogue and digital circuitry, so although I did initially get a bit cross at V5 for not being perfect, I'm philosophical about it - we're getting there!

  • New PCB (V5) Design

    Matt Bradshaw11/05/2019 at 13:47 0 comments

    Have finished designing a new PCB, the fifth iteration since I started the project. I'm waiting for it to arrive from China, but here's roughly what it will look like:

    The overall footprint is a little longer to make room for the MIDI ports, there's more info included on the silkscreen layer, there's an extra LED to show when the power is on, the volume and power controls are now aligned with the audio output, and there are a bunch of boring changes to the component layout on the other side. Oh, and everything is red now.

    I've also ordered some black nylon knurled thumbscrews to allow the batteries to be changed without needing a screwdriver.

    Meanwhile, coding continues, and I've sent a V4 prototype to Pasadena for Supercon. I won't be there, but hopefully DrumKid will!

  • MIDI and Sync

    Matt Bradshaw10/14/2019 at 15:10 0 comments

    After getting lots of feedback, I'm attempting to add MIDI to DrumKid. Many people have expressed a hope that DrumKid would feature the ability to synchronise with other instruments, and I've decided that MIDI is the best way to do this, because this also gives the option of using DrumKid as a MIDI controller, thereby greatly expanding its capabilities.

    (For the uninitiated, MIDI stands for "musical instrument digital interface", and is a type of serial connection which allows musical instruments to send data to each other, such as notes, timing, and other controls.)

    Outputting MIDI note data from DrumKid was very easy, and instantly convinced me that MIDI was a vital feature which had been missing all along - I was suddenly able to produce a much wider variety of sounds by triggering other drum machines' samples. However, generating synchronisation data has proven much harder. The MIDI "clock" standard requires a byte of serial data to be sent 24 times per quarter note. Had I thought about this from the outset, I probably wouldn't have designed my code around an arbitrary division of 16 pulses per quarter note, because these two divisions are basically incompatible! I was able to get my Korg synth to sync up with DrumKid, but only at lower tempos, and not with any great reliability.

    After several hours of trying to fudge the code, I decided it's time for a major rewrite. The code had become bloated and messy, and I was pushing right up against the RAM limit anyway. Now that I'm 90% sure that DrumKid will feature MIDI, I'm going to incorporate it properly, rather than as an afterthought.

    The next GitHub update might be a pretty major one!

  • The "Final" Stretch

    Matt Bradshaw09/30/2019 at 15:49 0 comments

    Well, the Hackaday Prize final deadline is tomorrow, and I think I've squeezed as much progress out of DrumKid as possible in that time! I thought it would be nice to reflect on how far the project has come since it began.

    • February
      • Started exploring the idea of converting my DrumKid web app into a physical project
      • Got some good sounds from early breadboard prototype
    • March
      • Experimented with voltage regulator chips
      • Designed V1 PCB
    • April
      • Assembled V1 PCB (which worked, but was too quiet and had noise issues)
      • Designed and 3D-printed a case
      • Decided to increase number of potentiometers
    • May
      • New stripboard prototype to diagnose problems more rapidly
      • Added filter circuit
      • Designed V2 PCB
      • Hackaday Prize mentoring session
    • June
      • Rethinking the enclosure design
      • Designed V3 PCB
    • July
      • Assembled V3 PCB, instantly found routing issue
      • Designed V4 PCB (minor revision)
      • Designed and 3D-printed front and rear panels, to be laser-cut in final version
      • Sourced test laser-cut pieces (success!)
      • Assembled V4 PCB (success!)
    • August
      • Concentrating on coding
      • Added lots of features
      • Made demo video
    • September
      • Found local laser cutter and obtained enough pieces for three new (identical) V4 prototypes
      • Did a "test run" of assembly, successfully built three new units
      • Distributed DrumKids to testers
      • Received feedback from testers
      • Started V5 PCB design

    And that takes us up to today! I'm really pleased with where I've got to, and am excited to complete the V5 PCB design over the coming days. Good luck to all the other Hackaday Prize finalists, and if anyone wants to be kept updated about DrumKid's launch later this year, please go to and sign up my mailing list.

  • A Look Inside

    Matt Bradshaw09/30/2019 at 13:43 0 comments

    Here is a selection of photos showing the inside of the current version of DrumKid.

    This is what DrumKid looks like after soldering but before assembly
    This is view after removing DrumKid's rear panel - note the Arduino/ATmega328 breakout pins to allow users to modify the instrument. Also note the unpopulated spaces for capacitors - these were included in the PCB layout in case they were needed for decoupling, but only one smaller capacitor (C4) ended up being necessary - these spare footprints will be eliminated from the next PCB
    The front laser-cut panel covers the soldered leads of the components. You can also see evidence of the modification I had to make due on this prototype due to an error in the schematic (this will be fixed in the next version)
    The battery box is mounted using two countersunk machine screws, which are secured on the other side with dome nut
    And here's how it's all assembled

  • How Open Source?

    Matt Bradshaw09/30/2019 at 11:54 0 comments

    This is a brief post where I will discuss exactly how open source DrumKid is (spoiler: as open source as I was able to make it).

    My aim from the start of the DrumKid project has been to create a fully open source instrument, in terms of both hardware and software. I based the design on the Arduino platform, which is itself open source, and have shared all my schematics, CAD files, parts lists, etc under the MIT licence, so it's fair to say that the hardware side of my project is fully open source, which is great.

    The software side is a little more complex. My code (which is also shared under the MIT licence) relies on two external libraries. One library which I make some use of is the ArduinoTapTempo library, which also uses the MIT licence. However, my code is based heavily on the Mozzi audio library, which is shared under a Creative Commons Non-Commercial licence.

    Mozzi is a clever, extensive library that somehow squeezes complex audio out of an Arduino. The creator of Mozzi has (entirely fairly) released his code under this licence so that, while other people can use it to make cool projects, he reserves the right to negotiate a share of the profits if a commercial product makes use of his work.

    I have added a caveat to my GitHub license.txt file to account for Mozzi's licence

    I reached out to Mozzi's creator while I was developing DrumKid, and we quickly came to an amicable agreement about future profits, which means that DrumKid is "good to go" from a legal standpoint. However, it does leave this project in a sort of open source limbo. All the code that I have written is fully open source, and I personally have permission to use all the code that DrumKid relies on, but if anybody other than me started making and selling DrumKids, they would be in breach of Mozzi's licence (unless, of course, they also reached an agreement with its creator).

    If somebody did want to sell DrumKid clones legally, one way would be to eliminate the need for the Mozzi library by "rolling their own" - while I do make extensive use of Mozzi, I only use a small subset of its features, so it wouldn't be that difficult to write some code that performed a similar function.

    Personally, I'm happy to keep using Mozzi and pay a small fee to the developer who made DrumKid possible, but I thought this was an interesting aspect of open source culture: when money starts to get involved, things do get more complex!

  • Feedback

    Matt Bradshaw09/28/2019 at 17:23 0 comments

    Designing for other people is a lot harder than designing for yourself, which makes this project harder than almost all of my previous ones - the aim is to get DrumKid into the hands of as many musicians as possible, which means I actually have to listen to constructive criticism. I've tried to elicit feedback throughout the project, but this has ramped up recently as I approach my self-imposed deadline of making the first batch of finished DrumKids by November.

    I've now received comments from all three musicians who are currently using the latest prototype of DrumKid, so I thought this was a good point to share the feedback I've had throughout the project and how I've adapted the design based on it (or plan to in the near future).

    My main sources of feedback/criticism have been:

    • Informal feedback from friends (usually when I bring the latest prototype to the pub)
    • YouTube comments (I'm one of the few creators whose comments are nearly always nice)
    • Hackaday (comments, chat, and mentoring session)
    • E-mail (usually unsolicited but very helpful!)
    • Feedback from musicians who are currently using DrumKid

    Overall, spread over these various mediums, I've had a lot of helpful comments throughout the project! I thought it would be helpful to document them here, roughly in chronological order.

    Early feedback from friendsToo much high-frequency noiseImproved the filter circuit
    Early feedback from friendsOutput is too quiet (this was with the volume on max in a noisy pub - the filter was reducing the output too much)Added an amplifier chip to boost the signal
    Early feedback from friendsThe early single-knob design was too confusing and difficult to playI agreed with this comment and redesigned DrumKid to feature four knobs instead of one
    Email and YouTube commentsDrumKid should be compatible with Eurorack synthesizers, and the different parameters should be controllable via external control voltagesCreating a DrumKid Eurorack module would be a separate, complex project, but there seems to be a lot of demand for it, so I've started making notes about a potential future design, maybe using a Teensy
    Email and YouTube commentsDrumKid should be able to synchronise its tempo with other instrumentsThis has come up quite a lot, often enough that I'm considering adding this feature to the final design, although it might delay the release by a couple of weeks
    YouTube commentIt would be good to be able to load custom sample sets (different kicks, snares, etc)Although it would be hard to make this part of the core, supported features of DrumKid, switching the samples is such an obvious customisation that I'd like to document a way for people to do it. This has made me realise that I should write a secondary "hackers' manual" for DrumKid to help people who want to customise their instrument
    TesterThere should be more different styles of basic drumbeat, such as drum 'n' bass, reggae, waltz, etcI agree with this, and will spend some time adding more beats for the next version
    The volume knob seems to be mounted backwardsThis is true - either the KiCad footprint is wrong or I did something stupid, but I will fix this in the next version of the PCB
    TesterThere should be more than six slots to save beats inThis is probably fair. There is plenty of space in the EEPROM to save more beats, but I wanted to keep the user interface nice and simple (six buttons, six save slots) - I'm considering increasing this to six banks of six (36 slots)
    TesterThe loading process is unreliable and confusingI hadn't noticed this before, but I think there is a bug in the code, so I will investigate
    TesterThe LEDs are too brightI noticed this, too, and had already planned to reduce the brightness for the next version, which should also have the benefit of increasing battery life
    TesterBeats in non-standard time signatures have strange emphasesMy previous, slightly lazy approach...
    Read more »

  • Money Talk

    Matt Bradshaw09/23/2019 at 14:39 2 comments

    Apologies for what may be a boring post, but as my target launch date (November 2019) approaches, I'm starting to think more seriously about the financial side of my project.

    I'm currently planning to make small batches of DrumKids myself, perhaps 5 or 10 at a time. If there were to be a really big demand for DrumKid in the future, it would certainly be possible to redesign it in a way that would be more suited to mass production. There are surface-mount versions of all the components I use, and the case is not a particularly complicated shape, so it would be possible to design a version for injection moulding.

    However, this post will focus on the economics of manufacturing on a much smaller scale. The current design uses only through-hole components, partly so that I can make DrumKid without a reflow oven, partly so that I can sell DrumKid as a kit, and partly to make each one easier to repair or hack. I'm also using a laser-cut enclosure for the same reasons.

    This is my first time making anything that will be sold to the public, so it's entirely possible that I'm leaving out some major part of the calculation. With that caveat in mind, though, here are the various costs involved in making a single DrumKid unit (including both time and money as costs, since I obviously want to be paid for my time working on each unit!):

    • Materials (total £19)
      • Circuit board (£3 from China)
      • Laser-cut parts (£2 each from local maker)
      • Electrical components (£12, from three different suppliers)
      • Structural components (£2, from one supplier)
    • Assembly time (total 60 minutes)
      • Soldering (40 mins)
      • Uploading firmware (5 mins)
      • Testing (5 mins)
      • Screws etc (5 mins)
      • Bug-fixing (5 mins?)
    • Miscellaneous (total 30 mins?)
      • Postage and packing cost (can be passed on to customer)
      • Time spent packaging each unit
      • Time spent going to the post office
      • Time spent ordering parts
      • Time spent organising parts
      • Repairs (at my expense if within X years?)
    • Development costs
      • Time spent developing DrumKid (maybe 200 hours?)
      • Cost of components etc used in prototypes (approx £200)

    I have given actual values for the materials (because I can look up the prices I paid for them) and assembly time (because I kept a log of how much time each process took when I built a test batch of three units). I have only given values to the nearest GBP, since these costs will fluctuate quite a bit anyway.

    My ballpark (rounded-up) figure at the moment is £20 (or $25 USD) of materials per unit, with roughly an hour of assembly time. The other time costs are a bit harder to estimate right now, since they will depend on factors (partly) beyond my control, such as how many units I sell. My rough estimate is that ordering parts, shipping, and general organisational tasks will add perhaps 30 minutes, on average, to each unit. This means each DrumKid unit will require £20 plus 90 minutes of my time.

    This sounds pretty good so far, but I haven't yet taken the development process into account. I've spent countless hours developing DrumKid, trying out different circuits, playing with the code, soldering prototypes, researching components, etc. If I were to start the project again, perhaps I would have documented all the time I spent on development, in the same way that I fastidiously document my time when working as a freelance web developer. However, it's not as simple as adding up all the time I spent working on this project and trying to make sure I'm paid for it - a lot of my time working on DrumKid has involved learning new skills which will help enormously on future projects. Before DrumKid, I knew barely anything about PCB design, filter circuits, decoupling capacitors, or PWM audio, so I'm not sure I can strictly add the time learning those things into the "development time" column.

    Since I didn't record how much time I spent on each task, this is all moot anyway - it's just an interesting point to consider. I'm going to have a wild guess...

    Read more »

  • Warholing

    Matt Bradshaw09/20/2019 at 16:12 2 comments

    I showed my latest laser-cut plywood prototypes to a carpenter friend of mine, since I wasn't sure how to darken the wood to fit the aesthetic I was aiming for. After exploring a few options with him, I decided that using wood is perhaps more trouble than it's worth at this stage. While I would prefer to limit the amount of plastic I use, for environmental reasons, I think that perhaps it's justified in this case: it will probably be more hard-wearing, and I'm not using a huge quantity. Since I will be making DrumKid in relatively small batches myself, rather than mass-producing it, I can always re-evaluate this decision in the future.

    With this decision made, I've been using my (not very advanced) image-editing skills to try and get an idea of what the first batch of units should look like. I can independently vary the following:

    • PCB (top panel) colour
    • Small front plastic laser-cut panel colour
    • Large rear plastic laser-cut panel colour
    • LED colour

    I already know what an all-black design with white LEDs looks like:

    I'm pretty pleased with the monochrome design. It looks slicker than I imagined. However, the black solder mask actually looks slightly grey in real life, and the colouring has been slightly inconsistent between batches (the previous, unsuccessful PCB design was also ordered in black, but came out much darker). Also, my preference has always been for bright, even garish colours, and I'd like to include this part of my personality in the final design, if possible. With this in mind, I attempted to simulate a few different colour combinations.

    First, I decided to try some bold, single-colour designs. Red, green, and blue are all available solder mask colours, so I wanted to see what it would look like to match the laser-cut parts and LED colours to the solder mask:

    I quite like all three of these, but with a mild preference for red. I've also had trouble finding bright, pure-green LEDs in the past (they often look more yellow-green or fluorescent yellow), and I also worry that a green solder mask would look less stylish than another colour, since green is the traditional, "default" colour for circuit boards.

    My next idea was inspired by my favourite Lego theme: M-Tron. For the unfamiliar, M-Tron was a successor to the classic Lego space theme, with a bold colour scheme of red, white, black, and fluorescent yellow (specifically transparent fluorescent yellow). Here's an example:

    And here's my M-Tron-inspired DrumKid mock-up:

    I really like this colour combination. I could even use transparent fluorescent yellow plastic for the rear panel, showing the circuitry and giving the characteristic edge-glow effect of laser-cut coloured transparent plastic. Sadly, I can't really do the same with the front plastic section, because it would show the soldered leads of the components, which (in my opinion) are a lot less attractive than the components themselves.

    I mocked up one other design, inspired by chunky Fisher Price tape recorders - I rather like the idea of using a "toy" aesthetic, because DrumKid fits into a category of toy-like electronic instruments that have become popular in the last few years (Teenage Engineering being the foremost proponents of this style). Here are a couple of images of Fisher Price tape recorders that inspired me:

    And here's my "toy" DrumKid design:

    In the UK, we have a brand of savoury spread called Marmite, whose slogan is "you either love it or you hate it", the idea being that its taste is so strong that you can't have a neutral opinion of it (for the record, I love it). The idea is pervasive enough that "Marmite" has entered the dictionary as a word to describe something inherently polarising. I feel like my colourful ideas are, perhaps, Marmite designs, and I'm torn about whether this is a good thing....

    Read more »

  • The Problem With Kids

    Matt Bradshaw09/19/2019 at 10:16 0 comments

    I did a bit of accidental user testing recently, which has caused me to redesign part of the circuit. I met up with my cousin and his kids, who are keen musicians, so I decided to show them a prototype of DrumKid. I gave the headphones to Kid A and turned on the power. "I can hear it making noise already!" he exclaimed, before I had even started a drumbeat, and I realised instantly that I had a problem.

    As I explained in earlier project logs, using an Arduino to generate audio requires using PWM (pulse width modulation), which basically means turning one of the pins on and off very quickly to produce an audio wave. The frequency at which you turn this pin on and off must be above the human range of hearing, otherwise you will notice an unpleasant noise at this frequency.

    The library I am using to produce audio is called Mozzi, and it has a few different modes. It can use a carrier frequency of 32kHz, which is above the human range of hearing, but this requires more processing time, and wouldn't allow me to run all of DrumKid's functions. Instead, I use a more basic mode with a carrier frequency of 16kHz. This frequency is pretty much above my hearing range (I'm 34), but just about within my partner's hearing range (she's 28), so I did realise early-ish in the design process (when I showed her a prototype) that I would have to add a filter to the circuit to get rid of this noise.

    I spent quite a while researching filters, and designed a second-order low-pass filter which seemed to do the job... until I showed DrumKid to a child for the first time. It turned out that I hadn't done a good enough job of filtering the signal for people with a really good hearing range (i.e. young people), so I decided to redesign my filter, this time using a bit more science.

    I used an audio editing program called Goldwave to analyse the performance of different filters. The 16kHz spike was clear to see. I tried a few different designs, and ended up settling on a twin-T notch filter (a variation of the one recommended on the Mozzi website, which I should definitely have used to start with!). The design was tricky to get right because I was trying to satisfy several competing criteria:

    • Reduce noise to an acceptable level for people who can hear it
    • Don't filter out the "good" frequencies too much
    • Use commonly available resistor and capacitor values
    • Don't attenuate the signal too much

    I'm much happier with the signal now - it sounds indistinguishable from the previous circuit, but analysis in Goldwave shows that the carrier signal noise is much reduced. I will add a paragraph in the manual to explain the carrier signal, because it would be a good idea to do further filtering in software if you were going to record a track with DrumKid, especially if you were to pitch-shift it downwards. However, I think the improved filter circuit means that the output signal is now acceptable for the final product.

View all 28 project logs

  • 1
    Source components

    Please note, these instructions are for version 4 of the DrumKid code/circuit. Version 5 will be available fairly soon.

    The simplest way to get a version of DrumKid working (apart from buying one when it's released!) is to build the breadboard circuit using an Arduino. The components are mainly pretty standard: you'll need a breadboard, jumper wires, an Arduino Uno, tactile buttons, LEDs, 10k potentiometers (linear), an LM386 amplifier chip, and a selection of capacitors and resistors. You'll also need some sort of breadboard-compatible headphone socket - I used a 3.5mm socket with screw terminals which is designed for prototyping like this.

    3.5mm stereo socket (wired as mono) with screw terminals to connect to the breadboard

    I've squeezed everything onto a single breadboard with small buttons and tightly spaced potentiometers, but you might want to consider sprawling over two breadboards, which would allow you to use bigger buttons, making for a more ergonomic playing experience. Using a second breadboard might also give you space to use a breadboard-friendly Arduino variant, keeping the whole project a bit neater, although I haven't tested this.

  • 2
    Build breadboard circuit

    Build the breadboard circuit shown below. Refer to the schematic for capacitor values. There are six push buttons which use the Arduino's internal pull-up resistors, five LEDs with current-limiting resistors, and four potentiometers connected to the Arduino's analog inputs. All these parts of the circuit are fairly standard, and found in lots of basic Arduino examples.

    The more complex part of the circuit is found on the right of the breadboard - this takes the audio output from pin 9 of the Arduino and filters it, before amplifying it. The raw audio output is a PWM output which has quite a lot of unwanted noise (the carrier signal), so I've added a 2nd-order RC filter to clean it up. In doing so, I've removed quite a lot of the higher frequencies, which I'm happy with because of the lo-fi sound I'm aiming for, but if you want to keep more of the high frequencies (at the expense of a noisier signal), you can try different resistor and capacitor values. The LM386 part of the circuit then amplifies the signal. There are many ways to wire an LM386, so feel free to use a different circuit for this if you'd prefer.

    If you just want to play around with DrumKid and aren't too worried about audio quality, you can just connect your headphone socket straight to pin 9 and ground, and omit the the LM386 circuit, filter circuit, and volume control.

  • 3
    Upload Arduino code

    Download the DrumKid repository from and use the Arduino IDE (software) to open the Arduino sketch found at drumkid/v4/arduino/drumkid/drumkid.ino

    The code relies on several external libraries, so you will either need to install them using the Arduino library manager or from a zip file. Any libraries not available through the library manager will be noted in the code.

    Make sure that the DEBUGGING constant is set to "false", and BREADBOARD is set to "true", then upload the sketch to the Arduino. If all goes well, you should see all five LEDs flash rapidly, after which you can play your breadboard drum machine.

View all 5 instructions

Enjoy this project?



sunny wrote 7 days ago point

Does V5 use a new circuit design? I ordered PCB, the text above shows that a large number of 200 Ω resistors are used, and diodes are added, which is totally different from the previous BOM. Is that it? We look forward to your release of the latest BOM. By the way. If the original can be designed on the same side as the button, I don't think it needs to be covered by the upper revision. It will show a old school style. After all, your design uses the through-hole original, don't you think?

  Are you sure? yes | no

Matt Bradshaw wrote 7 days ago point

Hi, yes V5 is a new design which features the addition of MIDI ports, hence the diode and other changes. Will try and clarify the difference between versions in a post this week and hopefully upload a new BOM soon, although I haven't even received my V5 boards from China yet so I probably won't upload any more V5 stuff until I've tested them!

  Are you sure? yes | no

Matt Bradshaw wrote 6 days ago point

I've just updated the GitHub repo to split everything more clearly into V4 and V5, so you can see which parts of V5 are ready.

  Are you sure? yes | no

sunny wrote 5 days ago point

Looking forward to your update,  another question, how to flash the chip?

  Are you sure? yes | no

Matt Bradshaw wrote 5 days ago point

I buy ATmega328 chips with the bootloader already installed, then put each chip into an Arduino Uno, upload the DrumKid sketch using the Arduino software, then carefully remove the chip and put it into the DrumKid PCB.

  Are you sure? yes | no

Emmanuel oluga wrote 11/08/2019 at 07:47 point

Hey thank you for this tutorial, Im a beginner and was wondering if a teensy could replace the arduino on this

  Are you sure? yes | no

Matt Bradshaw wrote 7 days ago point


Yes, you could use a Teensy for this project (it's more powerful than an Arduino) but you would probably have to make some adjustments to the code, so I would recommend starting with an Arduino if you're a beginner, or at least getting familiar with the Mozzi example sketches using a Teensy.

  Are you sure? yes | no

see24ya wrote 10/24/2019 at 16:18 point

Hey, thank you so much! I'm happy! I didn't change the breadboard thing to false. Thanks for your time!

  Are you sure? yes | no

Matt Bradshaw wrote 10/25/2019 at 10:26 point

No problem :) Would love to see pics/video of your build once it's working - I love the fact that other people are building my designs!

  Are you sure? yes | no

sunny wrote 10/23/2019 at 05:20 point

We are looking forward to your PCB update. If you plan to reduce the PCB size to 10 * 10cm, its price will be more friendly.

  Are you sure? yes | no

see24ya wrote 10/01/2019 at 17:06 point

Thanks for updating BOM! It's much clearer now. And thanks for the new photos of the assembled pcb! I will give it a try the next days. Good Luck for the competition!

  Are you sure? yes | no

Matt Bradshaw wrote 10/15/2019 at 11:33 point

Hey, sorry for slow reply, I don't seem to be getting notifications for comments! Let me know if there's anything you're still stuck on. In answer to your other comment (which may or may not have been addressed by the new BOM!), the crystal has to be 16MHz and the pots are meant to be 10k (other values will probably work for the control pots but the volume pot should probably be 10k). CP is a polarised capacitor and C is an unpolarised capacitor - they don't have values because I originally wasn't sure what value of decoupling capacitor to use, I was using the PCB to do some live prototyping! But if you get everything on the current BOM then everything should be fine. I'm actually due to release version 5 of the PCB in the next couple of weeks - it will (probably) have MIDI/sync and a slightly better layout, just in case you wanted to wait :) Oh, and if you've ordered/made the V4 PCB already and are having trouble, please note that there is a little hack required, shown on the schematic (pin 4 of the LM386 needs to be soldered to ground).

  Are you sure? yes | no

see24ya wrote 10/23/2019 at 13:20 point

Hi, I made two PCBs but both of them will not function as expected. When turning on I expect every single led to light up several times for a short time. But only the two leds on the left side do so, the other leds light up permanently. All knobs and switches seem to be without function. No sound. Maybe it will be easier to understand with a photo but I don't know how to post them here... I power it up with a nine volt block. Maybe you can give me hint?

  Are you sure? yes | no

Matt Bradshaw wrote 10/24/2019 at 14:05 point

Hi - it's hard know your exact problem, but I'll suggest a few things! Firstly, the power supply should be 5V, not 9V, so that could be a problem. Another possible solution is to check that you have set #define BREADBOARD false on the second line of the sketch (the breadboard pins are different from the PCB pins). Let me know if you're still stuck.

  Are you sure? yes | no

see24ya wrote 09/29/2019 at 13:52 point

Hey, nice project! I've built the breadboard version with success finally. Now I'm trying to get along with the pcb version 4. First try wasn't successful. There was no sound and weird behaviour of the led's (only the first two seemed to function, the rest were only glowing weakly). I'm wondering if you could be more precise in your bom? For example: the crystal has to be 16 MHz one? What do you mean with postion 12 (the pots have to be 10 k ones?)? What do you mean with CP or C in positon 16 or 19?  I hope that you can help me out....Thanks for your efforts!

  Are you sure? yes | no

Dan Maloney wrote 09/18/2019 at 15:19 point

Glad to see you're making progress on this. And great documentation, BTW!

  Are you sure? yes | no

Matt Bradshaw wrote 09/18/2019 at 15:30 point

Thanks, Dan! Yeah, I'm really happy with how the first batch turned out. Can't wait to see how musicians use them.

  Are you sure? yes | no

Ken Yap wrote 08/01/2019 at 08:35 point

Nice going, looks like the break did you good. 👍

  Are you sure? yes | no

Matt Bradshaw wrote 08/01/2019 at 08:42 point

Thanks :) Yeah, it's going much better now!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates