Daniel Rowlands Physical computing project 2- Complex Arduino theremin.

After deciding to continue with a theremin, I looked into various ways of making the project more complex. After experimenting with different types of sensor, I decided to add an ultrasonic distance sensor to control the volume of the sound output. I did some research into coding an ultrasonic sensor to control volume, but quickly realised that it would not be easy so I would have to find an alternative way of doing it.

I knew that using a potentiometer to control volume was easy, so I wanted to know if I could somehow control a potentiometer using an ultrasonic sensor. While looking into it I found a project where someone had used a servo to turn a potentiometer, so I decided to use my ultrasonic sensor to control a servo which would turn a potentiometer.



final theremin diagram_bb

After building the project I needed to write the code as there was no code with the project online,

After looking around for a while I found bits and bobs that I could use to code my project, I used some ultrasonic sensor code from instructables.


Most of the rest of the code was found in various places online, although it needed a lot of modifying after to get it to upload. Once I managed to upload the code I had a lot of trouble trying to get the values right so that the volume range would be sufficient.

#include <NewPing.h>
#include <Servo.h>
#define trigpin 2
#define echopin 4
#define MAX_DISTANCE 300
NewPing sonar(trigpin, echopin, MAX_DISTANCE);

Servo myservo;

int val;

int prPin = 0;

int prReading;

int buzzerPin = 5;

long buzzerFreq;

long BUZZ_FREQ_MAX = 2500;

long PR_MAX = 1023;

//trin n echo pin se

