Skip to content

Output device

Group Assignment

Learning from Group Task: Measuring Power Consumption

  • I learned how to practically measure both voltage and current using a multimeter by setting up the probes correctly and choosing the right dial setting for DC voltage.

  • Understood the importance of connecting the multimeter in series to measure current and in parallel for voltage.

  • Realized that power consumption changes depending on the number of segments lit up on the 4-digit display.

  • Got comfortable using the Min/Max function on the multimeter to track fluctuations during operation.

  • Learned how to apply the formula P = V × I to calculate actual power usage based on live readings.

  • Understood why it's important to check power needs—helps in choosing the right power supply and avoiding overloading components.

For this week group work, detailed version is on Sharvari page.

Individual Assignment

A. What are Output Devices?

Output devices are components that allow a microcontroller or computer to communicate with the user or the outside world. These are the parts that show us the result of what’s happening inside the circuit or code — by creating movement, sound, light, or displaying information.

Some common output devices include:

  1. LEDs for visual feedback

  2. Motors for motion

  3. Displays for showing numbers, text, or animations

  4. Speakers for sound

In this assignment, I explored a few different output components and tested them with my custom PCB board (RP2040-based).

Link to PCB Board Fabrication: PCB Board Fabrication

NOTE: To play video, please click on particular image.

B. Touch Sensor with LED

The outcome I was aiming for was simple: when I touched the sensor, the LED should turn on, and when I removed my finger, the LED should turn off. It was a basic way to link an input (the sensor) with an output (the LED).

Connections

I connected the touch sensor to my PCB board so that it could detect my touch.

Component XIAO RP2040 Pin Notes
Touch Sensor VCC 3.3V Power supply for the sensor
Touch Sensor GND GND Ground connection for the sensor
Touch Sensor OUT D2 (GPIO2) Digital input pin for touch sensor
LED Anode (+) D3 (GPIO3) Output pin to control LED
LED Cathode (-) GND Ground connection for the LED

Image Then, I connected an LED to the PCB board, which is the output device. The idea was that the LED would light up when the sensor was touched.

I wrote a program to make the LED turn on or off depending on whether the touch sensor was activated. Touch Sensor with LED

This was just to try out simple functioning output on my PCB Board.

C. Servo Motor Positioning

The goal was to get the servo motor to rotate to a specific angle when triggered. This worked out well, and I was able to control the servo's movement through the signals from the PCB board.

Connections

Connected the servo motor to my PCB board, so it could move based on signals from the board.

Servo Motor Pin XIAO RP2040 Pin Notes
VCC (Red) 3.3V or 5V (if external) 5V (for MG995)
GND (Black/Brown) GND GND
Signal (Yellow/Orange) GPIO3 (or any PWM pin) -

Image Servo Motor Positioning

The whole reason I kept things simple at first was because I wanted to test things directly on the PCB board and make sure everything was working before adding any complexity. By using basic devices like the touch sensor, LED, and servo motor, I was able to see how input and output devices interacted in a real-world setup. Testing on the board made everything so much easier to troubleshoot and adjust, which helped me learn how each component worked in action.

D. Connecting NeoPixel Ring

I wanted to make my NeoPixel Ring glow using an RP2040 board (Raspberry Pi Pico). Turns out, it’s pretty simple once you know what to do!

Connections

NeoPixel Ring Pin RP2040 Pin Notes
DIN (Data In) GP6 Data pin for NeoPixel Ring
VCC (Power) 3.3V or 5V Power supply for NeoPixel (choose 5V for more brightness)
GND (Ground) GND Ground connection

Image What was Next?

1.Made each LED light up one by one (looked like a moving dot ).

2.Changed colors from red to green to blue in a loop.

3.Made a smooth rainbow effect (this looked SO good!).

4.Tried a random color sparkle effect—it was super fun!

Neopixel

Neopix

NeoPixels look amazing but are power-hungry. I experimented with brightness levels and saw how quickly power consumption could increase. Also, animations that used delays caused blocking issues, so I tried using non-blocking code for smoother transitions.

