Labels

Showing posts with label #MDDN 251. Show all posts
Showing posts with label #MDDN 251. Show all posts

Monday, 17 June 2013

MDDN 251: Fried Sensor

As i was linking up the sensor to the circuitry with the LEDs connected and the code written out, i managed to accidentally plug the wrong wire into the wrong place. This resulted in SMOKE coming from the motion sensor, it being so hot that i burnt the skin off my thumb and the sensor no longer working.

I FRIED A SENSOR!

This is really unfortunate, and it means i have no sensor unless i scavenge something from another device. The place that i purchased the sensor from in the first place would take to long to deliver a new sensor, which means i can't purchase from there again. Fantastic.


This is a really unfortunate event results in me not having a final prototype to present to the class, but just working off images and videos i have taken before the sensor fried on tuesday morning. Hopefully imagery is enough.

MDDN 251: Video of work


MDDN 251: Images of Final






Tuesday, 11 June 2013

MDDN 251: Mistake and new concept

So i made a foolish mistake with the concept that i originally had and the motion sensor i had purchased. The PIR motion sensor is an "OFF" or "ON" type of sensor, which meant that it either detected motion or it didn't. Sadly for me, i realised this quite late into the assignment and didn't have a chance to right my wrong while at the same time fully completing the prototype. The type of motion that my chosen concept entailed was more of a webcam type motion detection. It pays to read fully about the type of component you're purchasing before you do so. Therefore, to use this new motion detector that I have purchased, i need to change my concept.

My first idea of a new concept was to create a motion responsive Night Light for toddlers. The way that it would work would be the motion sensor would detect the movement in the restless child at night, thus turning on an LED that would illuminate a section of their room in a soft light. Then once the child falls asleep and is still, the motion detector will not sense any motion, and will turn off after a certain amount of time. For example, if the child is still for more than 20 minutes, and the sensor is off for that long, the sensor will automatically shut down until the switch is reset the next night. This is implementing a power saving method that most other nights lights don't use, making it more unique. Also, there will be a sound detector that will make the night light run as well, which remains on but only has a small amount of detection, so the light will turn on if the child is loud enough for example, waking up at night and crying, calling out, going to the bathroom etc. will all make the light turn on.

Friday, 31 May 2013

MDDN 251: Motion Sensor Connection

The motion sensor has been purchased and the connection is as shown above. The resistor isn't necessary to run the motion sensor i have found despite stating on some websites that it is. They state that the SparkFun PIR motion sensor has an open collector output - this means that the sensor requires a pullup resistor so that the output is always high, and when triggered it will put the output low. I found this code that inputs "Motion Detected" when the sensor detects motion and "Motion Ended" when the motion is not detected.
The code is as follows:

/* PIR sensor tester*/

int ledPin = 13; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status

void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input

Serial.begin(9600);
}

void loop(){
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, HIGH); // turn LED ON
if (pirState == LOW) {
// we have just turned on
Serial.println("Motion detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin, LOW); // turn LED OFF
if (pirState == HIGH){
// we have just turned of
Serial.println("Motion ended!");
// We only want to print on the output change, not state
pirState = LOW;
}
}
}

Don't forget that there are some times when you don't need a microcontroller. A PIR sensor can be connected to a relay (perhaps with a transistor buffer) without a micro!

MDDN 251: Assignment 2 Proposal



Assignment One Prototype Description
In the previous brief, I had proposed to create an electronic object using the screen from an analog alarm clock and the microphone from a guitar tuner. This resulted in adapting the lights on the analog display LCD screen to light up and create patterns as a certain level of sound is recorded in the microphone. The volume of noise was put through Arduino and certain output on the serial monitor was read, which in turn displayed the speed of the patterns on the display.
This proposed design was reflected in the final prototype, which accurately displayed the effects that was trying to be achieved. When music, for example, was played into the microphone of the device, the lights would synchronize with the beat of the song. When there was a loud beat or a sharp tone, the lights would flash rapidly. When the song was quieter, the lights would disappear and the screen would be black. Also, when all of the instruments were played at their loudest, the lights would flash erratically and create a pattern. This was the proposed effect that had been achieved.