void setup() {
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
pinMode(buzzerPin, OUTPUT);

void loop() {
prReading = analogRead(prPin);

buzzerFreq = (prReading * BUZZ_FREQ_MAX) / PR_MAX;

buzz(buzzerPin, buzzerFreq, 10);

unsigned int uS = sonar.ping();
Serial.print(“Ping: “);
Serial.print(uS / US_ROUNDTRIP_CM);
unsigned int cm = uS / US_ROUNDTRIP_CM;
if(cm >= 45) {
val= 115;
if(cm <= 39) {
val= 170;
if(cm <= 37) {
val= 170;
if(cm <= 33) {
val= 170;
if(cm <= 29) {
val= 170;
if(cm <= 27) {
val= 170;
if( cm <= 25) {
val = 170;
if(cm <= 24) {
val= 165;
if(cm <= 22) {
val= 160;
if(cm <= 20) {
val= 155;
if(cm <= 18) {
val= 150;
if(cm <= 16) {
val= 145;
if(cm <= 14) {
val= 140;
if(cm <= 12) {
val= 135;
if(cm <= 10) {
val= 130;
if(cm <= 8) {
val= 125;
if(cm <= 6) {
val= 120;
if(cm <= 4) {
val= 115;


void buzz(int targetPin, long frequency, long length) {

long delayValue = 5000000/frequency/2;

long numCycles = frequency * length/ 1000;

for (long i=0; i < numCycles; i++){






Once I had everything working I simply made a cylindrical container for the theremin, added a switch and made some simple instructions and plugged in a large speaker driver as the one I had was far to quiet.

.presentation board


Final Arduino project :: Michael White

For my final project i decided to develop my keyboard idea.

I really wanted to make something that used synthy sounds, but after poking around on forums and blogs, i found that the coding was extremely out of my league. This led me to just developing a piezo keyboard, attempting to play multiple tones at the same time.

For this I researched different libraries, the tone.h library, using this forum entry to help with code, i tried developing my own simple keyboard, using 4 separate speakers to correspond with 4 buttons.

I first included the tone.h library and defined the pins and speakers (I included a potentiometer in the variables because i wanted to develop the idea to change the scale depending on the position of the potentiometer) :

#include <Tone.h>

int button1 = 2;
int button2 = 3;
int button3 = 4;
int button4 = 5;
int button5 = 7;
int button6 = 8;
int potPin = A0;
Tone speaker1;
Tone speaker2;
Tone speaker3;
Tone speaker4;

In the void setup(), from looking at the tone.h wiki page and forums I found that i had to “start” the speakers using the speakerX.begin(Y); function. This declared the pin number of each speaker. essentially this is an alternative to using the tone() function, but (apparently) allowed multiple tones to be played simultaneously.
I also had to declare the pinMode() of each button.

void setup() {
pinMode(button1, INPUT);
pinMode(button2, INPUT);
pinMode(button3, INPUT);
pinMode(button4, INPUT);
pinMode(button5, INPUT);
pinMode(button6, INPUT);

The void loop() basically told the all the speakers to play a different tone when one button is pressed, depending on the button it played a different chord, each of which i chose by playing french/gypsy-esque chords. they are seen within the if() statments of the buttons. Each note has a name (eg. NOTE_A4) which, within the tone.h library, refers to a number representing the frequency of the note.

I also used the map() function to limit the potentiometer to [potentially] use 5 different scales.
void loop() {
int key = analogRead(potPin);
key = map(key, 0, 1023, 0, 4);
int state1 = digitalRead(button1);
int state2 = digitalRead(button2);
int state3 = digitalRead(button3);
int state4 = digitalRead(button4);
int state5 = digitalRead(button5);
int state6 = digitalRead(button6);

int note1;
int note2;
int note3;
int note4;

if(state1 == HIGH && state2 == LOW && state3 == LOW && state4 == LOW){

if(state1 == LOW && state2 == HIGH && state3 == LOW && state4 == LOW){
if(state1 == LOW && state2 == LOW && state3 == HIGH && state4 == LOW){
if(state1 == LOW && state2 == LOW && state3 == LOW && state4 == HIGH){

Unfortunately, after days of tinkering and forum posting, my code still didn’t work, up until the night prior to the deadline. I was lost. Scared even. I had nothing. I curled into a ball on my bed and wept, for what felt like an eternity. falling endlessly into a pit of self loathing. I realised i couldn’t hand in nothing so i browsed and browsed. I found a really cool piece of code. This was for a capacitive keyboard synthesizer. The hardware required 8 strips of copper tape as the keys. To adapt this i used screws as keys attached to rigid wires, allowing the screws to stick out in all direction making for a fun exciting use. I made a chord with 4 of the keys and had these keys sticking out further to when a hand is placed over the whole keyboard, only these notes play. the screws worked really well.

Instead of using a piezo speaker i used a larger speaker.

First Arduino Project :: Michael White

My attempt at an Arduino keyboard. My development process will be posted shortly as well, but this is what I’ve ended up with.

I assigned each note based on a chord (something like C diminished with a B and a G).

Photo 2015-02-22 21.54.37

Gave it a test with my housemate, turns out my construction (and my playing) isn’t brilliant, still happy with it on the whole though.

Test jam

Doesn’t really go with the song but this is what the circuit looks like.

Circuit view

For my final keyboard i used the code as follows.
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978
const int buttonLow = 2; //pin number of low frequency arpeggio
const int buttonMed = 3; //pin number of medium frequency arpeggio
const int buttonHi = 4; // pin number of high frequency arpeggio
const int sensorMin = 0;
const int sensorMax = 600;
int Buzzer1 = 9; // pin number of buzzer
int ledLow = 11;
int ledMed = 12;
int ledHi = 13;
int lowState = 0;
int medState = 0;
int hiState = 0; // variable for reading each buttons status
int potPin = 2;
int pitch;
int range;
int tempo = 300;
void setup() {
pinMode(Buzzer1, OUTPUT); //set buzzer as an output
pinMode(buttonLow, INPUT); //set buttons as input
pinMode(buttonMed, INPUT);
pinMode(buttonHi, INPUT);
pinMode(ledLow, OUTPUT);
pinMode(ledMed, OUTPUT);
pinMode(ledHi, OUTPUT);


void loop(){
pitch = analogRead(potPin);
pitch = map(pitch, 0, 1023, 0, 100);
lowState = digitalRead(buttonLow); //assign each state to its corresponding button
medState = digitalRead(buttonMed);
hiState = digitalRead(buttonHi);
int sensorReading = analogRead(A5);
int range = map(sensorReading, sensorMin, sensorMax, 0, 1);

if (lowState == HIGH && medState == LOW && hiState == LOW){ //if ONLY buttonLow is pressed

//play this 3 note arpeggio (notes found arduino.cc/tutorial/tone)
digitalWrite(ledLow, HIGH);
digitalWrite(ledLow, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);
digitalWrite(ledHi, HIGH);
digitalWrite(ledHi, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);
if (lowState == LOW && medState == HIGH && hiState == LOW) { //same function for when only medium button is pressed

digitalWrite(ledLow, HIGH);
digitalWrite(ledLow, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);
digitalWrite(ledHi, HIGH);
digitalWrite(ledHi, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);
if (lowState == LOW && medState == LOW && hiState == HIGH) { //again for high button

digitalWrite(ledLow, HIGH);
digitalWrite(ledLow, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);
digitalWrite(ledHi, HIGH);
digitalWrite(ledHi, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);

if (lowState == HIGH && medState == HIGH && hiState == LOW){ //if BOTH buttonLow AND buttonMed is pressed

digitalWrite(ledLow, HIGH);
digitalWrite(ledLow, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);
digitalWrite(ledHi, HIGH);
digitalWrite(ledHi, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);

if (lowState == LOW && medState == HIGH && hiState == HIGH){ //if BOTH buttonHi AND buttonMed is pressed

digitalWrite(ledLow, HIGH);
digitalWrite(ledLow, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);
digitalWrite(ledHi, HIGH);
digitalWrite(ledHi, LOW);
digitalWrite(ledMed, HIGH);
digitalWrite(ledMed, LOW);

Daniel Rowlands, Arduino theremin post 1

For my first physical computing project I wanted to create something fun and interactive, whilst still being complex enough to push myself with the coding. After looking at different types of output, I decided that sound would suit my project.

I had been fascinated by theremins for a while, so I decided to look into creating an arduino theremin. After looking around for a while I found a project where someone had used a photo resistor to control the pitch of the sound output. To make the project a little more complicated I added a potentiometer to control the volume.

IMAG0589theramin v1 diagram

I managed to find some code for the project online, but I modified the values and added a bit to give me the output I wanted.

I was pleased with how the theremin worked, so I decided to continue with a version 2 of the theremin for part 2 of my project.


After being introduced to Arduino and the musical and led mini project, I decided to progress on along the same lines, combining Led’s and music with a more accurate reaction and interactive element.

I first researched into higher quality audio systems, looking at:



After researching into the compatible components that I could use I decided to use these components working around the idea of the neo pixel rings making a circle around one speaker, I later changed this as the neopixel strips turned out to be more expensive than anticipated as well as the decision to use two speakers for better sound quality.


A higher quality ultrasonic distance sensor for accurate distance evaluation.


A speaker and amp that are compatible with 20 W power ratings.



I also wanted to integrate an interactive side to the system where it would react to peoples presence using the ultrasonic distance sensor. I decided to use a subwoofer bass valve into the system, that when people stand in front of the system the subwoofer valve will open allowing more air to go into the speaker housing making the music bassier.



I also looked at more advanced code for creating a VU meter using neopixels


I first started the hardware hook-up with getting the speaker and amp working together.


I revisited the servo sweep code we looked at near the beginning of Arduino.


I next got the ultrasonic distance sensor reading of values with the example code.


Finally I combined the servo and ultrasonic distance sensor getting the servo to sweep between 0 and 90 degrees with threshold values.


Throughout the next few stages there are several iterations where I adjust settings with the gain and code hacked from the adafruit ‘amliptie’ code.



Trying to get the best reaction from the VU meter.

I next properly linked up the speaker and amp hardware with a potentiometer for volume and capacitor for current control.


Finally after playing with the settings the Vu meter started to look accurate with the music.


I next revisited the LDR code to get the LDR working with threshold values to, in the end act as a switch.


I then used a toggle switch to work with simple code for an on/off reaction with an led.


Even more adjustment to VU meter code…



And finally after some forum posting and searching I managed to solve my mirroring troubles by simply connecting the two pixel strips to the same pin.



Part 1 of combined code – Switch and LDR and working


Part 2 of combined code – Switch, LDR, Distance sensor and Servo working together


With part 3 of combing the code I had some issues with the vu meter reacting oddly with the servo, I first thought this was down to power, but it turns out it was a problem with the delay in the code confusing the vu meter code.


I also built the speaker housing out of 6mm acrylic and line bent it to shape to form the housing.


After posting in adafruit and Arduino forum for help, I managed to bug fix the issues with the vu meter and servo reacting oddly, by using a different servo library specially made for working with neopixels and also I had to remove all delays from the code which made the servo reaction a bit jumpy, a compromise.

Part 3 of combined code WORKING – Switch, LDR, DS and Servo with Mic and Neopixels


Finally I integrated the hardware into the speaker housing and hey presto!

This video shows all the features.


Finally just to show the accuracy of the VU meter reaction:


I really enjoyed second half of the project with more time to spend refining details and making more of a resolved prototype that I can now keep.

Thanks for reading 🙂


#include <Adafruit_TiCoServo.h>    // initialising servo library that can be used with neopixel
int buttonpin = 12;     // toggle switch connected to pin 12
int lightPin = 1;       // LDR connected to pin A1
int ledpin = 6;         // Led 1 connected to pin 6
int ledpin2 = 13;       // Led 2 connected to pin 13
int state;              // Variable to hold whether the switch is on or off (HIGH or LOW)

//part 2 code

int trigPin = 10;       // Trigger pin for ultrasonic distance sensor
int echoPin = 11;       // Trigger pin for ultrasonic distance sensor
int mini = 20;          // Threshhold for mimimum distance
int maxi = 200;         // Threshhold for maximum distance
int pos = 0;            // Home position for servo to go too (0)
Adafruit_TiCoServo myservo;   //Initialising servo

//part 3

#include <Adafruit_NeoPixel.h>

#define N_PIXELS  15  // Number of pixels in strip
#define MIC_PIN   A0  // Microphone is attached to A0
#define LED_PIN    5  // NeoPixel LED strands are connected to pin 5
#define DC_OFFSET  0  // DC offset in mic signal (0)
#define NOISE     20  //  Variable to to filter out unwanted noise in mic signal
#define SAMPLES   60  // Length of buffer/ number of audio samples taken
#define TOP       (N_PIXELS + 2) // Defining where the neo pixel ends – Allow dot to go off scale to create more fluent effect
#define PEAK_FALL 4  // Rate at which the light drops between the pixels in the strip

int Sound = 0;
peak      = 0,      // Peak for falling dot
dotCount  = 0,      // counter for delaying dot-falling speed
volCount  = 0;      // counter for storing past volume data
vol[SAMPLES],       // Collection of the previous volume samples
lvl       = 10,     // Current “dampened” audio level
minLvlAvg = 20,   // For  adjustment of graph low to high
maxLvlAvg = 550;    // For  adjustment of graph low to high
strip = Adafruit_NeoPixel (N_PIXELS, LED_PIN  , NEO_GRB + NEO_KHZ800);   // Stating the variables within the strip

void setup()

pinMode(buttonpin, INPUT);   // Stating that the toggle switch is an INPUT
pinMode(ledpin, OUTPUT);     // Stating that led 1 is an OUTPUT
pinMode(ledpin2, OUTPUT);    // Stating that led 2 is an OUTPUT
Serial.begin(9600);          // Serial begin to get read off’s of whats happening in the rest of the code

pinMode(trigPin, OUTPUT);     // Stating that the trigger pin outputs the signal
pinMode(echoPin, INPUT);      // Stating that the echo pin collects the signal from the bounce back
myservo.attach(9);            // Stating that the servo is attached to pin 9

memset(vol, 0, sizeof(vol));
strip.begin();              // Start of neopixel strip code

void loop()
state = digitalRead(buttonpin);              // Stating that ‘state’ is a read of the button pin HIGH or LOW
int lightLevel = analogRead(lightPin);       // Variable for the state of the LDR reading the light in the room
if (state == HIGH)                           // if switch is on
digitalWrite(ledpin2,HIGH);                // turn led 2 on
else                                         // if not
digitalWrite(ledpin2,LOW);                // keep led 2 off
if ((state == HIGH)&&( lightLevel <= 250))   // if led is on and the light level in the room is less than 250
digitalWrite(ledpin,HIGH);                 // turn led 1 on
else                                         // if not
digitalWrite(ledpin,LOW);                  // keep led 1 off

//part 2

long duration, distance;
digitalWrite(trigPin, LOW);  // Set triggerpin to low
delayMicroseconds(2);        // Wait 2 microseconds
digitalWrite(trigPin, HIGH); // Set triggerpin to high
delayMicroseconds(10);       // Wait 10 microseconds
digitalWrite(trigPin, LOW);  // Set triggerpin to low
duration = pulseIn(echoPin, HIGH);  // Duration equals pulse measured from echo pin
distance = (duration/2) / 29.1;     // Distance = speed (of pulse) x time (to return)
Serial.println(” cm”);             // Print distance in cm
if ((lightLevel >= 250) && (distance >= mini) && ( distance <= maxi))   // if the lightlevel is less than 250 and the distance is between the minimum and maximum thresholds
Serial.println(“open”);             // print servo ”open”
myservo.write(90);               // move servo to 90 degrees

else if ((distance < mini)||(distance > maxi)) // If distance is outside this range
Serial.println(“close”);        // print servo ”closed”
myservo.write(0);                // move servo to 0 position


uint8_t  i;
uint16_t minLvl, maxLvl;
int      n, height;            // n for height

n   = analogRead(MIC_PIN);                        // Raw reading from microphone
n   = abs(n – 200 – DC_OFFSET); // Center DC offset to 0
n   = (n <= NOISE) ? 0 : (n – NOISE);             // Remove unwanted noise
lvl = ((lvl * 7) + n) >> 3;    // “Dampens” the reading else the lights look twitchy

// Calculate VU heights based on the dynamic min and max levels
height = TOP * (lvl – minLvlAvg) / (long)(maxLvlAvg – minLvlAvg);

if(height < 0L)       height = 0;      // Clip the height of the lights
else if(height > TOP) height = TOP;
if(height > peak)     peak   = height; // Keep ‘peak’ dot at top
// Color pixels using rainbow gradient colours
for(i=0; i<N_PIXELS; i++) {
if(i >= height)               strip.setPixelColor(i,   0,   0, 0);
else strip.setPixelColor(i,Wheel(map(i,0,strip.numPixels()-1,30,150)));


// Draw peak dot
if(peak > 0 && peak <= N_PIXELS-1) strip.setPixelColor(peak,Wheel(map(peak,0,strip.numPixels()-1,30,150)));

strip.show(); // Update strip

// Every few frames, make the peak pixel drop by 1: gives more realistic volume effect

if(++dotCount >= PEAK_FALL) { //fall rate

if(peak > 0) peak–;
dotCount = 0;

vol[volCount] = n;                      // Save sample for dynamic leveling
if(++volCount >= SAMPLES) volCount = 0; // Advance/rollover sample counter

// Get volume range of prior frames
minLvl = maxLvl = vol[0];
for(i=1; i<SAMPLES; i++) {
if(vol[i] < minLvl)      minLvl = vol[i];
else if(vol[i] > maxLvl) maxLvl = vol[i];

if((maxLvl – minLvl) < TOP) maxLvl = minLvl + TOP;
minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; // Dampen min/max levels
maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6;


//  value 0 to 255 to get a rerquired colour
// The colors are a transition RGB back to R
uint32_t Wheel(byte WheelPos) {
if(WheelPos < 85) {
return strip.Color(WheelPos * 3, 255 – WheelPos * 3, 0);
} else if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(255 – WheelPos * 3, 0, WheelPos * 3);
} else {
WheelPos -= 170;
return strip.Color(0, WheelPos * 3, 255 – WheelPos * 3);

Charlie Evans Project 2 – InteractivArt

After receiving the brief I was pretty unsure on where to take it and how to create project I’d enjoy. That night whilst casually draining my life on FaceTube or something I came across an article on a New York based artist called Holton Rower, who created his artwork through pouring paint, sounds easy right. After some time looking into his work and staring at his pieces (seen below) I decided on linking this with my Physical Computing project, to create similar looking artwork by using the same technique, but this time roboticly.

From here I began to concept ideas with the Arduino and robotic knowledge I’d accumulated over the past weeks, trying to include components such as servos, motors, POTs and sensors.

img010 img001img008

Initial ideas involved a circular plate that’d rotate with the different colours of paint on, this then evolved to a straight plate that’d move horizontally to choose between paints, which would use a rack an pinion powered using a geared motor to move.

To pour the paint a different rack and pinion would move forwards and back behind it to push the cup over,but this lead to an issue with pulling the paint cup back to an upright position. The solution… move the R & P infront of the cup and make it move vertically to raise and lower the cup.


Moving forward I thought the best way to develop and progress the prototype would be to initialise its construction . I began by building the rig and working out where certain parts would go, such as the paint cups and R&Ps.

Photo 24-03-2015 16 43 11 Photo 24-03-2015 16 43 31

In the mean time I was getting together my components, I ended up buying some geared motors, as much as I’d like to say it was for their torque output and low RPM it was more for their low cost and free shipping… Some switches and ofcourse the big red button.

Photo 19-03-2015 20 44 30 Photo 19-03-2015 20 44 33

Here the big red button was set up to just switch LED lights, I planned to use it to switch the whole product on and off but this never amounted and it was just used to initiate natural disasters in far away places (nothing)…

To move the Rack & Pinions (2x) two way switches were bought to control which way they move, this would be simple and obvious how to use to the user. They’d allow the motor to move both CW and ACW using H Bridges, which were sort of taught to us earlier on.

With the building coming together parts and code were tested loosely before I committed to fixing them in position.

Photo 30-03-2015 14 59 55

One final problem that arose was how to make the paint pour onto the same point all the time, after some thinking and sketching  funnels were bought to mount to the rig.

Finally all that was left was testing, which began with loading the cups with weights (to help them tip), then water and finally paint. The paint used was slightly watered down acrylic so that it wasn’t too thick that it wouldn’t move, neither too thin that it’d just run of the tower it’d be poured onto.



Photo 14-04-2015 23 30 47 Photo 14-04-2015 16 56 22 Photo 15-04-2015 16 44 31 Photo 15-04-2015 16 44 43

Here’s a few pictures of the first piece being made and its outcome, this was poured onto a foam core tower, the second piece was poured onto a wooden tower.

Overall I’m fairly happy with the final outcome, in essence it for filled my initial idea and its ability to create completely unique and individual art pieces for anyone who wants to use it is completely true and more than possible. With regards to teaching me about physical computing it probably wasn’t the most demanding nor technologically advanced, but for someone with almost no interest in PC this project has helped me enjoy it and has opened the door for future projects.

If I were to re-do this project I’d still like to keep it different and quirky by staying away from the typical projects you see by the dozen on sites such as instructables etc, but advancements in coding and addition of more moving parts controlled by the user would defiantly be on the list. Neither would I be swayed to buy cheap and cheerful components by their low price!

Thanks for reading,


Charlie Evans Project 1 – Cat Catcher 3000!

Our first physical computing project was to create a system/product that utilised either 2 inputs and 1 output or vice versa.

Our basic Arduino set only gave us limited sensors to play with, which have already been covered in practice, so I decided to purchase a PIR sensor. This is an infra red detector to pick up motion, my aim being to use this (the 1 input) to detect motion and raise an alarm using an LED and buzzer (the 2 outputs).

With this arrived I was able to wire them all to the Arduino UNO. Firstly I coded the PIR to trigger the buzzer only by using ‘if’ statements, and then added the red LED. With this all working as planned I knocked together a small housing for it all with holes for the PIR and LED.

Pictures show some of the building or the circuit and of the housing, plus a video to show how it all worked!


int pirPin = 2;
int pinSpeaker= 10;
int ledPin = 13;
void setup(){
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
pinMode(pinSpeaker, OUTPUT);
void loop(){
int pirVal = digitalRead(pirPin);
Serial.println(“starting to read PIR”);
analogWrite(ledPin, 0);
if(pirVal == LOW) {
analogWrite(ledPin, 255);
Serial.println(“Motion Detected”);
tone(10, 700, 100);
void tone(long duration, int freq) {
duration *= 1000;
int period = (1.0 / freq) * 1000000;
long elapsed_time = 0;
while (elapsed_time < duration) {
delayMicroseconds(period / 2);
digitalWrite(pinSpeaker, LOW);
delayMicroseconds(period / 2);
elapsed_time += (period);

Photo 25-02-2015 12 59 17Photo 25-02-2015 12 59 59Photo 25-02-2015 13 01 09Photo 25-02-2015 13 04 26

This first project helped reinforce what Id learnt in the lectures leading up to and throughout it, it also widened my knowledge of components and possible projects as I researched online and spoke to my peers.

If I were to re do this project Id try and use more complex code to possibly have different outputs, and would try add another input such as a distance sensor, or the PIR on a servo to scan the area and give it a larger area to detect.


Part 2 – Biscuit Teaser

Matthew Au-Yeung

I wanted to do something similar to an ball game arcade, and when win or score a certain points, it will give out biscuits or cookies.

It would be great for the exhibition, since the cookies can attract people come and have a go at the project.

A picture showing an existing ball game arcade.

What I want to achieve:

LCD displaying score, sensors to register score, light to indicate score being registered.

So I started off with using a button to register a text into the arduino, also added an LCD screen to show if the button is pressed or not.

However, the arduino kept registering constantly, when I only want it to register once everytime I press it.

So I added a delay to it.

It worked out alright, but it delays the whole arduino system and it will only register another input when the delay finishes.

So I had to rewrite the code.

I solved it by adding  lastButtonState=buttonState; in the sketch

what this does is that it actually is updating the new button state.

At this point, the basic structure of my project is done.

So I added another set of the sketch for the second button.

Plus, added a Welcome screen to it.

I finished off with adding a servo motor to the arduino, the servo is for opening the box of biscuits, when the player reaches a certain point (in this case its 10 points).

I added a delay to the servo to tease the player. When the player reaches 10 points, it will open and close very quickly. and then after 10 second it is when it actually open, it will automatically close after 10 seconds. A reset button is also added.

The second video shows a better view of the teasing mechanism.

There are 3 holes and the smallest one is 3 points, 2 points for the middle one, and 1 point for the large one. When the score reaches 10 points, the box opens and closes really quickly for the tease, and then opens after 10 seconds for 10 seconds. Yellow button to reset.

The sketch

Matthew’s code

Fritzing diagram

Matthew's final fritz

If I were to improve this project, I would definitely use a light gate for the sensor instead of the buttons, because the balls would bounce up and down and end up hitting the button few times or even more.

Part 1 – Disco Mode Light

Matthew Au-Yeung

Disco Mode Light

I started off with playing around with photo resistor and LEDs.

Using serial monitor to understand what the photo resistor is actually doing.

Disco Mode Light in working state

The sketch I used

int ledpin=4;

void setup()
pinMode(ledpin, OUTPUT);
void loop()
int sensorValue = analogRead(A0);
if (sensorValue < 200) // Turn on the light if it is less that 200
digitalWrite(ledpin, HIGH);
else {

Curtains with a bit of an umph _ Stacey Dart

Well after many attempts at making the curtains work, i finally have it… They work!

I have attached some images to help show how the system works.

Flow diagram
Flow diagram
Board layout
Sorting out Cables and Layout of Jig
Sorting out Cables and Layout of Jig
Had to upgrade to a motor with more torque. As the one given in the kit was not able to turn the pulley with the string for the curtains attached to it
Had to upgrade to a motor with more torque. As the one given in the kit was not able to turn the pulley with the string for the curtains attached to it
Adjusting the length of the string and making sure the clips for curtains are in the centre so when the curtains open and close both sides of the curtains do the same
Adjusting the length of the string and making sure the clips for curtains are in the centre so when the curtains open and close both sides of the curtains do the same
Getting the Light positioned correctly so that the LDR recognises it.
Getting the Light positioned correctly so that the LDR recognises it.
curtains open
curtains open
curtains closed
curtains closed

When picking the motor for this project, I had the option of a stepper motor, a motor with a gearbox, or a regular motor that gives out a certain RPM. After buying a regular motor and a geared motor and testing them out, even though the geared motor slowed the curtains down and added a bit of elegance to the system, I decided to go with a regular motor as I liked how dramatic it become with opening and closing the curtains so fast… Although I wasn’t able to show it in this blog, I have added a tune/melody when the curtains open and close just to add a bit of humor to it. All in all I’m quite happy with the outcome. I have learnt a lot about coding, finding parts, time management, planning and most importantly, people are helpful!

Thank you for reading.