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



This is my first time i made this type of Design and i love this one with all the design i made in it.
Anime Design Image



What is Input 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. 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.
Basically, an input device is any hardware device that sends data to the microcontroller, allowing you to interact with and control the board. The input devices such as keyboard, mouse, sensors which send data to the microcontroller. Sensors are usually refer as input devices. Sensors like phototransistor and photo diode that detects the amount of light, temperature sensors, pressure sensors, humidity sensors, fluid sensors, etc.
Anime Design Image

An input device reacts to changes in the environment around it and produced a electrical signal for processing to an electronic circuit. It is generally grouped into 2 categories; Active and Passive devices.


Sensors



Sensors are electronic devices that detect physical changes and convert them into electrical signals. It output either analog or digital signals, requiring appropriate interfacing with microcontrollers.
Anime Design Image



1. Infrared (IR) Sensor



An Infrared (IR) Sensor detects infrared radiation emitted by objects. It is commonly used in remote controls, motion detectors, and temperature sensing. IR sensors work in active (emitting IR light) or passive (detecting heat) modes, depending on the application.
Anime Design Image



2. Temperature Sensor



A Temperature Sensor measures heat levels in an environment or object. It is widely used in HVAC systems, industrial automation, and medical devices. Common types include thermocouples, RTDs, and semiconductor-based sensors.
Anime Design Image



3. Humidity Sensor



A Humidity Sensor measures the moisture content in the air. It is widely used in weather monitoring, HVAC systems, and industrial processes to ensure optimal conditions. Typically, these sensors operate on capacitive or resistive principles to provide accurate humidity readings.
Anime Design Image



4. Gas Sensor



A Gas Sensor detects the presence and concentration of gases in the environment. It is used in industrial safety, air quality monitoring, and leak detection. Common types include electrochemical, infrared, and semiconductor-based sensors for detecting gases like CO₂, CO, and methane.
Anime Design Image



5. Light Dependent Sensor



A Light Sensor detects ambient light intensity and adjusts brightness accordingly. It is commonly used in smartphones, automatic lighting systems, and cameras. Common types include photodiodes, phototransistors, and LDRs (Light Dependent Resistors).
Anime Design Image








6. Touch Sensor



A Touch Sensor detects physical contact or pressure on a surface. It is widely used in touchscreens, interactive devices, and industrial controls. Common types include capacitive, resistive, and piezoelectric sensors.
Anime Design Image



7. Ultrasonic Sensor



An Ultrasonic Sensor measures distance by emitting high-frequency sound waves and analyzing their echo. It is widely used in robotics, obstacle detection, and parking assist systems. It operates effectively in various environments but may struggle with soft or angled surfaces.
Anime Design Image



8. Accelerometer



An Accelerometer measures acceleration forces, including motion, tilt, and vibration. It is widely used in smartphones, robotics, and automotive applications for orientation detection, step counting, and impact sensing. It operates using MEMS (Micro-Electro-Mechanical Systems) technology to detect changes in velocity.
Anime Design Image



9. Gyroscope



A Gyroscope measures angular velocity and rotational motion. It is used in navigation, stabilization, and motion tracking applications, such as drones, smartphones, and VR systems. It works by detecting changes in orientation using MEMS or fiber-optic technology.
Anime Design Image



10. Magnetometer



A Magnetometer measures magnetic fields and is commonly used for navigation, detecting metals, and geophysical surveys. It helps determine direction by sensing Earth’s magnetic field, often integrated into digital compasses and smartphones. It operates using Hall effect or fluxgate technology.
Anime Design Image



11. Proximity Sensor



A Proximity Sensor detects the presence of objects without physical contact. It is commonly used in smartphones, industrial automation, and vehicle parking systems. It operates using infrared, ultrasonic, capacitive, or inductive sensing technology.
Anime Design Image



12. PH Sensor



A pH Sensor measures the acidity or alkalinity of a liquid. It is widely used in water quality monitoring, agriculture, and chemical industries. It operates using an electrode that detects hydrogen ion concentration in a solution.
Anime Design Image



13. RFID Sensor



An RFID Sensor reads and verifies RFID tags using radio frequency signals. It is widely used in access control, inventory management, and contactless payment systems. It operates in low, high, or ultra-high frequency ranges depending on the application.
Anime Design Image



14. Vibration Sensor



A Vibration Sensor detects mechanical oscillations or movements in machines and structures. It is used in industrial monitoring, earthquake detection, and predictive maintenance. Common types include piezoelectric, MEMS, and accelerometer-based sensors.
Anime Design Image



15. Current Sensor



A Current Sensor measures electric current flow in a circuit. It is used in power monitoring, battery management, and industrial automation. Common types include Hall effect, shunt resistor, and Rogowski coil sensors.
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 3
  3. - SMD resistor 100 ohms (1206) X 3
  4. - Header Pins - 1x3 , 1x4, 1x2
  5. - KY - 004 Tactile switch 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. and 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

Anime Design Image



Intregration of Sensor with PCB Board that is by using IR Sensor



IR Sensor


An IR (Infrared) sensor detects infrared radiation emitted by objects. It consists of an IR LED that emits infrared light and a photodiode or phototransistor that receives it. IR sensors are commonly used for object detection, proximity sensing, and line following in robots. There are two main types: active (emits and detects IR) and passive (detects only IR from external sources). The sensor’s output changes based on the reflected IR light intensity. It works well for non-contact detection but can be affected by ambient light..

Anime Design Image

- IR LED (Infrared Light Emitting Diode):

Emits infrared light (typically around 940 nm wavelength). This light is invisible to the human eye but can be reflected by surfaces and detected by receivers.

- Photodiode or Phototransistor (IR Receiver):

Sensitive to infrared light. When it receives reflected IR light, its resistance changes, producing an analog signal. Phototransistors offer amplification and are more sensitive than photodiodes.

- Comparator (e.g., LM393):

Compares the voltage from the photodiode with a reference voltage. It outputs a digital HIGH or LOW signal based on whether the received IR intensity crosses a threshold.

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


Your browser does not support the video tag.
  1. Components required

  2. - Seeed studio Xiao ESP32C3 module X 1
  3. - SMD LED (1206) X 10
  4. - SMD resistor 100 ohms (1206) X 10
  5. - SMD resistor 0 ohms (1206) X 10
  6. - KY - 004 Tactile switch X 1


Download Files

Here, you can download the files that i made over this assignment
Laser Cutter Machine
1. Cog Wheel design
2. Kicad Project file
2. Gerber files

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