Week 12

Week 12: Output Devices


Group Assignment

  • Measure the power consumption of an output device.

  • Individual Assignment

  • Add an output device to a microcontroller board you've designed, and program it to do something.
  • Group Assignment

    In this week group assignment we have to measure power consumptions of an output device. Since we have used Led strip as output device so we are going to measure power consumptions over a individul RGB Led from strip. As many of our projects include LEDs so we decide to find the power consumption of RGBs on different color pattern. We have written some codes which blink one RGB led with specific color and measured the current of that specific leds.

    Program for one Led


    Voltage across LED Strip


    Current across RED LED


    The current is measured 47mA which is multiplied with 5 Volts is equal to 235mW

    Pogram for green LED


    Green LED


    Current across green Led

    The current is measured 21.46mA which is multiplied with 5 Volts is equal to 107.3mW. Same procss is used for other colors too. Different colors have different current consumptions. As per results we found that green color have low power consumption and white has maximum power consumption.

    Individual Assignment

    This week's assignment is to interface any output devices with attiny 44, 45 or atmega 328u. Since I have to use addressable rgb leds in my final project so I am interfacing these type of leds as output devices. I found some useful links from them randomtutorials is one of them which explain addressable rgb leds easily. These led strips are very handy because they are very flexible and can be cut to any length you want. Furthermore you can powerup these type of leds with cellphone adapter which is easily available everywhere.

    How Addressable WS2128b RGB LEDs Work?
    The WS2812B LEDs are addressable RGB LEDs that can be connected in series, and be controlled individually using just one digital pin of a microcontroller. These LEDs have an IC built right into the LED that make all of this possible. You can control the brightness and the color of each LED individually, which allows you to produce amazing and complex effects in a simple way.This LED strip is made by WS2812B LEDs wired in series. These LEDs have an IC built right into the LED. This allows a communication via a one-wire interface. This means that you can control lots of LEDs using just one digital pin of your microcontroller i-e arduino or atmega328u.














    Some Features of Addressable RGB Leds






    1. Individually addressable RGB LEDs (30, 60, or 144 LEDs per meter)
    2. 24-bit color control (8-bit PWM per channel); 16.8 million colors per pixel
    3. One-wire digital control interface
    4. 5 V operating voltage
    5. Each RGB LED draws approximately 50 mA at 5 V with red, green, and blue at full brightness
    6. Flexible, waterproof silicone rubber sheath
    Pin Configuration of Addressable RGB Leds






    Pin indication


    Interfacing the RGB Leds to Leonardo



    I have already mentioned in my previous week that I will be using this board for output assignment as well. So initially I had to programm this arduino board for that I first did few settings as shown below in figure (a). Initially I opened the arduino IDE where I selected the type of board as arduino leonardo and selected the connected port as COM10. Later I used example program of blink without delay and fad program which is shown below in figure (b). I used integrated led which is connected with pin 13 of arduino leonardo. The blink without delay program is shown below in figure (c).


    (a) Selecting arduino leonardo



    (b) Selecting and uploading program



    (c) Blink Without Delay Program

    Now I interface adressable rgb leds because I have to use these leds in my final project. The addressable rgb led strip has data in pin which can be used for programming. It has also vcc and gnd pin which shall be connected to 5v adapter. I connected vcc and gnd pin to 5v and pin 13 to rgb strip which can be seen below in figure. I uploaded the sample code which is also shown below in video frame.


    (a) Arduino fast led program




    (b) RGB LEDs interface with arduino leonardo