Assignment

  • Group Assignment: measure the power consumption of an output device
  • Document your work on the group work page and reflect what you learned on your individual page
  • Individual Assignment: add an output device to a microcontroller board you've designed, and program it to do something
  • All the important links are Here

    Learning outcomes

  • Demonstrate workflows used in controlling an output device(s) with MCU board you have designed.
  • Group Assignment

    For further information, please check our Group Assignment

  • measure the power consumption of an output device
  • The group assignment involved measuring the power consumption of an LED using a multimeter. Here's a breakdown of the steps followed:

    Equipment Required:
  • Multimeter with an Ammeter function
  • Power source (e.g., battery or power supply)
  • LED setup (LEDs, resistors, connecting wires)
  • Preparation:
  • Connect the components in series, including the main power supply from the Arduino connected to the CPU.
  • Measurement Process:
  • Set the multimeter dial to the Ammeter mode.
  • Check the current from the CPU without any LED or resistors, recording a value around 2.063 A.
  • Connect the LED:
  • Positive terminal of the power source to the anode (+) of the LED.
  • Cathode (-) of the LED to the positive (red) probe of the multimeter.
  • Negative (black) probe of the multimeter to the negative terminal of the power source, completing the circuit through the multimeter.
  • Turn on the power source and allow the LED to illuminate fully.
  • Observe and record the current reading on the multimeter, representing the operating current of the LED.
  • Calculation of Power Consumption:
  • Using the formula P = V * I (where P is power, V is voltage, and I is current), calculate power consumption.
  • If the voltage across the LED setup is known (e.g., 3V for many standard LEDs), use the measured current to calculate power consumption.
  • For example, if the voltage across the LED is 3V and the measured current is 10mA (0.01A), then P = 3V * 0.01A = 0.03W or 30mW.
  • Optional: Repeat and Average:
  • For enhanced accuracy, repeat the measurement process multiple times and calculate the average current and power consumption.
  • Individual Assignment

  • add an output device to a microcontroller board you've designed, and program it to do something
  • So, firstly I started off the week by redesigning my circuit board with lesser 0 ohm resistors. And I successfully did with just 6 0 ohms this time!

    Image 1
    Image 2

    Finished soldering!

    Your Image Description

    I tested the board to see if it was working, I uploaded the button code

    But for some weird reason, without even touching the buttons the led was lighting up when it sensed you were near.

    but unfortunately when I was connecting the LCD to my board, I noticed I had no SCL pin my connector. And also when I was testing all the buttons, one of the buttons didn't work. So, I had to redesign it again.

    No worries, I will get better each time!

    Image 1
    Image 2

    I checked the ATtiny44 pinout again, and I found out that pin PA4 is SCL, so I changed it.

    Image 1
    Image 2

    Since one of the switch was not working I changed it too. I connected the button in RX which was not recommended.The RX pin is designed for receiving serial data, not for reading button presses. It's optimized for this specific task and may not work reliably for other purposes like digital input from a button. Using it for such tasks can lead to unpredictable behavior and isn't recommended. It's better to use other available pins specifically designed for digital input tasks like reading button presses.

    Image 1
    Image 2

    Now, the overall schematic and PCB design with the recent changes made

    Image 1
    Image 2

    Printed the new board

    Your Image Description
    Comparing the boards I printed this week
    Your Image Description

    Now the main assignment

    Programming a output device

    LCD I2C display

    What is a LCD?

    An LCD (Liquid Crystal Display) is a flat panel display that uses liquid crystals to create images or text.An LCD display used in projects, such as those with Arduino or Raspberry Pi, typically refers to a small screen module that integrates liquid crystal technology for displaying text, numbers, or graphics. These displays come in various sizes and can be controlled via microcontroller platforms using specific libraries and protocols like I2C or SPI.

    Your Image Description

    What is a I2C module?

    An I2C module is like a translator that helps electronic parts talk to each other using a special language called I2C. It's like a connector that allows different devices to communicate smoothly and share information.

    Your Image Description

    LCD I2C
    Your Image Description

    To work with the LCD I2C, I needed to get an additional library because the standard Arduino IDE library doesn't support LCDs with I2C modules. It's like getting an extra tool to make sure the LCD and the I2C module can understand each other and work together properly.

    For the additional library, you can download it from here Downloading the additional library Download the .zip file that the link above leads you to.
    Image 1
    Image 2
    Image 1
    Image 2
    Image 1
    Image 2

    It worked!

    Next, I just changed the text