E. TM1637 Multiplication Displaying

Instead of using a clock, I decided to focus on multiplication for this project. I wanted to play around with numbers and show how they multiply, which could have practical uses like teaching multiplication, creating math games, or even for interactive displays in educational tools or apps. It was a fun way to experiment

Connections

TM1637 Pin RP2040 Pin Notes
CLK (Clock) GP2 Clock signal for the TM1637 (for data transfer)
DIO (Data) GP3 Data signal for communication with the TM1637
VCC 3.3V Power supply to the TM1637 (usually 3.3V)
GND GND Ground connection

Image TM1637 Multiplication Displaying

The TM1637 display uses a two-wire communication protocol (not I2C), and it’s important to update the digits manually using the correct library. It was fun to use a display to show live values, and I understood how displays can be a great feedback system for projects.

F. Text on 8x8 Matrix

I’d use an 8x8 LED matrix to create cool pixel art and make things blink, like I’m in a retro video game! I started by experimenting with writing text and seeing how it looked on the display.

Connections

MAX7219 Pin RP2040 Pin Notes
VCC 3.3V or 5V Power supply to the MAX7219 (choose 5V for higher brightness)
GND GND Ground connection
DIN (Data) GP3 Data input pin for communication with MAX7219
CS (Chip Select) GP4 Chip select pin for selecting the MAX7219
CLK (Clock) GP5 Clock pin for serial data transfer to the MAX7219

Image Matrix I used an 8x8 LED matrix to create cool pixel art and make things blink, like I’m in a retro video game! I started by experimenting with writing text and seeing how it looked on the display. The matrix uses SPI communication, so I connected it to my microcontroller using just a few pins (typically DIN, CLK, and CS), The matrix communicates over SPI, which made it easy to control using libraries like LedControl.h or MD_MAX72XX with just a few digital pins. Once I got the basic wiring done, I dove into the more creative part: designing text and animations pixel by pixel.

The most interesting part was designing my own characters and animations using pixel-based font maps. Each character is represented by an array of 8 bytes. Each byte stands for one row on the matrix, and each bit (1 or 0) determines whether a specific LED in that row is on or off. For example, to display the letter “A”, I created a byte array like this:

Image

This part was a bit challenging at first because I had to visualize each character in an 8x8 grid, think in binary, and get the bit order right. I sometimes used graph paper or online matrix editors to plan out the design before writing the code. But once it worked, it was really satisfying to see the characters come alive on the matrix.

After displaying static text and shapes, I also experimented with blinking effects and timed animations by refreshing the display every few milliseconds. The next step I want to try is scrolling text across multiple connected matrices. This would involve combining the pixel maps of multiple characters into a single buffer and shifting them frame by frame to create a smooth scroll effect.

Overall, working with pixel-based font maps on the LED matrix helped me understand how low-resolution graphics work, and gave me a fun way to mix coding with visual design.

Programming Process

For every device I worked with, I followed these steps:

1.Understanding the Device

Before writing code, I first learned how the device works:

Does it use digital, analog

Does it need a special library, or can I control it with just GPIO (General-Purpose Input/Output) pins?

2.Using Libraries and Example Code

I looked for good libraries and opened example sketches to see how they worked. Some libraries I used:

Adafruit_NeoPixel – for NeoPixel RGB LED rings

TM1637Display – for the 4-digit 7-segment display

LedControl – for the 8x8 LED matrix

Servo – for controlling servo motors

These examples helped me understand the functions and how to use them.

3.Adapting the Code

I updated the pin numbers in the code to match my custom RP2040 microcontroller board. This step was easy to forget, but very important.

I also changed the code logic to suit my project, like:

Making the NeoPixel ring pulse instead of just blink

Showing multiplication results on the TM1637 display

Rotating the servo to certain angles based on input

4.Debugging with the Serial Monitor

