Project 1: Mood Buzz

Interactive Sound & Light Show

Overview and initial research

A simple project that combined 1 input with 2 outputs using the simple arduino starter kit. This was very much a learning project that I could then use to develop and create a more technically challenging project.

I initially thought about creating something that was interactive and required a constant input rather than just pushing a button and watching the magic happen. I began looking into Theremins and how I could take this idea and potentially simplify it.

So using the piezo element, photo resister and a series of LED’s I set to work creating a devise where the pitch of the piezo element would change and the LED’s would get brighter and dimmer as you moved your hand towards and away from the photo resistor.

Using websites such as the arduino learning section and Adafruit I was able to find a number of tutorials on how to use a photo resistor, once a clear understanding of this was achieved it was just a simple matter of changing the output from an LED to Multiple LED’s and a piezo element.

Below are a series of websites I used in my learning process:

Patrick P21Circuit 2                     Patrick P1 Circuit 1

Patrick P1 Circuit 3

A Fritzen diagram and code show what my final results looked like after the initial research.

int photocellPin = 0;

int photocellReading;

int LEDpin = 11;

int LEDpin2 = 10;

int LEDpin3 = 9;

int LEDpin4 = 6;

int LEDpin5 = 5;

int LEDpin6 = 3;

int LEDbrightness;

int speakerPin = 13;

void setup(void) {



void loop(void) {

photocellReading = analogRead(photocellPin);

Serial.print(“Analog reading = “);


photocellReading = 1023 – (photocellReading + 400);

LEDbrightness = map(photocellReading, 0, 1023, 0, 255);

analogWrite(LEDpin, LEDbrightness);

analogWrite(LEDpin2, LEDbrightness);

analogWrite(LEDpin3, LEDbrightness);

analogWrite(LEDpin4, LEDbrightness);

analogWrite(LEDpin5, LEDbrightness);

analogWrite(LEDpin6, LEDbrightness);


int reading = analogRead(photocellPin);

int pitch = 100 + reading / 1;

tone(speakerPin, pitch);


Patrick Project 1 Fritzen Diagram

Problems and Troubleshooting

One of the major problems I encountered was achieving the correct threshold on the photo resister so that there was a large enough range allowing a greater movement of your hand. This was a simple fix and involved a trial and error process of changing the start reading range of the sensor.

photocellReading = 1023 – (photocellReading + 400);

The value 400 can be changed to suit your personal preference to create a more fine tuned device.

Another function that was causing my some issues was getting the LEDs to behave as the piezo element does and converting this analog input to the digital output. I managed to stubble upon the map function which always the LEDs to copy the read out for the element. This was a great find and allowed great precision in the brightness of the LEDS.


Doing this project again or even developing this project I think I would have to make the device more reliable with a better user feedback. Firstly I think I would use a distance finder sensor rather than a photo resistor. I believe something like this needs to be more dramatic so including a better light show or have something move as you interact with the device, I think would greatly improve the project.

Patrick P1 Final 3

Patrick P1 Final 2 Patrick P1 Final 1


Leave a Reply

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

You are commenting using your 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