Back to Parent

Outcome


Project Description

My idea of the topic is to make music responds to the environment and human's mood. In this project, I use Photo Resistor and Force Sensitive Resistor to get the light value around and the pressure level people give to the sensor, which means the much more pressure you give to the sensor will trigger exciting music indicating that you are in a high spirit. On the contrary when it is dim around, you just press the sensor a little bit, a piece of soft music will play indicating you want to clam down.


Material used:

● Spark Microcontroller

● Breadboard

● Jumper Wires

● Two 1kΩ Resistor

● Two single color LED (red and green)

● Two 10kΩ Resistor

● A photoresistor

● A forceresistor


The picture below shows the circuit I built. 

Img 6524
Show Advanced Options

And below my code written in Spark Dev.

Show Advanced Options

In dim or dark environment, the green led will light with the brightness according to the Photoresistor reading. 

Img 6520
Show Advanced Options

When pressing the FSR, the red led will light with the brightness according to the FSR reading, until the force value reach 1500 or more, the red led will blink three times.

Show Advanced Options

Blow shows the the cloud variables in Spark Dev.

Screen shot 2015 01 27 at 12.48.09 am
Show Advanced Options


Next, I made webpage using JQuery to make calls directly to the cloud API and my two variables available in the browser. 

I use HTML5 audio to add music in the page,  and I want the two variables to control the music play.  


Screen shot 2015 01 28 at 12.43.46 pm
Show Advanced Options

Here is the html code I have written so far, when the force value reach 1500 or more, the audio will play.

Show Advanced Options
Show Advanced Options

Next I will add more music to the page and make them play at different force value. 

Drop files here or click to select

You can upload files of up to 20MB using this form.