To further develop the designs from Assignment One, additional items would be required. For example, a larger LCD screen would make the project more intense and provide a larger area to work with. Incorporating different sensors rather than just a volume sensor, that can detect a larger variety of things such as motion sensors, infrared sensors, electro-optic sensor etc. could provide a larger potential of development to the prototype.

Proposal One
By connecting the Arduino program to Processing, a wide variety of outputs are now available to experiment with. To develop the use of responsive lights to an input of human interaction, using a sensor would be the main component to incorporate that interaction. Motion sensor would be the most effective component to use to develop the prototype to further achieve greatness.
Wiring the Arduino to a motion detector for the input would make the interaction movement which is a development from the sound sensing microphone. Then Arduino would be connected to Processing. This connection will allow the use of digital output rather than a physical output. Arduino would sense where the movement is occurring on the area that is being sensed by the motion sensor (in a designated space on the ground). The output from this motion interaction would be displayed from a projector connected to the computer running Arduino and Processing. On the screen would be a pattern that resembles the movement input.
For example, if the interaction was a person swinging their arm across the detection space, the output would be a flashing pattern across the screen. Or if a person jumped up and down in front of the detection space, the pattern would be flashing on the screen in an up/down motion.

Required Parts:
·        Arduino System
·        Processing System
·        Projector
·        Motion Sensor
·        Wires
·        Microcontrollers
·        Soldering Iron
·        Solder
        Other electronic components 

Proposal 2
            The addition of extra sensors to the device and an upgrade to the screen system would be a strong development on the previous prototype. In this proposal, there is an added motion sensor and light sensor to detect movement from the interacting person. There is an upgrade to the screen that is used so there are more lights and more possibilities in patterns from the lights. The lights will react to the type of the interaction it senses. The larger screen would make it so that there are more lights involved to experiment with and the outcome would have a greater effect.
For example, if there is sound received on the microphone, the lights would resemble the beats of the music or the beats of the sound.
If movement is received on a movement sensor then the lights will move to reflect the type of movement (for example if someone waves slowly at the sensor, the lights will flash from side to side in response to the waving).
Lastly, if there was a light shone on a light sensor, all of the lights will shine brightly in response to the brightness of the light. Therefore, if there was a light shone in the general direction of the sensor, the lights would response in a way that showed the closest LEDS to the light source.
This sort of response gives an output that has an effective interaction and can be more interesting than a simple input/output. There are multiple forms of interaction inputs that involve this proposal. This makes the proposed prototype a more interactive design than the other. Because of the multiple inputs, this design has a larger variety of outputs.

Required Parts:
·        Arduino System
·        Large LED screen
·        Motion Sensor
·        Microphone
·        Light Sensor
·        Wires
·        Microcontrollers
·        Soldering Iron
·        Solder
·        Other electronic components

Wednesday, 1 May 2013

MDDN 251: Short video for Musical Lights

Here is the final video for the Musical Lights.
Credit to Crystal Method for the music.

MDDN 251: Fritzing Schematic for Circuit



Because the screen was a reused screen from an alarm clock, there was no schematic that i could find to put on the circuit. Therefore, i have used a similar style LCD screen that has an accurate amount of pins for the lights.

MDDN 251: Description and Images


The purpose of my project was to get and LCD screen taken from an analog alarm clock to light up when a microphone connect registers a change in noise. When the microphone is directly interacted with, such as blowing on it, tapping it or talking to it very closely, the lights registered the change in volume and begins to flash rapidly, as if your interaction stimulated then screen.
When music is played to the microphone, a pattern in the screen is shown. When the music has louder drums or beats, the lights will play faster. Between these, if the music was quieter and slower, the lights wouldn’t play as frequently. Therefore, the prototype has been nicknamed “Musical Lights” (with reference to Musical chairs – When the music stops, so do the participants).
This was achieved by connecting the lights of the screen to two shift register microcontrollers that decreased the number of pins connecting to the Arduino to five instead of 20. The microphone was then connected to the Arduino also with a 100x amplifier that made the audio waves easier to register.
The video shows one particular song, Keep Hope Alive by Crystal Method (full credit). The techno type of music is most effective in creating these patterns, as there is an audible beat that the lights can duplicate.





Monday, 29 April 2013

MDDN 251: Lights in the Dark

This is the screen lighting up to music in complete darkness so that you can see the lights more effectively and the pattern they play. The pattern sort of links up with the music because of the analog serial number outputs the peak numbers which link the speed of the lights to the volume of the music.

