A partial build of the Scary Tapping project above.
This started out as a Halloween project – Scary Tapping. It makes the sound of someone, or something, tapping behind a wall, floor, what have you. But it seems to have turned into a "robot spoon musician."
It isn't a bad thing to have a just a general tapping machine.
This is more of an exploration of servo control using the Micro:bit. You can control the rotation and the sequence the servos take.
The software works as follows:
- The Micro:bit sits and waits to be triggered by pressing button “A.”
- Once triggered it follows the programmed tapping sequence. It moves the servos approximately 90 degrees and back to its initial positions. The arms attached to the servo provide the tap sounds.
First, let’s gather all the necessary components you’ll need to build this project.
1x Breadboard from the Kitronik Inventor's Kit
Project Wires Female - Female (aka jumper wires)
Project Wires Female - Male
Video demonstration of the project:
STEP 1
Load the code onto the Micro:bit.
I am providing the hex file you need to drag and drop onto the Micro:bit, and the python code as two separate files. For the below process, just use the hex file.
Plug the MicroUSB cable into the Micro:bit, and plug the other end of the cable to a PC or MAC.
At this point, you are going to copy over the code to the Micro:bit. I am providing the program (code) in this posts that needs to be copied over. When the Micro:bit plugs into a computer, it shows up as a USB flash drive. All you have to do is copy the file over to the Micro:bit, like it’s a USB Flash Drive, and the Micro:bit will reset, and the program is active.
You could leave it plugged into your computer for testing, or in case you want to an alert to your water cooling system leaking inside the case. Though, I would imagine you’d know if that happened right away without the sensor.
A little bit about the code:
● The main part of the code to pay attention to is how you set the tap sequence.
There is an array variable called “melody” that sets the melody, so to speak, of the tap sequence. You can change it here or even add extra lines.
● You might want to change what scrolls on the display before the tapping starts. It does take some time to scroll.
In this code section you can change the work "playing" to something else, like "GO" or "X." It'll get to the taps faster.
STEP 2
I used the breakout board for this project. It’s great for testing and setting up where space and reliability isn’t an issue.
But for an initial build of the project, let’s use a breadboard.
Lay the Micro:bit and Kitronik Inventor’s Kit on a table. Insert the edge-card end of the Micro:bit into the Inventor’s Kit socket and stick a breadboard to the bottom part of the Inventor’s Kit.
STEP 3
Wire up the schematic to the breakout board. Below is how I assembled the system.
STEP 4 (optional)
I attached the servos to a spare PCB I had laying around using good old electrical tape. I wanted the surface they were on to be flat and ridged. It worked out ok. But, I would have preferred a 3D printed mount of some sort.
For a tapping sound that was a bit louder, I glued the servo arms to the bottom of a spoon. I found this was a bit louder than just using the plastic arms that came with the servos alone.
Attach the spoons to the servo actuator shaft. I found that I had to make different height surfaces for the spoons to tap on. I used stacks of dominos under each spoon, adjusted the number of for each. It’s a bit brute force, but it works.
Crude, but does the job.
STEP 5
Plug USB 5V power to the Micro:bit.
Also, power the additional 5V supply that is attached to the breadboard.
At this point, you’ll hear the servos power up.
STEP 6
Press the “A” button, and the screen will scroll “starting,” then the servos will move.
The spoons will play the sequence defined in the code and end.
It waits for the next press.
Conclusion
Yes, tapping can be scary, if you hide it somewhere. The Tell-Tail Heart story is somewhere proof of that.
So, feel free to hide this somewhere.
With a little more time I would adjust how the tap timing worked. I would make the taps faster, of course. I would also add a way to enter a sequence manually.
Mainly, I would like to make a better tapping arm. I imagine something like a small mace.
Have a good Halloween! Want to see one of my more advanced Halloween projects? Click on the "Scary Door" here.