Micro:bit - Micro Drum Machine

by Thorsgaard Efterskole in Circuits > Microcontrollers

3476 Views, 5 Favorites, 0 Comments

Micro:bit - Micro Drum Machine

25944052-312D-401F-8ACE-76F0EB655182.jpeg

This is a micro:bit micro drum machine, that instead of just generating the sound, actuelly drums. It is heavy inspired by the rabbits from the micro:bit orchestra.

It took me some time to find some solenoids that were easy to use with the mocro:bit, since I didn’t want to use alternstive power sources or relays.

The circuit is a bit more complicated than my other projects, and though it is not that hard, it is properly not a project for middle school students.

Supplies

Materials:

1 x micro:bit

4 mm plywood

3 x M3 bolts

12 x M3 nuts

1 x TIP120 darlington transistor

1 x 1k ohm resistor

2 x 10 uF electrolytic capacitors

1 x 47 uF electrolytic capacitor

1 x TO220-3 voltage regulator

1 x rubber band

1 x 9 volt battery

1 x 9 volt battery clip

1 x Switch

1 x Diode

1 x 5 volt solenoid

A few meters of wire.

It is good if you have different colours

Some perf board

Wood glue

Hot glue

Tools:

Soldering tools

Lasercutter

Wirecutter

Hot glue gun

Solder the Circuit

E157F4BB-3033-498F-B9A8-9780024AF3F4.jpeg
IMG_1931.jpg
IMG_1930.jpg
IMG_1932.jpg
IMG_1935.jpg

Solder the circuit on the drawings. You shouldn't solder anything to the micro:bit since we are going to connect it with bolts and nuts. Just leave some wire there. I soldered the 1k ohm resistor into the wire.

When I made this first I didn't realise that a switch was needed, so I added it later, but you should properly learn from my mistake and add it now.

Lasercutting

IMG_1940.jpg

Download the files and cut them out of 4 mm plywood.

Add Battery

IMG_1936.jpg
IMG_1937.jpg
IMG_1938.jpg
IMG_1939.jpg

First attach the rubber band, then strap in the battery.

Attach Circuit

IMG_1941.jpg
IMG_1949.jpg

Use hot glue to attach the circuit and solenoid. Use plenty of hot glue. You will be able to recover the solenoid for another project if you want to, since hot glue doesn't stick that well to metal.

Glue It Together

IMG_1950.jpg

Use woodglue to glue the two sides on. Wait a bit before you continue working.

Add Bolts

IMG_1944.jpg
IMG_1945.jpg
IMG_1948.jpg

Now take one of the M3 bolts, wrap the data wire you want to connect to the micro:bit around it and keep it in place with one of the nuts. Do the same for the ground and 3.3 V wire.

Then put the screws through the holes. Gnd through the left most hole, 3.3 V through the second most to the left and data throught the right most hole. Use two nuts on each to keep them in place. We use two instead of one,because we also need to creat some distance for when we connect the micro:bit.

Add the Forgotten Switch(Optional)

IMG_1952.jpg
IMG_1953.jpg

If you forgot to add a switch like me, then this is when I added it. Without the switch to turn of the circuit it will be very hard to get the micro:bit in place, because the solenoid will randomly turn on and off, until the micro:bit is properly set. Cut the ground wire from the battery clip, solder on the switch and glue it on with hot glue.

Attach the Micro:bit

IMG_1954.jpg

Screw the micro:bit on.

Programming

image (33).JPG

So programming it is pretty simple.

The first red block turn the solenoid off.

The next block makes the LED's show a tired face.

Third block pauses the program for a second.

The second red block turns the solenoid on, so that it jumps out and make a beat.

Afterwards we have a block for shocked face and a 100 ms wait.

I use the faces in my first program for trouble shooting, but if you want to program a more perfect beat, then you properly don't want to include them, since it take time for the micro:bit to draw them. A small amount of time, but enough to mess up a beat.

Here is a program.

Test

Drum Machine

Now transfer your code to the micro:bit and test it.

If you use a fast beat, then the solenoid will start getting warmert after 5 minuts and after 15 - 20 minuts it will start getting hot. So if you want the Micro Drum Machine to be on for a long time, then you might want to aply a small passive cooler to the solenoid.