Mood light

I did the digital lab couple weeks ago, it just a simple switch and two led lights, I think it was boring ,so I didn’t summit it.

In this assignment, I want to make a mood light, I saw many examples from internet. Many examples are use the RGB led, but I am not going to use the RGB led.

I tend to use couple common led lights, and arrange the order how they turn on to achieve the mood light design.

1, I connect 4 led  and the switch in the circuit

2 This is the arduino code

void setup() {

void loop() {



Here is the effect

3Add a Cover to Diffuse the Light

Final effect

I think the final effect is not so good, because I don’t have many different color led, if I use more color and brighter led, the effect could be better.


Assignment 5

I had some issues with my motor, it broke, so I ran this instead

int button = 0; // variable for the button status

void setup() {
// set pin 13 as an output
pinMode(13, OUTPUT);
// set pin 7 as an input
pinMode(7, INPUT);

void loop(){
// read the state of button
button = digitalRead(7);

// if button is pushed
if (button == HIGH) {
// turn LED on:
digitalWrite(13, HIGH);
} else {
// turn LED off:
digitalWrite(13, LOW);


When people drive on the high way, they may often fall asleep in the boring, long, tired journey, which may cause deadly traffic accidents! 

When people fall asleep during the driving, their body will tilt forward, so the angle of the body will not be 90 degree any more.

This point could help to solve the driving sleep issue.

I use arduino to prototype this “Sleepless Drive product” with the Tilt bass switch and Buzzler. I just use the same system and code as the Media Lab.



When people about to fall asleep they will tilt forward, and the trigger the tilt ball switch, so the Buzzler will weak them up. When they sit streight, the buzzlers stop.

The video below is my test. The tilt ball switch ball is not stable enough. But that’s OK…..HAHA

Sequence 01


Assignment 5 how to stabilize Arduino

The first thing I did on Arduino is to stabilize it on a board. I searched different trash at my apartment and found out that the plastic case of my macbook pro was perfect both on size and materiel.


At last,  I use two screw nails to stabilize the arduino to the plastic case.


Assignment 5: OPERATION

This week it was really interesting to work with the Arduino hardware.

I found myself amidst a creative dry spell and so I decided to recreate a game that often frustrated me as a child.

Remember “OPERATION”?

(Yes, it’s the one with the oddly rounded, fully naked man lacking genitalia.)

Basically, I used the code in the Button –> LED example with the addition of another pin as an OUTPUT in order to add the buzzer. I extended the red LED from the breadboard and used 2 hook-up wire pieces (in place of the button legs) to form a tweezer tool.

I redrew the operation character onto a piece of paper and made outlines of the various extraction regions using graphite from a pencil (idea taken from Anne’s switch). I am happy to report that the switch is working perfectly; the character’s red nose lights up and the buzzer sounds when the wire tweezers make contact with the graphite (thus completing the switch).

Assignment 5 – First week playing with Arduino

I’m gradually getting used to Arduino after a few weeks working on it. At first I was really frustrated because I had bad experiences working with electrical stuffs and building circuits from high school (I was really really bad at science). I’m trying to learn and understand how things logically work (negative, positive, how electricity flows from + to – , etc. ).

So the first thing I do to start Arduino is to follow the Digital Labs our class has on the blog. I got some mistakes in connecting the wires to the right locations but fortunately everything worked out fine in the end.

Digital Labs Attemp

I also follow instruction from the book Getting Started with Arduino and come up with below code to control the switch and keep the light turn on or off whenever we switch its state.

Final Code

After making sure that the circuit works well. I start to think about the “special” switch. The first conductive material came up in my mind was water. But I tried tab water as the switch but the light just doesn’t turn on or off at all. So water is not a conductive material? Later on I figured out pure water is NOT a GOOD conductive material from a bit research (did I mention I’m really bad at science?)

credit link here

Hmm so, that’s the reason my switch didn’t turn on. However this gave me an idea, seawater, or salted water, is a much better conductive material. How about using salted water as the switch? I then tried to mixed my own salted water and experimented.

My salted water mixer

And it worked super fine! Hurray!

Using salted water as conductive switch

Below is a short video I took while working on this.


Finally, that’s my first attempt with Arduino. More to come in the next few weeks.

Assignment05 LED flash and Button control

here is my first experimental Arduino test with LED and button.


arduino is a quite interesting device to play with, it reminds me of a toy that I’m quite enjoyed with when I was a kid.

it’s like a build block with all kinds of electronic part with different functions, with this you can buid radio ,controlable car or any thing you can image.

it is inteactive because of the circuit include the sensor. I think it’s maybe the first interaction design I’ve ever tried.

since talk about arduino, it’s like a advanced edition of the toy that i’ve mention above, it is not as hard as I thought, although I’m not sure about combine arduino with processing code.






anyway, here is my device. I use the “for”function  to make the LED light on one by one ,and the button as a switch to make them light another way.
















int Led1=1;
int Led2=2;
int Led3=3;
int Led4=4;
int Led5=5;//set port of LEDs
#define BUTTON 8 // set port of Button
int val=0;

void setup()
pinMode(BUTTON,INPUT); //button as input function
unsigned char i;
pinMode(i,OUTPUT); //LED as output function
void loop()
if(val==HIGH){  //when button is pressed ,the LEDs blink
style_1(); //if not , LED light on one by one
void style_1(void)
unsigned char j;
for(j=1;j<=5;j++) //use “for” to make the led light on one by one
delay(200); //delay 0.2s
void flash(void)
{unsigned char j,k;

Assignment 5- wearable switch

I had a lot of fun playing with the Arduino board, although I had some issues with the USB connection. I kept getting this error message: A USB device is currently drawing too much power. The hub to which is it attached will be deactivated”. So I just kept changing USB ports (and computers) so I can keep playing. (btw- this didn’t happen with the Lilypad!)

The breadboard took a bit to get used to, cutting the wires for the right length (I kept making new wires) and making a solid connection. The blinking light worked great. When I connected the momentary button switch I got an inconsistent connection, so at times when I pressed the button it worked and on other times in didn’t. I secured the wires and made sure they are connected properly. I have a feeling there is a short in the circuit but if that’s the case it shouldn’t be working at all!

Breadboard - blinking light

Switch circuit - LED

Switch circuit- buzzer























I had more luck with the buzzer, it was buzzing as I pressed the switch (see video below)

but after a while I kept buzzing regularly weather I pressed the button or not.

For my switch I wanted to build something wearable compact and simple so the switch will connect using a body movement. I decided to make little creatures finger sleeve that you can wear and make a connection using conductive thread. I worked with felt, tiny piece of  conductive fabric and a lot of conductive thread.


sketch of my idea

Sawing the finger sleeve and inserting an LED- the plan is to attach this to the circuit as well

adding conductive thread and conductive fabric

Connecting the thread to the circuit instead of the switch

When the two creatures "kiss" the circuit is closed!




































I made sure that the (+) side of the conductive thread didn’t touch the (-) side but I still didn’t get a solid connection. When I’ll get this to work, I will also connect the LEDs in the sleeves to the circuit and get them to blink!

I really enjoy working with interesting material, I came across this video on how to make conductive play dough. It looks pretty simple to make- this is what I want to play with next!




** After class today I showed the circuit to Jim and he suggested to try different type of wires. The breadboard was so stiff and hard to work with so I ended up working with thin wires from a phone cable that I had. We switched them to wires from the lab and… the switch worked!!
Link to video:

Assignment #5 Arduino

Creating a switch with Arduino was quite fun!

The switch I created functions when a penny is dropped or inserted in the donation box. (that I made out of paper).

For the code, I took the existing blinking code and added another blinking LED light on pin 12  to make 2 blinking LEDs instead of one.

The paper box looks like a tube and has the two wires inside it that are close to each other but don’t touch. Once the penny is inserted, it touches both wires and the light start blinking! It would be best if you slowly insert the penny so you would see the lights blinking longer.

The box had to be small enough so that the penny would make contact with both wires when dropped.

That way, each time you donate a penny (or other coin) you would get a smiley face that’s blinking! Another way of saying thank you 🙂

Here are some pics of the Switch.


Arduino Homemade Button # 1

This week I loved the readings. I found them informative and easy to interpret. I think working with my hands messing around with Arduino comes much easier to me than writing Programming…which I still find exceptionally bizarre and abnormal because in every other type of writing endeavor, writing is hands-down my strong suit. Reading about how electricity works this week, made me think of Mike Ladd’s song, “How Electricity Really Works.” The video on youtube is just a still of his album cover, but if you’re curious, here’s a link to his song,  Mike Ladd, “How Electricity Really Works”

My initial “big idea” for my at home button was to use some of the metal-mesh sheeting adhered to my nightstand as well as to my iPhone case so that when my alarm sounds in the morning a light in my bedroom would turn on so that I would be more motivated to get out of bed without hitting the snooze button one, two…or even three times (yikes!). Thinking through the code, I would need to create a conditional argument (an “if” statement) so that “if” the phone and nightstand base were separated, the light would be triggered on. I did not attempt this ambitious button (though, I would have replaced the bedroom light with the small Arduino light temporarily for prototyping purposes) because I couldn’t get my hands on the metal mesh this weekend also, I am still struggling with Programming code.

None the less, this week I made a button that begins to get at the bigger button idea: a little light button (and one switching out the light for the buzzer) using one of my bracelets and an earring. The system works to help keep you awake during long nights of studying and heavy readings. If someone were to get too sleepy studying and reading, and her head and arm (where her bracelets are located) met, the buzzer or the light would go off.