MDDN 251: Video of Light response to Music



This is the final prototype of the lights responding to audio. The closer and louder the music gets to the microphone, the faster the lights begin to flash. Then once the music is silent, the lights slow to a stop. It continues to flash once ever few seconds, but that may be background noise being picked up slightly. Overall, the lights responding to Audio was quite successful and responded in a way that i had envisioned.

MDDN 251: Images of Final Prototype





Friday, 26 April 2013

MDDN 251: Process of connecting the Lights to the Microcontrollers

I completed the circuit that was posted earlier and here is the outcome:

This circuit only uses half of the LEDs on the display so in order to use the rest, i must connect the overflow of the first microcrontroller to the data of the second microcontroller and complete this circuit here and create a Dual Shift Register:

That process went relatively well and i ended up with all of the lights being able to brighten up. Then with the code provided applied, it made them flash one after another in the sequence that is shown in previous videos. This is great progress on getting the screen to work. Now i must struggle to get the microphone to connect to the screen.

MDDN 251: Faster Light Patterns and understanding of the Code


I understand the code that has been applied to create these patterns and lights. There is a simple number change to change the speed of the lights. By changing the DELAY of the lights, it can be made to go faster (when there is a low delay of 100 or less) or slower (when there is a delay of around 300, that is the speed of the previous video posted). To control these speeds, a simple IF statement is needed that states IF the number recorded on the serial monitor increases by 100, the delay will decrease by 25. So if the slowest delay speed was 300, by the time the serial monitor reaches 1023 (typical peak digital recorded number) the delay will be 50-25, which means the lights will be shining as fast as they are shown in the above video.

MDDN 251: Working Light Pattern


MDDN 251: Audio Input

So i got an electret Mic with a 100x amplifier attached that i can connect up to create the audio input. When connected to the arduino however, there is an issue with the digital output in the serial monitor. the numbers it outputs are as follows:


814
815
814
820
818
819
814
814
814
813
816
813
814
816
814
816
814
814
813
815
813
814
815
814
814
811
811
813
811
809
812
809
810
810
809
809
810
809
808
811
809
808
809
811
810
808
809
810
810
811
809
812
811
813
809
812
810
812
810
810
813
811
811
812
811
809
813
812
809
811
811
809
812
811
809
808
808
807
810
810
811
808
806
807
806
809
806
809
806
808
809
812
806
806
808
809
809
808
807
808
807
806
808

Now this is good, its actually picking up something, but at the same time, its picking up nothing. During that bracket out output, i shouted, i clapped, i turned on loud music, and yet the numbers remain the same. The code im using for it is a simple serial monitor output code:

int sensorValue;

void setup()
{
   Serial.begin(9600);
}

void loop()
{
    sensorValue = analogRead (0);
    Serial.printIn (SensorValue, DEC);
    delay (100);
}

This code seemed simple enough, and it should show results right? But no matter what i do right beside the microphone, the number output doesn't change so it isn't registering what i'm doing.. Also, i copied the diagram that it showed me on how to wire up this particular microphone to the wire. I'm stuck..

Monday, 15 April 2013

MDDN 251: Understanding the shift register circuit using 74HC595N

This is a single shift register using the 74HC595N 8-bit serial parallel shift with 8 LEDs. With the positive and the negative pins it can be translated into the lights on the LCD screen that i have.

Further down on the website there is a double shift register that has 16 LEDs. This will be the circuit that i will need to understand to link it to my LCD screen.

Found on: http://www.codeproject.com/Articles/144606/Arduino-Platform-Working-with-Shift-Registers

Friday, 12 April 2013

MDDN 251: Light Combinations












Here are some combinations of lights. Wires were attached to the notches so that they could be connected together to make random patterns. This is the effects i want to create, now i need to sort out how to connect them to the Arduino and get it to have a sequence of patterns like this.

MDDN 251: Alarm Clock screen

So this post is going to have a large amount of images. I took the screen off the rest of the clock and when connected to a 9V power source i can light up specific parts of the display. The Negative is on the red wire, connected to one of the first three parts. The Positive can then be slid along the rest of the notches and lights up their own specific parts of the display. Shown briefly in this video:



After this, I took a photo of each individual one so it can be seen clearly what each notch does.