Halloween Cuckoo Clock

Team: Azin Mirzaagha, Patrick Barin, Yunjie Yao



Create a “Cuckoo Clock” mechanics. Cuckoo Clock typically has an automaton of the bird that appears through a small trap door while the clock is striking.


Components Used

  • Plywood
  • wood beams
  • wood pieces
  • rubber bands
  • Small hinge
  • wood squares
  • tape
  • Glue
  • Scissor


Halloween Cuckoo Clock


We created a Halloween theme cuckoo clock because this Wednesday is Halloween!!

When made a house, and when the door of the house is opened, a pumpkin will pop out with a message “trick or treat”!



Update: Video Link! https://goo.gl/photos/qU17V29jDkocHKya6


Our instrument is a group of five robots that each have their own percussive abilities. They are 1.) a four armed tap-bot that has four servos that tap tap tap on things, 2.) a two-armed spinning bot that hits things with it’s metal hands to make noise, 3.) a rolling pinecone that makes a rumbling noise on it’s surface, 4.) a shepard with a tap-tapping staff, and 5.) a scraper-bot that uses a bristly brush to scrape things and make noise.

We mounted 4/5 of them on a turning lazy susan, with the intention of making customization possible by changing the things on which the robots are tapping. (We could rotate the lazy susan to change what object each robot was tapping on.)

Our robots are controlled by a control board with 5 pots. They control: 1.) the tempo of the music that our bots make, 2.) the pattern with which the pine cone rolls, 3.) the pattern with which the scraper scrapes, 4.) the pattern with which the shepard taps, and 5.) the speed with which the spinny bot spins.

Challenges included: 1.) Getting the robots to tap with similar patterns // with some semblance of coherent synchrony, 2.) getting the different settings of the pots to have noticeably different sounds.

Materials Used:
– 2 Arduinos
– 4 Micro-servos
– 3 normal servos
– 3D printed plastic
– lots! of jumper wires
– machine screws / nuts
– beer bottle
– 3 soda cans
– pine cone
– chopsticks
– 5 pots
– laser cut control board, pinecone eyes, lazy susan parts
– construction paper
– foam ball
– clay
– DC motor
– metal wire
– metal bolts/nuts from Dan’s bed
– wire brush
– metal marbles
– chipotle tin
– cardboard scrapey surface w/ packaging material
– diode
– resistors
– breadboard
– 3 battery packs
– rubber bands


#include <Servo.h> 

Servo myservoR;
Servo myservoRp;
Servo myservoL;
Servo myservoLp;
Servo servoLeah;
Servo servoAndrew;
Servo servoJake;
int deltaPot = 0;

int leahPot = 1; 
int leahBeat = 0;

int andrewPot = 2; 
int andrewBeat = 0;
int danielPot = 3;
int danielBeat = 0;

int jakePot = 4;
int jakeBeat = 0;

int pos = 0; // variable to store servo position 

void setup() 
 Serial.begin(9600); // setup serial
 myservoR.attach(4); //Rightmost arm from point of view of the crab
 myservoRp.attach(5); //Right-sub-prime (right arm of the left crab)
 myservoL.attach(6); //Leftmost arm from point of view of the crab
 myservoLp.attach(7);// "Left-sub-prime" (left arm of the right crab)
