Wednesday, December 2, 2015

Measuring the Light (Luminosity)

In this challenge we had to have to get a special chip that didn’t come in the Sunfounder kit, but we do have on hand. We then clicked this link http://adafru.it/d7d to install the AdaFruit Library. After that we had to unzip it, copy the Folder and then find the Arduino library on our hard drive and paste it into the Library Folder there. We also needed the Adafruit Sensor Library.When completed we downloaded the Adafruit_Sensor Library then copied and pasted the folder into our Aquino's library folder like you did above. When completed we restarted the Arduino IDE. Now we could run the File->Examples->Adafruit_TSL2561->sensorapi example program which read and calculate the lux readings for us. Lastly we took a look at the program. To see the readings Ruth and I had clicked on the little magnifying glass at the top of the Arduino window to open the Serial Monitor. We then used code
{  
 sensors_event_t event;
 tsl.getEvent(&event);
 if (event.light)
 {
   Serial.print(event.light); Serial.println(" lux");
 }
 else
 {
      Serial.println("Sensor overload");
 }
 delay(250);

}

This code was recursive and just keeps calling itself over and over
The last code being used was:
Serial.print(event.light);

which prints out the luminosity value.

Monday, November 30, 2015

Wiring the RGB Bulb

For this post, we had to do something completely different compared to the last post "Writing Your Name". Our objective was to make different colors by using red, blue, and green wires that would change the color of the RGB bulb. To begin, we gathered all our materials. We used the Arduino Board, 3 different colored wires, 3 receptors, bread board and the RGB bulb. The RGB blub was completely different compared to the LED light.It had the ability to light up a certain color depending on what wire was plugged in. We then being mixing the colors. When we mix, blue and red, the RGB bulb turned purple. When the green and blue were mixed, it was more of a bluish color. When we finally mixed all 3 colors, it was a purple bluish color. 


This is the code used below: int redpin=9;      //Pin 9


int greenpin=10;    //Pin 10
int bluepin=11;      //Pin 11
int var=0;
int var1=0;

void setup()
{
}

