Assignment Due Monday October 2: The TSP (Traveling Salesman Piano)

Background: 

Being an NYUAD student, traveling is one thing I’m certain we all have in common. Traveling back and forth through many airports gets extremely tiring and not to mention boring, especially when the airport only has 30 minute WIFI or even worse, none at all. This simple traveling piano allows you to practice your favorite tunes while on the go. 

Code:

Schematic:

Assignment 7: Button Guitar

Background:

This is a simple “guitar” made from an Arduino and a few buttons. The buttons act as the strings of the guitar. There are 6 buttons (two more gotten from the Design and Innovation Studio as long as a longer breadboard), replacing the 6 strings on the Guitar. Each button makes the piezzo buzzer create a different tone corresponding to the different tone of the strings on an actual guitar. 

Code:

 

Schematic:

Assignment 6: Buzzer, ServoMotor and LEDs

Background:

My circuit turns on when you press the button. The LEDs blink one after the other, then the buzzer sounds. After that the ServoMotor is moved 45 degrees at an interval of 200 milliseconds. At the point where it has moved 90 degrees, the servoMotor is then moved back to its original position (0 degrees) and after a delay of 100 milliseconds it moves back to 90 and then continues with its 45 degree motion. 

Code: 

 

Schematic:

Assignment 5: ServoMotor

Background: 

For this assignment, I made the motor rotate to its max position of 180 degrees as the light dimmed or faded away. When at a certain threshold of darkness, the motor would rotate fully. If there was adequate light the motor would rotate only to half its max position (90 degrees). And finally the motor would only rotate at 45 degrees when the light in the room was really bright. 

Code:

 

Schematic: (made using CircuitLab)

Assignment 4: Using Serial.println()

Serial.println():

Fade:

There was not much noticeable difference between the two fades. The only difference was mostly in the code. One completed the Fading tutorial with the use of two for loops. The one with the for loops uses one for loop to brighten the LED and the other for to dim the light. The loop() method in the Arduino probably runs so fast that we cannot differentiate the difference between each iteration of the for loop. So because of this we probably cannot tell the difference between both types of fades. 

BlinkWithoutDelay:

This uses a constant interval value as a measure of time. The millis()  method is called and gives the current time elapsed since the application has started (in milliseconds), this uses two variables currentMillis  and previousMillis  to keep a track of the time that has passed, once a time greater than or equal to the interval has passed between the time we last checked the values of current and previous, we either turn the LED ON or OFF depending on the previous state of the LED (we flip the state). I used Serial.println()  to get the value of currentMillis  and previousMillis , and the value of what the LED will be after a time greater than interval has passed. 

Assignment 3: Blink in setup() and loop()

Background Info:

In setup() the same code that made the green LED blink and fade in/out in the loop() was used to fade the blue LED. The blue LED was only turned on and blinked three times before it went out, in contrast with the code in loop(). The green LED blinked continuously because of the difference in loop() and setup(). Loop() runs perennially, executing the code that it contains sequentially. Setup however runs only once and is used to initialize and arrange the necessary variables and other components and so runs only once. The blue light also shone before the greenlight because of the order in which setup() and loop() are called.

Continue reading “Assignment 3: Blink in setup() and loop()”

Assignment 2: Jet lag / Insomnia Detector and Night Light

Background Info: 

Lads and ladies and all those in-between, we all know the struggles of traveling to this far away, once-upon-a-time Neverland of a university. It takes so long to get here and by the time you do you’re hit with jet lag. This circuit is used to “detect” jet lag or maybe even insomnia. The circuit uses three LED lights and a LDR and an open switch. The LED lights consist of a red, green and yellow. If the user is lying down in their bed, they would complete the open switch, this circuit also uses the microcontroller via the LDR to check if the lights are ON or OFF. If the LDR detects that the lights are ON, then a yellow warm comforting light is shown.  Continue reading “Assignment 2: Jet lag / Insomnia Detector and Night Light”

Assignment 1: Detecting Gas Leakage and Prayer Switch

Gas Leakage Detector:

This interactive media project utilizes an arduino and sensors to detect oil or gas leakage. This project is interesting because it not only saves natural gas but helps to prevent major disasters that could happen such as house or office fires. This project also send the user a SMS alert if a leak is detected. The project can be found here.


Prayer Switch:

This switch utilizes the kneeling in prayers to light an LED light. Copper tape is stuck to the person’s kneecaps and a wire connect between both copper tapes on each knee. The LED is connected to the resistor, with the positive terminal (the longer pin) connected to the positive terminal of the battery or the Breadboard (which is in turn connected to the 5V output of the Red Board). Another section is connected to the negative terminal of the battery or the Ground connection of the breadboard; both ends are also connected to aluminum foil ends. When the person kneels, with one knee coming into contact with the aluminum, the circuit is completed and the LED is lit. (See sketch below)