I used the Serial Monitor (a tool in the Arduino IDE) to print message

This helped me figure out if the problem was with:

Wiring

Code logic

Communication issues (like wrong library or baud rate)

I also printed sensor values to see how inputs were being read.

5.Delays vs. Non-blocking Code

At first, I used delay() to control timing. But I noticed it made other parts of the system pause. Later, I used millis() (a built-in function that gives the time in milliseconds) for better multitasking and smoother performance.

6.Testing Step-by-Step

Instead of writing all the code at once, I tested one thing at a time:

Check if the device works

Write basic code

Slowly add more features

This method helped me find and fix issues faster.

Key Learnings from Programming

Use the correct pins (for example, PWM pins for servos)

Libraries are useful, but always read the documentation

The Serial Monitor is super helpful while debugging

Test one device at a time before combining them

Comment your code – even the parts that failed, so you learn from them

About the Codes

Most of the codes I used in my projects were ChatGPT-tied. It made things a lot easier, but I still had to tweak a few things—changing pin numbers, adjusting for my board, and making sure everything actually worked. It’s a great support, but you can’t just copy-paste and expect it to run perfectly.

I realized it’s more important to understand how things work rather than just getting the code. Like:

Power matters – Some components say they work on 3.3V, but they run much better on 5V. Always check.

Signal levels – The RP2040 runs on 3.3V logic, so if a module expects 5V, a level shifter might be needed.

Polling vs. interrupts – If I keep checking a sensor in the loop, it slows things down. Interrupts are way more efficient.

Library choice – Not all libraries are the same. Some are lightweight, some have extra features. Picking the right one makes a difference.

Making it my own – Sure, I can display numbers on an LED matrix, but what if I want it to scroll? Or detect patterns on a touch sensor instead of just ON/OFF?

So yeah, getting code from ChatGPT is just the start. The real work is understanding it and making it work for my project.

Problems in way

  • One of the first issues I faced was with the LED not lighting up. It turned out that I had connected it the wrong way — the anode and cathode were reversed. After correcting it, everything worked fine.

  • With the NeoPixel ring, I initially saw random flickering. I realized I was powering it directly from the board, which wasn't enough.

  • The servo motor jittered a lot during testing.

  • For the TM1637 display, nothing showed up at first. I had to try a few different libraries before finding one that worked well with RP2040. I also ensured I was using the correct clock and data pins.

Learnings from Output Devices Week (Point Form)

  • Understood the difference between various output devices like servo motors, DC motors, stepper motors, LEDs, and buzzers.

  • Learned how PWM (Pulse Width Modulation) works and how it's used to control things like motor angle and LED brightness.

  • Got familiar with voltage and current requirements—some components need external power or protection (like diodes for motors).

  • Practiced reading datasheets and figuring out pin configurations before wiring.

  • Faced issues like twitching servos or overheating components due to wrong connections—learned from real mistakes.

  • Understood that timing, delays, and pulse width affect physical movement in motors.

  • Debugging involved both code-level fixes and hardware checks—sometimes the problem was physical, not just in the code.

  • Used multimeters to check voltage and continuity—helped in identifying broken or shorted parts.

  • Learned to write cleaner code using libraries like Servo.h and to avoid overloading the loop function with delays.

  • Developed more confidence in making circuits that result in visible, moving output—taking the project from static to interactive.

Reflection

This week helped me understand output devices in depth. Testing different types (LEDs, motors, displays) gave me a broader view of how devices communicate visually and physically with users. It also showed me the importance of planning for power requirements and matching pin functions (PWM, digital, analog) correctly.

I also realized how much trial and error is involved — and how each time something doesn’t work, it becomes a chance to understand the system better. Documenting each step made it easier to backtrack when things failed.

Original Code Files

Led with Sensor

Servo Motor Positioning

Connecting NeoPixel Ring-1

Connecting NeoPixel Ring-2

Connecting Neopixel Ring-3

TM1637 Multiplication Display

Text on 8x8 Matrix