Witch Race – IPC – Week7/Midterm Project


Work in a team of two and create a midterm project with Halloween theme.


Christina and I worked on a race game between two witches. Two players would laugh/blow/scream into the skulls that host the mics. The louder the player gets, the faster the witch flyes. Whoever reaches to the finish line the first gets to win. The winner then can say something to the p5 sketch created by Christina and their speech will show up in text version.


Interaction of players


Brainstorming the design idea

We wanted to create something cute and interactive that allow people to have fun in the Halloween spirit. Christina suggested a racing game between two witches. I suggested to use p5.speech to incorporate the physical computing with computational media. We then came to a plan to involve stepper motors, mics, and p5 sketch together.



Two stepper motors (NEMA 17), two drivers (L298N), belt and pulleys for the stepper motors, two mic sensors, two Arduino Unos.

Design Elements:

Laser cutted/engraved: patterns for the race box, paper witches, stands for the motors, wood dowel to hold the pulleys, panel for circuits


Arduino Code attached here. [Two files to adjust the clockwise/anticlockwise rotation for the motors]

P5 Sketch here.


We purchased stepper motors at first, without learning that we need drivers to connect with Arduino in order to control them. Therefore, we waited an extra day to begin our project, although it doesn’t affect the timing that much.

Learning Stepper Motors

Also, the stepper motors have different wiring than we experienced. We searched for the datasheet and followed YouTube tutorials step by step just to make sure. We started working with one stepper motor, one mic, and one Arduino since the process is replicable. Even though we tested the stepper motor library in Arduino, we still had a hard time debugging the issues. The stepper motor moves slightly back and forth rather than smooth as shown in the video below.

We lost so much oxygen trying to debugging the movement of the motor. Here are some documented evidence.

We were quite frustrated around that time since we put our hopes up everytime we upload the program to Arduino, wishing that this time the motor will work properly. Later, with Anthony’s help, we discovered that we forgot to connect the ground wire from the Arduino into the power supply.

We were quite worried while using the power supply since the stepper motor uses 12V with a maximum of 2A, and the driver L298N uses 5V and 2A. So when we increased the power supply, we were quite skeptical and worried that the stepper motor will be burnt since we only have two. But everything worked out in the end as we gradually increased the voltage.

We followed the tutorial here and the wiring tutorial here which are quite helpful!

Connecting Stepper Motor to the Microphone

I had previous experience with the microphone so reading the analog value from it is quite easy. However, when we try to connect the microphone to the stepper motor and to adapt the stepper library, it took us a while. We checked the serial plotter to make sure the analog value from the mic is working.

Then, we set several thresholds to determine how many steps the stepper motor needs to move when the sound value exceeds certain value. We have three values so the speed can move from low, medium, to fast. The total steps are measured by the sum of the step counts and the steps the motor rotates.

We also adjusted the total steps needed for the motor to run from the beginning to the finish line. With the calculation of the rotations of the motor, the total steps would be rotations times stepsPerRotation. So we changed the total steps into 2000.

Here is Christina testing with two mics inside the two skulls playing the game before showcasing to the public.

Making the p5.speech work along with the sketch

We followed on the p5.speech library yet had trouble with incorporating with the sketch. We ended up using the continuous recognition and call the speech when the winner screen shows up. We also start the recording in setup() so it shows up in the screen since before that the screen doesn’t show anything.


With the idea of two witches racing, Christina created the blueprint for the structure while I worked on the assembling of the racing box.

I made the stand to hold the motors and secured with zip ties. The finished version is a bit different since the width of the stand needs to be shortened to fit inside of the box.


I really enjoyed working with Christina for our midterm. Although the time is constrained and there is a certain level of pressure, we got along very well in terms of division of labor, understanding of workloads assigned for each other, and devotion to our project. I truly value collaborative working here in ITP since it makes me learn how others tackle with problems.

Further improvement

We would love to have a live stream of the movement of the witches on p5 while the players are playing. It would be more cohesive that way. We would also want to store the players’ names as user inputs and what they said in an array so that we can save them and display them on a page that is beyond the winning screen. The name and their comments can be on a ranking page. It would be more comprehensive for a game.

Future Implementation

This witch race game can be implemented in a party-setting as an icebreaker to get people familiar with each other. Pairing people in teams to compete against each other would also be good for team building in companies, communities, and organizations. This could also be used on a playground for children to play and also educate them ways that technology can be used to help bring people together.

Published by Yiting Liu


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website with WordPress.com
Get started
<span>%d</span> bloggers like this: