Fab Lab
  • Home
  • About
  • Final Project
  • Assignment
  • Contact

Week 10 - Output Devices

Weekly Assessment

  • Week 1
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
  • Week 13
  • Week 14
  • Week 15
  • Week 16
  • Week 17
  • Week 18
  • Week 19

Assignment

Group assignment:



- Measure the power consumption of an output device..

- Document your work on the group page and reflect what you learned on your individual page.

Individual assignments:


- Add an output device to a microcontroller board you've designed and program it to do something..

Group Assigment



we measure the power consumption of the output device using equipments.
Click on this button to get it to our Group Assignment Page





Individual Assignment




heroshot



Anime Design Image



What is Output Devices ?



Output devices in electronics are components that convert electrical signals or digital data into a form that humans can perceive or use.
They play a crucial role in displaying, producing sound, or transferring data from a system to the external environment. These devices can convert data into visual, auditory, or physical forms. The primary function is to present the results of data processing to users.
Anime Design Image

They are essential for interaction with the system, providing feedback or information in real-time. Output devices can vary in size, function, and technology used. Their effectiveness directly influences user experience and system usability.


Actuators



actuator is a device that converts an electrical signal or another form of energy into a physical action or mechanical movement.
Anime Design Image



1. LED



A light-emitting diode (LED) is a semiconductor device that emits light when an electric current flows through it. When current passes through an LED, the electrons recombine with holes emitting light in the process.
Anime Design Image



2. RGB LEDr



An RGB LED is a type of light-emitting diode that can produce a wide range of colors by combining red, green, and blue light. It essentially contains three separate LEDs (red, green, and blue) within a single package. By adjusting the intensity of each color, RGB LEDs can create millions of different hues, including white light.
Anime Design Image



3. 7 Segment Display



A 7-segment display is a common electronic display component used to show numerical digits and some letters. It consists of seven LEDs arranged in a specific configuration, resembling the number "8" with three horizontal segments and four vertical segments.
Anime Design Image



4. relays



relay is an electrically operated switch used to control larger circuits with a smaller, lower-power signal. It acts as a bridge, allowing low-current signals to switch high-current loads.
Anime Design Image



5. DC Motor



A DC motor is an electrical machine that converts electrical energy, specifically direct current (DC), into mechanical energy, typically rotational movement. It works by using magnetic forces generated by the current flowing through coils to produce a torque, causing the motor to rotate.
Anime Design Image








6. Servo Motor



A servo motor is an electrical motor that allows for precise control of angular or linear position, speed, and torque using a feedback loop system. It uses a feedback mechanism to accurately control its motion, ensuring it moves to and stops at the specified position.
Anime Design Image



7. Stepper Motor



A stepper motor is a brushless DC electric motor that converts digital pulses into incremental shaft rotation. Unlike traditional DC motors that rotate continuously, stepper motors move in discrete steps, each corresponding to a specific angle of rotation (often 1.8 degrees for a typical motor), allowing for precise control over speed, position, and torque.
Anime Design Image



8. Buzzer



A buzzer or beeper is an audio signaling device, which may be mechanical, electromechanical, or piezoelectric (piezo for short). Typical uses of buzzers and beepers include alarm devices, timers, train and confirmation of user input such as a mouse click or keystroke.
Anime Design Image



9. LCD Display



An LCD consists of a layer of liquid crystals sandwiched between two transparent electrodes. When an electric current is applied, the crystals align to control the amount of light passing through them, creating the image you see on the screen.
Anime Design Image



10. OLED Display



An Organic Light-Emitting Diode (OLED) is a type of display technology where light is generated by organic materials. Unlike traditional LCDs, OLEDs don't use a backlight, meaning each pixel emits its own light, resulting in high contrast, deep blacks, and wide viewing angles.
Anime Design Image



Line Items



These are the Line Items that i have been used to create these design.
  1. - Seeed studio Xiao ESP32C3 module X 1
  2. - SMD LED (1206) X 1
  3. - SMD resistor 100 ohms (1206) X 1
  4. - Header Pins - 1x4 , 1x7, 1x5
  5. - KY - 004 Tactile switch X 1
  6. - Joystick Module X 1
  7. - 0.96 inch OLED Display X 1




Preparaing the Board



I have used KIcad Software to Create adn Develop my PCB Board
I created the Schematic and PCb Design with XIao ESP32C3 Microcontroller for my final Project as Well.

Anime Design Image

Here is my pcb design of my PCB Board that i created on it.

Anime Design Image

Here is the 3d Viewer of my design that i made on it.

Anime Design Image



PCB Production



I have Used FlatCAM software to Convert the gerber files to G-Code on it and here is the Gerber image of it
Anime Design Image

BY using FlatCAM on it by creating the toolpath for it on it as well as on this.

Anime Design Image

Here is the final generation of it.

Anime Design Image

Then i have used Wegstr Software to control our PCB milling Machine to work on it and also uploading it and also on the board designing as well to cut of my Board in it.

Anime Design Image

Here is the few images of my board production .

Anime Design Image

this is the board that i have made

Anime Design Image

Our Global Instructor is showing us how to do proper soldering in it.

Anime Design Image

i have checked the board on it by using multimeter for continuity test and solder the components with the board.

Anime Design Image

Anime Design Image



Intregration of Display with PCB Board that is by using OLED Display



OLED Display


The OLED display doesn’t require backlight, which results in a very nice contrast in dark environments. Additionally, its pixels consume energy only when they are on, so the OLED display consumes less power when compared with other displays.

Anime Design Image

The model we’re using here has only four pins and communicates with the Arduino using I2C communication protocol. There are models that come with an extra RESET pin. There are also other OLED displays that communicate using SPI communication.

This is the pin diagram of the Xiao ESP32C# module to connect with OLED Display.

Pin Wiring to Xiao ESP32C3
Vin 5V
GND GND
SCL A5
SDA A4

Programming



#include 
#include 
#include 

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#define JOY_X A0
#define FIRE_BTN 2

int shipX = SCREEN_WIDTH / 2;
const int shipY = SCREEN_HEIGHT - 10;

bool bulletActive = false;
int bulletX, bulletY;

int enemyX = 10;
int enemyY = 0;
int enemySpeed = 1;

int centerX = 0;          // Joystick resting X position
const int deadZone = 20;  // Dead zone range

int score = 0;            // Count of enemies shot

void drawAircraft(int x, int y) {
  // Draw a simple aircraft pointing up
  // x,y is bottom center of the aircraft

  // Body: vertical line
  display.drawLine(x, y, x, y - 7, SSD1306_WHITE);

  // Wings: diagonal lines
  display.drawLine(x, y - 3, x - 4, y - 1, SSD1306_WHITE);
  display.drawLine(x, y - 3, x + 4, y - 1, SSD1306_WHITE);

  // Tail: horizontal line at bottom
  display.drawLine(x - 2, y, x + 2, y, SSD1306_WHITE);

  // Nose: filled triangle on top
  display.fillTriangle(x - 1, y - 7, x + 1, y - 7, x, y - 10, SSD1306_WHITE);
}

void setup() {
  Serial.begin(115200);
  pinMode(FIRE_BTN, INPUT_PULLUP);

  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println("SSD1306 init failed");
    while (true);
  }
  display.clearDisplay();
  display.display();

  // Calibrate joystick center by averaging multiple readings
  long sum = 0;
  const int samples = 20;
  for (int i = 0; i < samples; i++) {
    sum += analogRead(JOY_X);
    delay(10);
  }
  centerX = sum / samples;
  Serial.print("Calibrated joystick center X: ");
  Serial.println(centerX);

  Serial.println("Setup done");
}

void loop() {
  display.clearDisplay();

  int xVal = analogRead(JOY_X);
  Serial.print("Joystick X: ");
  Serial.println(xVal);

  if (xVal < centerX - deadZone) {
    shipX -= 2;
  } else if (xVal > centerX + deadZone) {
    shipX += 2;
  }
  // else no movement

  shipX = constrain(shipX, 0, SCREEN_WIDTH - 10);

  if (digitalRead(FIRE_BTN) == LOW && !bulletActive) {
    bulletActive = true;
    bulletX = shipX + 5;
    bulletY = shipY;
  }

  if (bulletActive) {
    bulletY -= 5;
    if (bulletY < 0) bulletActive = false;
  }

  enemyY += enemySpeed;
  if (enemyY > SCREEN_HEIGHT) {
    enemyY = 0;
    enemyX = random(0, SCREEN_WIDTH - 10);
  }

  // Check collision between bullet and enemy
  if (bulletActive &&
      bulletX >= enemyX && bulletX <= enemyX + 10 &&
      bulletY >= enemyY && bulletY <= enemyY + 10) {
    bulletActive = false;
    enemyY = 0;
    enemyX = random(0, SCREEN_WIDTH - 10);
    score++;  // Increase score on hit
  }

  // Draw ship as aircraft
  drawAircraft(shipX + 5, shipY + 5);

  if (bulletActive) display.drawPixel(bulletX, bulletY, SSD1306_WHITE);

  // Draw enemy as rectangle
  display.fillRect(enemyX, enemyY, 10, 5, SSD1306_WHITE);

  // Display score top right
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(SCREEN_WIDTH - 50, 0);
  display.print(F("Score: "));
  display.print(score);

  display.display();
  delay(50);
}







- I connected the IR sensor analog pin with XIAO ESP32S3 board’s A2 pin, and also connected the 5V and GND with the Microcontroller.


- To check this I connected one LED in the microcontroller, I set the +Ve with D4 and connected the GND in that board.


- Then I set the IR sensor as input and LED as output, and give the serial begin 115200.


- I wrote the code like whenever I keep any object near by IR sensor then the LED will blink, remaining time it only as off condition.


Testing



there has been some miscaluclation that i made that is i have not given enough space for the joystick to move. so i was unable to mave that well


Your browser does not support the video tag.







So i have used jumper cable to connect the joystick module in order to move that freely.


Your browser does not support the video tag.







Download Files

Here, you can download the files that i made over this assignment
1. KiCad File
2. Gerber File
3. Arduino Code

Let’s Connect and Create!

    Interested in collaborating or working with me?

    Feel free to reach out! I'm always open to discussing new projects, creative ideas, or opportunities to be part of your vision.

    Let's create something amazing together!




  • nandalal@forge-iv.co

Copyright © 2025 - Designed By Nandalal Parthiban Navinsin