Week 10: Output Devices

Controlling real-world devices using a microcontroller

1. Introduction

Output devices allow a microcontroller to act on the physical world. They convert digital signals into physical actions such as light, motion, or sound. In this assignment, I worked with an RGB LED to understand how output control works in embedded systems.

2. Group Assignment

We measured the power consumption of an output device using a multimeter.

Power Measurement Setup Multimeter Reading

3. Output Device Used

RGB LED Setup

4. Workflow Process

1. Circuit Connection

The RGB LED was connected directly to the microcontroller output pins.

RGB LED Connection

2. Programming the Output

I programmed the microcontroller to control color changes using PWM signals.

Code for RGB LED

3. Testing Output

The LED changed colors based on the programmed sequence.

RGB LED Working

5. How the Code Works

The code uses PWM (Pulse Width Modulation) to control the brightness of each RGB channel. By adjusting duty cycle values, different colors are created by mixing red, green, and blue intensities.

Code Explanation

6. Learning Outcomes

7. Lessons Learned

I learned that output devices require proper current control and correct programming to function safely. I also understood how power consumption is measured and how different output levels affect energy use.

8. Conclusion

This assignment helped me understand how microcontrollers control output devices and how electrical power is used in real systems. I gained practical experience in programming, circuit design, and power measurement.