void loop() {

 int delta = potCipher(analogRead(deltaPot))*2; //speed of the hammering
 Serial.print("delta: ");

 servoAndrew.write(80); //ARMS UP!!!

 andrewBeat = potCipher(analogRead(andrewPot));
 Serial.print("andrewBeat: ");

 danielBeat = potCipher(analogRead(danielPot));
 Serial.print("danielBeat: ");
 jakeBeat = potCipher(analogRead(jakePot));
 Serial.print("jakeBeat: ");

 leahBeat = potCipher(analogRead(leahPot));
 Serial.print("leahBeat: ");
 for (int i=0; i <= 400; i++){
 servoAndrew.write(getArmLoc(pos, andrewBeat)); 
 servoLeah.write(getArmLoc(pos, leahBeat)); 
 servoJake.write(getArmLoc(pos, jakeBeat));
 myservoR.write(abs(abs(80-pos)-80)); //This series SHOULD do 16th-notes, approximately... but it sounds a bit off, so my math might be wrong
 pos += delta;

 if (pos >= 160) pos=0;


int getArmLoc(int pos, int beatType) {
 if (beatType == 1) {
 return abs(abs(80-pos)-80);
 else if (beatType == 2) {
 return abs(abs(40-pos)-80);
 else if (beatType == 3) {
 return abs(abs(80-(abs(pos-60)))+100);
 else if (beatType == 4) {
 return abs(abs(80-(abs(pos-80)))+100);

// returns a potSection value based on the position of the pot
int potCipher(int potVal) {
 int potSection;
 if (potVal >= 0 && potVal <= 205) {
 potSection = 0; 
 else if (potVal >= 206 && potVal <= 410) {
 potSection = 1;
 else if (potVal >= 411 && potVal <= 615) {
 potSection = 2;
 else if (potVal >= 615 && potVal <= 820) {
 potSection = 3;
 else {
 potSection = 4;
 return potSection;

Reverse Caroling


We were inspired by the music of people going caroling from house to house where the visitor is the one that does the singing. But, what if we reverse who does the singing and instead have the house and person’s home do the caroling? Furthermore, what if the person who visits starts a song and then the person who’s home it is (who is answering the door) adds to that song in a duet or collaborative way? That’s what our caroling house does.

How it works:

  • A visitor walks up to the beginning of the path
  • The christmas lights light up the path
  • The visitor steps on the welcome mat
  • A song begins playing
  • The visitor presses the door bell
  • Snow falls from the gutter to create a wintery environment
  • The person who lives at the house answers the door. When they turn the doorknob, the song changes to a different octave adding to the duet.

Inputs used:

  • FSR (x3)
  • Potentiometer

Outputs used:

  • 6 LEDs
  • piezo speaker
  • servo motor to dump snow from the gutter

Materials used

  • FSR (x3)
  • Potentiometer
  • 6 LEDs
  • Piezo speaker
  • Servo motor
  • 3 Arduinos
  • 4 breadboards
  • 6 220k ohm resistors
  • 4 10k ohm resistor

Doorknob and Welcome Mat Code

// TONES ========================================== // Start by defining the relationship between
 // note, period, & frequency.
 #define C 523
 #define Db 554
 #define D 587 
 #define Eb 622
 #define E 659
 #define f 698 // Does not seem to like capital F
 #define Gb 740
 #define G 783
 #define Ab 830 
 #define A 880
 #define Bb 932
 #define B 988
 #define c_ 1046
 #define dd 1109
 #define d 1175
 #define eb 1244
 #define e 1318
 #define ff 1397
 #define gb 1480
 #define g 1568 
 // Define a special note, 'R', to represent a rest
 #define R 0
 // SETUP ============================================
 // Set up speaker on a PWM pin (digital 9, 10 or 11)
 int speakerOut = 9;
 int FSRPin = A0;
 int potPin = A1;
 int valFSR = 0;
 int valPot = 0;
 int i = 0;
 // Do we want debugging on serial out? 1 for yes, 0 for no
 int DEBUG = 1;
 void setup() {
 pinMode(speakerOut, OUTPUT);
 if (DEBUG) {
 Serial.begin(9600); // Set serial out if we want debugging
 // MELODY and TIMING =======================================
 // melody[] is an array of notes, accompanied by beats[],
 // which sets each note's relative length (higher #, longer note)
 int melody1a[] = {E, E, E,R,
 E, E, E,R,
 E, G, C, D, E, R,
 f, f, f,f, f, E, E,E, E, D ,D,E, D, R, G ,R,
 E, E, E,R,
 E, E, E,R,
 E, G, C, D, E, R,
 f, f, f,f, f, E, E, E, G,G, f, D, C,R, G, R }; 
 int melody1b[] = {B, B, B,R,
 B, B, B,R,
 B, D, G, A, B, R,
 C, C, C,C, C, B, B,B, B, D ,D,C, A, R, G ,R,
 B, B, B,R,
 B, B, B,R,
 B, D, G, A, B, R,
 C, C, C,C, C, B, B,B, B, D ,D,C, A, R, G ,R };
 //put melody 2a and 2b here 
 int melody2a[] = {E,R, R, R,
 f, E, Eb, E, 
 f, R, R, R, 
 Gb, G, R, R,
 R, A, B, c_, 
 d, c_, B, A, 
 G,R, R, R,
 E,R, R, R,
 f, E, Eb, E, 
 f, R, R, R, 
 Gb, G, R, R,
 R, A, B, c_, 
 d, c_, B, A, 
 G,R, R, R};
 int melody2b[] = {A, R, R, R,
 B, A, Ab, A,
 Bb, R, R, R, 
 B, c_, R, R,
 R, d, e, f, 
 g, f, e, d,
 c_, R, R, R,
 A, R, R, R,
 B, A, Ab, A,
 Bb, R, R, R, 
 B, c_, R, R,
 R, d, e, ff, 
 g, ff, e, d,
 c_, R, R, R};
// int MAX_COUNT1 = sizeof(melody1) / 2; // Melody length, for looping.
// int MAX_COUNT2 = sizeof(melody2) / 2;
 // Set overall tempo
 long tempo = 10000;
 // Set length of pause between notes
 int pause = 1000;
 // Loop variable to increase Rest length
 int rest_count = 100; //<-BLETCHEROUS HACK; See NOTES
 // Initialize core variables
 int tone_ = 0;
 int beat = 0;
 long duration = 0;
 // PLAY TONE ==============================================
 // Pulse the speaker to play a tone for a particular duration
 void playTone() {
 long elapsed_time = 0;
 if (tone_ > 0) { // if this isn't a Rest beat, while the tone has
 // played less long than 'duration', pulse speaker HIGH and LOW
 while (elapsed_time < duration) {
 delayMicroseconds(tone_ / 2);
 // DOWN
 digitalWrite(speakerOut, LOW);
 delayMicroseconds(tone_ / 2);
 // Keep track of how long we pulsed
 elapsed_time += (tone_);
 else { // Rest beat; loop times delay
 for (int j = 0; j < rest_count; j++) { // See NOTE on rest_count
 void playNote(int melody[]) {
 tone_ = melody[i];
 beat = 50;
 duration = beat * tempo;
 // LET THE WILD RUMPUS BEGIN =============================
 void loop() {
 valFSR = analogRead(FSRPin); // read value from the sensor
 valPot = analogRead(potPin);
// int *melody = melody1; ///fix later
 if (valFSR >= 10 && valFSR < 500 ){ 
 if (valPot < 10) {
 int *melody = melody1a;
 } else {
 int *melody = melody1b; //move to duet
 if (valFSR >= 500 ){ 
 if (valPot < 10) {
 int *melody = melody2a;
 } else {
 int *melody = melody2b; //move to duet
// playNote(melody);
// if (valFSR >= 500) { //second song
// Serial.println(valFSR);
// int *melody = melody1a;
// playNote(melody);
// i++;
// }
// if (i%60 == 0) {
// i = 0;
// }

<img class="alignnone size-medium wp-image-2088" src="https://blogs.ischool.berkeley.edu/i262/files/2016/11/IMG_7584-300x225.jpg" alt="img_7584" width="300" height="225" />

The Jukebox

We created a musical instrument that focuses on manipulating MIDI files.

The basic idea of the instrument is to enable users to play musical variations of songs in almost infinite combinations of tempo, attack, decay and release.

Three potentiometers correlate to three transformations based on ASDR, which stands for attack, sustain, decay and release. We altered the attack decay and release which allowed a person using the device to create the variations.

  • Attack time is the time taken for initial run-up of level from nil to peak, beginning when the key is first pressed. We mapped 1024 values of the potentiometer to 0 – 1.5s.
  • Decay time is the time taken for the subsequent run down from the attack level to the designated sustain level. We mapped 1024 values of the potentiometer to 0-1.5s.
  • Sustain level is the level during the main sequence of the sound’s duration, until the key is released. We kept this constant at 1.5
  • Release time is the time taken for the level to decay from the sustain level to zero after the key is released. We mapped 1024 values of the potentiometer to 0-1.5s.




Logic used:
1. Set a MIDI playback with set envelope
2. Store a recorded fragment and loop over the recorded fragment
Original Authors: Multiple contributors to Minim
New authors: Neera Grover, Vivian Liu, Sandeep Pal and Ganesh Iyer
import ddf.minim.*;
import ddf.minim.ugens.*;
import javax.sound.midi.*;
Minim minim;
// Sequencer objects – one for base and one for loop
Sequencer base;
Sequencer loop;
Sequence baseSequence;
Sequence backingLoop;
// For recording loops
AudioInput loopIn;
AudioRecorder loopRecorder;
// For playback
AudioOutput out;
AudioPlayer player;
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int ledPin = 13;
int val;
int val1;
int val2;
int val3;
int val4;
void setup(){
size(512, 200, P3D);
minim = new Minim(this);
/**Connecting arduino to Processing.*/
arduino = new Arduino(this, Arduino.list()[1], 57600);
arduino.pinMode(ledPin, Arduino.OUTPUT);
arduino.pinMode(0, Arduino.INPUT); //(A0=0)
// need to set variable loopIn to something that records or reuses a sample
// right now, the issue is that it always picks up what the microphone records
loopIn = minim.getLineIn();
// getLineIn seems to be the biggest problem
// How does one use the audio generated by the computer itself as a fragment to loop over?
// enable monitoring seems to do absolutely nothing for this cause. causes feedback. some interesting sound though.
loopRecorder = minim.createRecorder(loopIn, currentLoop.wav);
// out is playing the minim object back to us
out = minim.getLineOut(Minim.MONO);
// get a disconnected sequencer. this should prevent
// us from hearing the general midi sounds the
// sequecer is automatically hooked up to.
base = MidiSystem.getSequencer( false );
// have to open it
// load our sequence
baseSequence = MidiSystem.getSequence( createInput( bach.midi ) );
// put it in the sequencer
base.setSequence( baseSequence);
// hook up an instance of our Receiver to the Sequencer’s Transmitter
base.getTransmitter().setReceiver( new MidiReceiver() );
// just keep looping
//base.setLoopCount( Sequencer.LOOP_CONTINUOUSLY );
// and away we go
// Hello Vivian!
catch( MidiUnavailableException ex ) // getSequencer can throw this
// oops there wasn’t one.
println( No default sequencer, sorry bud. );
catch( InvalidMidiDataException ex ) // getSequence can throw this
// oops, the file was bad
println( The midi file was hosed or not a midi file, sorry bud. );
catch( IOException ex ) // getSequence can throw this
println( Had a problem accessing the midi file, sorry bud. );
class MidiReceiver implements Receiver
void close() {}
void send( MidiMessage msg, long timeStamp )
// we only care about NoteOn midi messages.
// here’s how you check for that
if ( msg instanceof ShortMessage )
ShortMessage sm = (ShortMessage)msg;
// if you want to handle messages other than NOTE_ON, you can refer to the constants defined in
// ShortMessage: http://docs.oracle.com/javase/6/docs/api/javax/sound/midi/ShortMessage.html
// And figure out what Data1 and Data2 will be, refer to the midi spec: http://www.midi.org/techspecs/midimessages.php
if ( sm.getCommand() == ShortMessage.NOTE_ON )
// note number, between 1 and 127
int note = sm.getData1();
// velocity, between 1 and 127
int vel = sm.getData2();
// we could also use sm.getChannel() to do something different depending on the channel of the message
// see below the draw method for the definition of this sound generating Instrument
out.playNote( 0, 0.1f, new Synth( note, vel ) );
class Synth implements ddf.minim.ugens.Instrument
Oscil wave;
Damp env;
int noteNumber;
Synth( int note, int velocity )
noteNumber = note;
float freq = Frequency.ofMidiNote( noteNumber ).asHz();
float amp = (float)(velocity1) / 126.0f;
wave = new Oscil( freq, amp, Waves.QUARTERPULSE );
// Damp arguments are: attack time, damp time, and max amplitude
env = new Damp( 0.01f, 0.5f, 1.0f );
// writing code for looping
wave.patch( env );
void noteOn( float dur )
// make sound
env.patch( out );
void noteOff()
env.unpatchAfterDamp( out );
void draw(){
val = arduino.analogRead(0);
val1 = arduino.analogRead(1);
val2 = arduino.analogRead(2);
val3 = arduino.analogRead(3);
val4 = arduino.analogRead(4);
// set the tempo
if ((val/4) < 250)) {
base.setTempoInBPM( val/4 );
base.setLoopCount(val2 % 10);
//set loops
println(val1 * 8);
//loopcount isn’t working out
//if we get above the tick position of 20000, go back to 10000 and play again
if ((base.getTickPosition()) > 20000 (val1 * 8)) {
// Code snippet to draw waves
// draw the waveforms
// the values returned by left.get() and right.get() will be between -1 and 1,
// so we need to scale them up to see the waveform
for(int i = 0; i < loopIn.left.size()1; i++)
line(i, 50 + loopIn.left.get(i)*50, i+1, 50 + loopIn.left.get(i+1)*50);
line(i, 150 + loopIn.right.get(i)*50, i+1, 150 + loopIn.right.get(i+1)*50);
// end code snippet to draw waves

How awake am I?

I was sick for this lab, so I decided to see just how awake I was in bed. I decided to graph how much pressure I was applying to my husband pillow (that’s honestly what it’s called). The more pressure, the more likely I was asleep/resting.


  • FSR
  • Jumper wires
  • Resistor
  • Breadboard
  • Arduino

Arduino Code:

<span class="coMULTI">The circuit:
 Any analog input sensor is attached to analog in pin 0.

 created 2006
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe and Scott Fitzgerald

 This example code is in the public domain.


<span class="kw1">void</span> <span class="kw3">setup</span><span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
  <span class="co1">// initialize the serial communication:</span>
  <span class="kw1">Serial</span>.<span class="kw1">begin</span><span class="br0">(</span><span class="nu0">9600</span><span class="br0">)</span><span class="sy0">;</span>
<span class="br0">}</span>

<span class="kw1">void</span> <span class="kw3">loop</span><span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
  <span class="co1">// send the value of analog input 0:</span>
  <span class="kw1">Serial</span>.<span class="kw1">println</span><span class="br0">(</span><span class="kw1">analogRead</span><span class="br0">(</span>A0<span class="br0">)</span><span class="br0">)</span><span class="sy0">;</span>
  <span class="co1">// wait a bit for the analog-to-digital converter</span>
  <span class="co1">// to stabilize after the last reading:</span>
  <span class="kw1">delay</span><span class="br0">(</span><span class="nu0">2</span><span class="br0">)</span><span class="sy0">;</span>
<span class="br0">}</span>

Processing Code:

import processing.serial.*;
 String portname = "/dev/cu.usbmodem1421"; // or "COM5"
 Serial port;
 String buf="";
 int cr = 13; // ASCII return == 13
 int lf = 10; // ASCII linefeed == 10

int serialVal = 0;
 float xPos = 0; // horizontal position of the graph
 float yPos = 0; // vertical position of the graph

void setup() {
 size(800,600); // window size
 // List all the available serial ports
 port = new Serial(this, portname, 9600);

void serialEvent (Serial myPort) {
 // get the byte:
 int inByte = myPort.read();
 // print it:
 yPos = height - inByte;

void draw () {
 // draw the line in a pretty color:
 line(xPos, height, xPos, yPos);
 // at the edge of the screen, go back to the beginning:
 if (xPos &gt;= width) {
 xPos = 0;
 // clear the screen by resetting the background:
 } else {
 // increment the horizontal position for the next reading:


The One Man Show


In our endeavour to make a sonorous musical instrument, we wanted to explore the sounds different materials make on being impinged. We started with a lamp screen and brainstormed ideas around what role it could play in an interactive musical instrument. Someone suggested that it could represent a caricature of a one man band, replete with arms and legs. It sounded like a great idea and we we forged ahead with it.

We are using 4 Arduinos to control 4 Servo motors. Two of the motors are responsible for controlling the rattle and the maraca, which manifest themselves in the form of arms. The third motor controls the bobbing head, while the fourth one is responsible for impinging the tin lamp screen from the inside.

Materials used

  • Balloon
  • Cardboard
  • 4 Arduinos
  • 4 Breadboards
  • Wires
  • Pipe cleaners
  • Popsicle sticks
  • Masking tape
  • Lamp screen
  • Thread

* Servo with Potentiometer control
* Theory and Practice of Tangible User Interfaces
* Nisha, Elena and Mudit are using the same code

int servoPin = 7; // Control pin for servo motor
int potPin = 0; // select the input pin for the potentiometer

int pulseWidth = 0; // Amount to pulse the servo
long lastPulse = 0; // the time in millisecs of the last pulse
int refreshTime = 20; // the time in millisecs needed in between pulses
int val; // variable used to store data from potentiometer

int minPulse = 500; // minimum pulse width

void setup() {
pinMode(servoPin, OUTPUT); // Set servo pin as an output pin
pulseWidth = minPulse; // Set the motor position to the minimum
Serial.begin(9600); // connect to the serial port
Serial.println("servo_serial_better ready");

void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024

if (val &gt; 0 &amp;&amp; val &lt;= 999 ) { pulseWidth = val*2 + minPulse; // convert angle to microseconds Serial.print("moving servo to "); Serial.println(pulseWidth,DEC); } updateServo(); // update servo position } // called every loop(). void updateServo() { // pulse the servo again if the refresh time (20 ms) has passed: if (millis() - lastPulse &gt;= refreshTime) {
digitalWrite(servoPin, HIGH); // Turn the motor on
delayMicroseconds(pulseWidth); // Length of the pulse sets the motor position
digitalWrite(servoPin, LOW); // Turn the motor off
lastPulse = millis(); // save the time of the last pulse

Sam's code

int servoPin = 7; // Control pin for servo motor
int lightSensorPin = 0; // input for light sensor

int pulseWidth = 0; // Amount to pulse the servo
long lastPulse = 0; // the time in millisecs of the last pulse
int refreshTime = 20; // the time in millisecs needed in between pulses
int val; // variable used to store data from serial port
long lastUpdate = 0; // last update of ring

int minPulse = 500; // minimum pulse width
int maxPulse = 2250; // maximum pulse width
int lightLimit; // calibrated limit for light

void setup() {
pinMode(servoPin, OUTPUT); // Set servo pin as an output pin
pulseWidth = 1156; // Set the motor position to the minimum
Serial.begin(9600); // connect to the serial port
Serial.println("Servo control program ready");
val = analogRead(lightSensorPin);
lightLimit = val - 100; // calibrated light

void loop() {
val = analogRead(lightSensorPin); // read the value from the sensor, between 0 - 1024
// Ring bell
if (val &lt; lightLimit) {
pulseWidth = 1400;
lastUpdate = millis();
while (millis() - lastUpdate &lt;= 200) { updateServo(); } pulseWidth = 1156; } updateServo(); // update servo position } // called every loop(). // uses global variables servoPi, pulsewidth, lastPulse, &amp; refreshTime void updateServo() { // pulse the servo again if rhe refresh time (20 ms) have passed: if (millis() - lastPulse &gt;= refreshTime) {
digitalWrite(servoPin, HIGH); // Turn the motor on
delayMicroseconds(pulseWidth); // Length of the pulse sets the motor position
digitalWrite(servoPin, LOW); // Turn the motor off
lastPulse = millis(); // save the time of the last pulse

Video: https://drive.google.com/a/berkeley.edu/file/d/0B7JCq5np49-7S1hZRVIzOVJjLXc/view?usp=sharing




Cacophony of sounds!

Team: Molly, Yifei, Olivia, Owen, Michelle


For this assignment, our team tried explore how to get motors to operate and manipulate musical instruments that we easily are able to play as humans. For this, we explored the claves, kalimba, egg shakers, bell kit, and tambourine. We first tried having servos operate the claves, but this proved to be too much of a challenge since we need to hold the claves at the point and allow them to resonate, which is something we do easily when we hold them with our hands, but not with a servo. We also looked into making noise on the kalimba using ear plugs on servos (which mimic human fingers), but the sliding motion with adjusting pressure was too difficult. We also tried using the egg shaker and a coffee cup full of beans using a DC motor or servo, but we found that the shaking beads just went towards the edge of the shaker container.

We then explored different ways to get servo motors to hit mallets on a bell kit. We noticed that if we allow for a little bit of “give” to allow a bounce on the key, rather than directly hitting the key and dampening the sound, we got a better sound. We made a “competitive game” out of the instrument: we attached two servos to the mallets and allow two player to operate pots to change the percussive nature of the mallets and instruments.

We also explored using a DC motor on a tambourine. We found if we attached tape at different diameters, we can change the amount it hits the bells. We decided to change this with a potentiometer as well.
We also decided to explore a visual medium on processing, where if you click and move the mouse – depending on how slow and fast you go, the visual component and the sound changes.

In the end we decided on having servo motors (controlled by pots) hit the bell kit and kalimba, a DC motor (controlled by pot) operate the tambourine, and a processing script on a computer. Our 4 inputs are: 2 pots for the mallets, 1 pot for the tambourine, and 1 mouse for machine. We created a fun noise game where we all contribute a part to create a cacophony of sounds!

Materials used:

  • Bell Kit
  • Tambourine
  • Kalimba
  • Computer (mouse input, processing)
  • 2x Arduino uno
  • 3x pot
  • 2x servo
  • 1x 1k resistor
  • 1x transistor
  • 1x diode
  • 1x DC motor
  • 1x battery pack

Vimeo URL to Demo video


Code for Processing

Maxim maxim;
AudioPlayer player;
AudioPlayer player2;
void setup()
  size(640, 960);
  maxim = new Maxim(this);
  player = maxim.loadFile("atmos1.wav");
  player2 = maxim.loadFile("bells.wav");
void draw()
void mouseDragged()
  float red = map(mouseX, 0, width, 0, 255);
  float blue = map(mouseY, 0, width, 0, 255);
  float green = dist(mouseX,mouseY,width/2,height/2);
  float speed = dist(pmouseX, pmouseY, mouseX, mouseY);
  float alpha = map(speed, 0, 20, 0, 10);
  float lineWidth = map(speed, 0, 10, 10, 1);
  lineWidth = constrain(lineWidth, 0, 10);
  fill(0, alpha);
  rect(width/2, height/2, width, height);
  stroke(red, green, blue, 255);
  //rect(mouseX, mouseY, speed, speed);
  line(pmouseX, pmouseY,mouseX, mouseY);
  //brush1(mouseX, mouseY,speed, speed,lineWidth);
  //brush2(mouseX, mouseY,speed, speed,lineWidth);
  //brush3(mouseX, mouseY,speed, speed,lineWidth);
  //brush4(pmouseX, pmouseY,mouseX, mouseY,lineWidth);
  //brush5(pmouseX, pmouseY,mouseX, mouseY,lineWidth);
  //brush6(mouseX, mouseY,speed, speed,lineWidth);
  //brush7(pmouseX, pmouseY,mouseX, mouseY,lineWidth);
  player.setFilter((float) mouseY/height*5000,mouseX / width);
  //player2.setFilter((float) mouseY/height*5000,mouseX / width);
  player2.speed((float) mouseX/width/2);
void mouseReleased()

Code for 2x Servos for bell kit, controlled by pot

 * Servo with Potentiometer control
 * Theory and Practice of Tangible User Interfaces
 * October 11 2007
int servoPin1 = 4;      // Control pin for servo motor
int servoPin2 = 5;
int potPin1 = A1;      // select the input pin for the potentiometer
int potPin2 = A2;
int pulseWidth1 = 0;    // Amount to pulse the servo
int pulseWidth2 = 0; 
long lastPulse = 0;    // the time in millisecs of the last pulse
//long lastPulse2 = 0;
int refreshTime = 20;  // the time in millisecs needed in between pulses
int val1;               // variable used to store data from potentiometer
int val2;
int minPulse = 500;   // minimum pulse width
void setup() {
  pinMode(servoPin1, OUTPUT);  // Set servo pin as an output pin
  pinMode(servoPin2, OUTPUT);
  pulseWidth1 = minPulse;      // Set the motor position to the minimum
  pulseWidth2 = minPulse;
  Serial.begin(9600);         // connect to the serial port
  Serial.println("servo_serial_better ready");
void loop() {
  val1 = analogRead(potPin1);    // read the value from the sensor, between 0 - 1024
  if (val1 > 0 && val1 <= 999 ) {
    pulseWidth1 = val1*2 + minPulse;  // convert angle to microseconds
    Serial.print("moving servo to ");
  updateServo1();   // update servo position
  val2 = analogRead(potPin2);
  if (val2 > 0 && val2 <= 999 ) {
    pulseWidth2 = val2*2 + minPulse;  // convert angle to microseconds
    Serial.print("moving servo to ");
  updateServo2();   // update servo position
// called every loop(). 
void updateServo1() {
  // pulse the servo again if the refresh time (20 ms) has passed:
  if (millis() - lastPulse >= refreshTime) {
    digitalWrite(servoPin1, HIGH);   // Turn the motor on
    delayMicroseconds(pulseWidth1);  // Length of the pulse sets the motor position
    digitalWrite(servoPin1, LOW);    // Turn the motor off
   lastPulse = millis();           // save the time of the last pulse
void updateServo2() {
  // pulse the servo again if the refresh time (20 ms) has passed:
  if (millis() - lastPulse >= refreshTime) {
    digitalWrite(servoPin2, HIGH); 
    digitalWrite(servoPin2, LOW); 
    lastPulse = millis();           // save the time of the last pulse

Code for DC motor controlled by Pot

 * one pot fades one motor
 * modified version of AnalogInput
 * by DojoDave <http://www.0j0.org>
 * http://www.arduino.cc/en/Tutorial/AnalogInput 
 * Modified again by dave

int potPin = 0;   // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int val = 0;      // variable to store the value coming from the sensor
void setup() {
void loop() {
  val = analogRead(potPin);    // read the value from the sensor, between 0 - 1024
  analogWrite(motorPin, val/4); // analogWrite can be between 0-255

Spookoo Clock

Video:  https://youtu.be/ukvsB9rwcKE


Our group’s ideas ranged far and wide for this one, but after considerable debate we realized we wanted to create a project with at least the following characteristics:

  1. Halloween themed, with a
  2. Nontraditional door, and which
  3. Respects the cuckoo-clock MO

With these parameters in mind our project became clear to all of us all at once: an egg that hatches a skeleton cuckoo bird through an egg shell door.

We started with a cardboard model, which we then measured and recreated in Fusion 360. For our hinge and door mechanism we decided to employ a “living hinge” design that we laser cut from plywood. We actuated the door with a gear and crank glued to the inside of the box, and added a second gear to drive a rack at the base of our bird design. As the gears turn the bird is propelled upwards and the lid opens.

We had some ideas about how to give the bird some personality, too, by having it “peep” when it reached the top of its stroke. We were able to do this on a timer, and had plans to incorporate a microphone so that a loud noise would startle the bird out of its shell. While we did include the mic in our schematic, a little more work is needed on the code to get that particular functionality set up.


Plywood, 1/8″

Small servo motor


Arduino Uno

Wood glue

Machine screws

SparkFun Mic


Piezo Speaker



/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.

modified 8 Nov 2013
by Scott Fitzgerald

#include <Servo.h>

Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position
const int sampleWindow = 250; //250 MS sample width
unsigned int loudNoise;
int speakerPin = 7;
int val = 0;
int orig = 0;
int potPin = 0;
void setup()
pinMode(speakerPin, OUTPUT);
myservo.attach(9); // attaches the servo on pin 9 to the servo object

void loop() {
unsigned long start= millis(); // start of sample window
unsigned int peakToPeak = 0; // peak-to-peak level
unsigned int signalMax = 0;
unsigned int signalMin = 1024;

while (millis() – start < sampleWindow) // collecting data for 250 MS (can be changed)
loudNoise = analogRead(0);
if (loudNoise < 1024) //
if (loudNoise > signalMax) // if there’s a loud noise, save the loud value
signalMax = loudNoise;
else if (loudNoise < signalMin) // if there’s not a loud noise, don’t save the loud value
signalMin = loudNoise;

peakToPeak = signalMax – signalMin; // max – min = peak-peak amplitude
double volts = (peakToPeak * 3.3) / 1024; // convert to volts
Serial.println(volts); // to know if the mic is working

// digitalWrite(speakerPin, LOW);

//val = analogRead(potPin); // read value from the sensor
//val = val*30; // process the value a little
//val = val/2; // process the value a little

if (volts >=1.0){
for( int i=0; i<50; i++ ) { // play it for 50 cycles
for(pos = 180; pos>=0; pos-=9) // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position

for(pos = 0; pos <= 180; pos += 3) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(80); // waits 15ms for the servo to reach the position
for(int j=0; j<50; j++){

digitalWrite(speakerPin, HIGH);
digitalWrite(speakerPin, LOW);

//if (volts >=1.0) {

// delay(2000); // for a certain amount of time (though this could be modified for more expressive behavior)
// Serial.println(“YELLING AT US”);
// }
// else {
// digitalWrite(12, LOW);
// digitalWrite(2, LOW); //not yetlling at us
// };
else {


Amazon Box Cuckoo Clock

Team: Neera, Olivia, Mudit, Michelle

We built a cuckoo clock out of an Amazon box. The basic idea is that the bird sits on a stick arrangement that has a rubber band attached to it. When the stick is pushed outward, it pushes the door open and the rubberband slacks. On the other hand, when the stick is pulled back in, the rubber band gets stretched and pulls the door shut due to the tension it develops. We built rails around the stick to guide it more accurately and allow for more control in addition to smoother operation.

We are happy that we were able to overcome Design Fixation in our design as the concept and the look are quite different from the sample we saw in class. We approached the problem afresh from the grassroot level and figured out the whole mechanism. This realization became even more prominent when we were made aware that our cuckoo clock has just one door unlike the one in shown in class which had two doors. We had a lot of fun putting it together and are excited to share it at the showcase tomorrow.

Cuckoo Clock TUI

make action GIFs like this at MakeaGif

Release the Kraken

Group Members:
Vivian Liu
Elena Duran
Andrew Chong

For our cuckoo clock, we built a simple reverse linkage to translate the backwards motion into sending the bird forward. Vivian used the laser-cutter to get the wood in the dimensions we needed, and drilled holes to put in the pivots. We attached it to the box by threading through the hole with chopsticks. We also added chopsticks (and pipe-cleaners) so that the linkage didn’t shift up, down, left or right too much.

We played around with different configurations until we decided to flip the box around and have the door open outwards and up (kind of like a pen where you would keep an animal). We had a lot of difficulty translating the backwards motion into the more diagonal motion of the string, and added little wheel pulleys along the top to help adjust the direction and motion of the string to the right angle.

We also experimented with rubber bands to have the clock “reset” itself automatically, so that our pulling motion would create tension in the rubber band, returning to its original position once we let go.