void loop()
{
  
   analogWrite(redpin,0);    //GREEN
   analogWrite(greenpin,255);
   delay(5000);


   analogWrite(greenpin,0);    //GREEN
   analogWrite(bluepin,255);
   delay(5000);
 analogWrite(bluepin,0);    //GREEN
   analogWrite(redpin,255);
   del

Writing Your Name

For this post, our task was to have our name appear with a 7 segment display. A seven-segment is a electronic piece used to display numbers. To make this happen, we had to use certain materials. We used the bread board, LED lights, about 5 receptors and a SSD. Then, we kept the top part of the program the same. After you begin the loop part. For the loop part, we then entered the a code. A R for Ruth and a N for Nelson then appeared. We not only had the ability to flash our names, but we could turn them off right after.

This was the code used below:

void loop() {
 digitalWrite(ledB, HIGH);     // draw a R
 digitalWrite(ledC, HIGH);
 digitalWrite(ledD, HIGH);


 delay(2000);                 // wait for 2 second
 
 digitalWrite(ledB, LOW);   
 digitalWrite(ledC, LOW);
 digitalWrite(ledD, LOW);   // turn off R
 
 digitalWrite(ledE, HIGH);   
 digitalWrite(ledF, HIGH);     // turn on N
 digitalWrite(ledA, HIGH);
 digitalWrite(ledB, HIGH);   
 digitalWrite(ledC, HIGH);
 digitalWrite(ledG, HIGH);
 delay(2000);  
 
 digitalWrite(ledE, LOW);   
 digitalWrite(ledF, LOW);
 digitalWrite(ledA, LOW);     turn off N
 digitalWrite(ledB, LOW);   
 digitalWrite(ledC, LOW);
 digitalWrite(ledG, LOW);

}







Mixing Colors with RGB


For this project assignment we had to keep the same wiring as the last one, however we had to change the code. We then had to modify the following code to show 5 more colors. When we mixed the colors, turning on 2 or 3 lights at the same time we got other colors. We got more creative and decided to mix 5 different colors and show them each for 5 seconds, then show the next one.

In example if you turned off all the lights and then put



analogWrite(greenpin,255);
analogWrite(bluepin,255);


You would get Yellow. A mix of green and Blue. Let the light reflect off your hand and you should see the yellow light.


If you go to this site Colors  you will see how to mix colors
                                                                                                                   
                                                                                                                     
                                                                                                               

Counting with the 7 Segment Display

For this assignment we had to touch bases with the (SSD). A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.

In summary for this a very assignment we had to;

Step 1 - Find out what A Seven Segment Display was.
Step 2 -  Gather the Parts & Tools to full-fill this assignment.
Step 3 - Once we placed the tool and parts on the given spots on the breadboard we began our                 Testing
Step 4 - The we had to try again to Built The Circuit.
Step 5 - Once built we began the One Digit Count Down Timer
Step 6 - Multiplexing
Step 7 -Finally we began the Two Digit Count Down Timer
Picture of What Is A Seven Segment Display?

Monday, November 23, 2015

The Button Challenge

For this post, our challenge is pretty similar to Project 10. Like the one before, we had to light up an LED light using the code given to us. The only difference is that it'll have the ability to both turn on and turn off the light. If the light is off, it'd turn on and if the light was off, it'd turn on an LED light. For this post we had to have a variable. To begin we set it at 0. After pushing the button, if the variable was 0, we'd turn on the light and set the variable to 1. If the button is pushed and has the variable off 1, to turn it off, push the button and set the variable back to 0.

Setting up the Seven Segment Display

For this assignment we interacted with the seven segment display which goes across the board, not parallel to the longer side. Now we are going to work on a Seven Segment display. This is a very complex and challenging project. It works just like our external LED program, except it has 7 LEDs all together in one small chip. We will be able to count and display letters with this chip. This program gave us an idea of how you would light up a calculator display.You can see the seven segments up above. We were not concerned with the DP (decimal point light), but if we were writing a calculator program we would have needed it. When you are inserting this chip in the breadboard, make sure you do not bend the pins! Have the decimal point facing your Arduino. By connecting to the different pins, we will be able to make different segments of our display go on. 

Steps Followed

  1. First connect GND on Arduino to the third row from the top of the seven segment display. Then connect one of the slots (in picture we used slot 13) the Arduino to a row on the breadboard above the seven segment display. 
  2. Then use a resistor to from that row to a row above or below the seven segment display.
  3. We then start by putting our 7 Segment display chip on to the breadboard. One of set pins can be in column C and the other in column G. You can put it in any row, but it’s better somewhere in the middle (see picture below). 
  4. The next thing we hadto do is connect a wire on the breadboard to a Ground (GRD) on the Arduino. The ground (black wire below) has to be in a row three from the top of the 7 Segment Display. So if the first row was 28 like it is below , then we have to put a ground in row 31.








Thursday, November 19, 2015

Controlling LED

In this project we learned to read analog voltages from the arduino. We will learn how to set the brightness of a LED  based on the position of the potentiometer. A potentiometer is an adjustable resistor which consists of a wiper that slides across a resistive strip to deliver an increase or decrease in resistance. The level of resistance will determine output of current to the circuit.
Potentiometer. We will be using the following schematic Working from the top row of the Potentiometer :Potentiometer to breadboard. Make sure you have the breadboard oriented the right way with the - sign facing out. 
Steps we followed:
Connect the LED on the other side of the board (shorter side - ground on top) Connect wire from 1st pin on top of Potentiometer to ground rail. Connect 2nd pin of Potentiometer (3rd row from top) to Analog port 0. Connect 3rd pin of Potentiometer (5th from top) to power rail (+). Then connect ground rail on this row to Ground on Arduino. Connect Power rail on Breadboard to 5V port on Arduino

Image result for Controlling LED with Potentiometer
Image result for Controlling LED with Potentiometer















Button and LED

For this post, our objective was to simply press a button that would than turn on a LED light. To make this happen, we first needed two buttons, One for Column E and another that would be placed on Column F. The next step was pulling a cable cord in the GND port. In other words its specified as the "Ground" on the Arduino board. Along with this, another cable cord was plugged into the 5V power port. Unlike the other plug, it'll be connected to the top row. Next we texted resisters from the LED power pin and the resistors that were on the same row was the GND port that  was connected to the Arduino board. Finally we plugged in the code given to us. With this, we simply pressed a btton and the LED light lid up.


Below are pictures of all the materials needed to make the LED light light up.









Wednesday, November 18, 2015

Controlling LED with Potentiometer

For this post, our job was to  increase the brightness of a LED light based on the position of the potentiometer. The material used was a breadboard, two long jumper wires,  potension meter, USB cord, a red LED light, resistor, and the Arduino board. The potentiometer was an important material in order for this to happen because it has a wiper that slides across a resistive strip to deliver an increase or decrease in resistance. The first steps was the potentiometer to breadboard.In order for this to work, the breadboard must be oriented the right way.The sign must be facing out.to connect the wires onto the breadboard. For the next part,  you must connect the LED on the other side of the board. For the 3rd part, we connected the wire from 1st pin on top of the potentiometer to ground rail. For the 4th part, we connected the 2nd pin of potentiometer ( on the 3rd row from top to Analog port 0) . For the last pin, we connected the 3rd pin of potentiometer (5th from top) to power rail (+). Then connect ground rail on this row to Ground on Arduino. For the last part, we connected the the power rail on Breadboard to 5V port on Arduino.

Counting in Binary


For this next assignment we are now going to add a fourth LED and then we are going to count in binary

Binary numbers is Base 2 (our number system is Base 10)
As you can see the binary numbers starts with 0000 - all lights off
Then we will go to 1 -  0001 - the right most light will be on
Then we go to 2 - 0010 - the second light is on
Then we go to 3 - 0011 - the first and second light on the right will be on
Display each binary number for 2 seconds and then display the next one until you have all the numbers displayed up to 15

Tuesday, November 17, 2015

Programming Three LEDs

For part 6, our task was to write programs that'll make the blue LED light on our breadboard to light.To begin, we opened the Arduino Sketch and File. The first steps was getting our materials together. The materials used were: two jumper wires; a long orange wire, short black wire, a breadboard, Arduino, USB cord and a resistor. To begin, I put the orange LED light and the resistor into the breadboard.  We then connected a long orange jumper wire and a short black jumper wire into the Arduino board. For the final step, we copied the code in the Sketch. A orange light then blinked on and off.

The picture below shows what was resulted from following these steps.

Programming Two LEDs

In this project assignment Ruth and I had to unplug our Arduino which was already plugged in. We had to keep our red LED plugged into pin 12 as well. Now we had to do the same thing and put an LED in another row . We are going to do the same thing in another row. Next we had to take one end of a red jumper wire and plug it into another pin  on the Arduino. We were then in-trusted to connect the other end of the jumper wire and plug it into a row in the first section of the board on the Arduino (not the first two column) on the left side of the breadboard. Now we had to take one end of a resistor and plug it into the same row and then over into the next section. Finally took the positive end of a green LED (the longer leg) and plug it into that row and then connect the other end of the LED to the ground rail on the right side of the breadboard. When fully completed we got to see the two LED lights beaming at us.

Monday, November 16, 2015

Keep a Light On

Here in Step 3 Ruth and I had to use a Bread board to keep on a light bulb. First we unplugged our Arduino that was already plugged in. We then took one end of a black jumper wire and plugged it into the GND slot on the right side of the Arduino. Any hole in the column worked. Next we connected the other end of the black jumper wire to the ground rail on the right-hand side of the breadboard (the ground rail is the last column under the minus sign). We had to take one end of a red jumper wire and plug it into a Pin on the Arduino. Any would work as well. Again we connected the other end of the jumper wire and plug it into a Column on a row on the breadboard. Any Column A to D worked. We left leave E open for the transistor. Then we took one end of a resistor and plug it into a column E in the same row on the left side of the breadboard. Once more we connected the other end of the resistor into Column F, same row on the right side of the breadboard. Again we had to take the positive end of a red LED (the longer leg) and plug it into the same row. Lastly we connected the other end of the LED (the shorter leg) to the ground rail on the right side of the breadboard. This was all completed and we were able to witness the light stay on.