SACC

/ / navigation

Introduction
74HC595 IC
Cascading

/ / Using a seven segment LED Display



© Royalty Free/CORBIS
© Royalty Free/Corbis

At the junction, free electrons from the N-type material fill holes from the P-type material. This creates an insulating layer in the middle of the diode called the depletion zone.




When the negative end of the circuit is hooked up to the N-type layer and the positive end is hooked up to P-type layer, electrons and holes start moving and the depletion zone disappears.
  • A diode has two different semiconducting materials that allow electricity to flow in one direction only. One part is N-type material which has extra electrons. The other part is P-type material which has "holes" (particles that are missing electrons) into which electrons can move. What happens at the junction of the two materials is that the extra electrons from the N-type move to the "holes" in the P-type and create an area of no charge called the "depletion zone." The result is an area of N-type material, the depletion zone, and the P-type material.

  • When the N-type side is connected to the negative end of a battery and the P-type side to the positive end of the battery, the electrons in the N-type material are repelled and move across the P-type material. At the same time, the holes in the P-type material are repelled by the positive end. The result is a current. If you connect the ends of the battery in the opposite way, the current won't flow.

  • There are all sorts of LEDs. Some emit infrared light (your remote control) and others produce light of different colors. The color is determined by the material used in the diode. As electrons move from the N-type material to the P-type material, electrons drop to a lower orbit and release energy. The distance the electrons have to drop depends on the material and determines the color of lights.

Class Assignment: Control an LED display with the Arduino chip

  1. Insert the LED number display so that it spans the central divider of the breadboard. If the display does not fit snugly on the breadboard, check to see that all pins are straight and press firmly.



  2. Wire one cathode (referred to as a common cathode on the diagram) to the negative power track (ground).

    Specifications
    Single Digit LED Display
    (276-0075)                 Specifications             Faxback Doc. # 38029
    
    Type: .............................................................. S321R
    
    Pinout:
    
    Pin  1: .......................................................... Anode F
    Pin  2: .......................................................... Anode G
    Pin  3: .............................................................. N/C
    Pin  4: ................................................... Common Cathode
    Pin  5: .............................................................. N/C
    Pin  6: .......................................................... Anode E
    Pin  7: .......................................................... Anode D
    Pin  8: .......................................................... Anode C
    Pin  9: .................................. RHDP (Right Hand Decimal Point)
    Pin 10: .............................................................. N/C
    Pin 11: .............................................................. N/C
    Pin 12: ................................................... Common Cathode
    Pin 13: .......................................................... Anode B
    Pin 14: .......................................................... Anode A
    
    NOTE:  Pins 4 & 12 are internally connected
    Radio Shack Common Cathode Pins
    1          14
    2    _     13
       |   |   12
    4    _
       |   |
    6    _     9
    7          8
    




  3. To light the different LED segments, you will experiment by connecting wires between the the different anode pins to a resistor to power. Keep track of your results.

    Write down on a piece of paper which pin lights up which segment.

    Don't forget to connect pins 2-9 with 220Ω resistors.

  4. Connect a push button using a 10K pull-down resistor.
    Push Button schematic


  5. Connect two LEDs using 220Ω resistors.



  6. Create a program that when a user presses the push button, a countdown of digits is displayed, and when the number 0 is displayed have the two LEDs blink.

    code hints:
    Previous Assignment counting Button presses
    Create methods to turn on particular numbers:
    void led1(){
    
    }
    
    void loop(){
    //....
    switch (btnPresses) {
        case 0:
          //do something when var == 1
          led1();
          break;
          // break is optional
        case 1:
          //do something when var == 2
          break;
          
        //continue...
        
        default: 
          // if nothing else matches, do the default
          // default is optional
      }
    


Watch the video now