Palden Bhutia — Electrical Engineering Portfolio

Guides

Simple starter builds — the ones I'd point a complete beginner to first. Work top to bottom: each build adds one new skill, and every guide opens with the full parts list, wiring, and code.

Build 01Level 1 of 3

Arduino Piano

Three buttons, three notes. Each key lights its own LED and plays C, D, or E on a piezo buzzer — inputs and outputs in their simplest, most satisfying form.

digitalRead()INPUT_PULLUPtone()

Parts6 items

  • Arduino Uno
  • 3 push buttons
  • 3 LEDs
  • 3 × 220 Ω resistors
  • 1 piezo buzzer
  • Breadboard + 6 male-to-male jumpers

Wiring3 connections

  • Buttons → D2 (E), D3 (D), D4 (C) — other leg to GND (internal pull-ups, no resistors needed)
  • LEDs → D5, D6, D7, each through a 220 Ω resistor to GND
  • Piezo buzzer → D8 and GND
piano.ino
const int button1 = 2; // E
const int button2 = 3; // D
const int button3 = 4; // C

const int led1 = 5;
const int led2 = 6;
const int led3 = 7;

const int piezo = 8;

// Correct note frequencies
const int NOTE_C4 = 262;
const int NOTE_D4 = 294;
const int NOTE_E4 = 330;

void setup() {
  pinMode(button1, INPUT_PULLUP);
  pinMode(button2, INPUT_PULLUP);
  pinMode(button3, INPUT_PULLUP);

  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);

  // pinMode(piezo, OUTPUT); // not required for tone()
}

void loop() {
  bool b1 = (digitalRead(button1) == LOW);
  bool b2 = (digitalRead(button2) == LOW);
  bool b3 = (digitalRead(button3) == LOW);

  // LEDs follow button presses
  digitalWrite(led1, b1);
  digitalWrite(led2, b2);
  digitalWrite(led3, b3);

  // Priority if multiple buttons pressed at once: 1 > 2 > 3
  if (b1) {
    tone(piezo, NOTE_E4);
  } else if (b2) {
    tone(piezo, NOTE_D4);
  } else if (b3) {
    tone(piezo, NOTE_C4);
  } else {
    noTone(piezo);
  }
}

Build 02Level 1 of 3

Joystick LED Controller

Tilt the stick, steer the light. Four LEDs mark up, down, left and right and follow the joystick — your first step from on/off buttons to reading real analog voltages.

analogRead()thresholdsSerial Monitor

Parts5 items

  • Arduino Uno
  • 2-axis analog joystick module
  • 4 LEDs
  • 4 × 220 Ω resistors
  • Breadboard + male-to-male jumpers

Wiring3 connections

  • Joystick VCC → 5V, GND → GND
  • VRx → A0, VRy → A1
  • LEDs: left D4, right D5, up D6, down D7 — each through 220 Ω to GND

Open the Serial Monitor at 9600 baud to watch the raw X/Y values while you move the stick.

joystick_leds.ino
// Joystick pins
const int joyX = A0;
const int joyY = A1;

// LED pins
const int ledLeft  = 4;
const int ledRight = 5;
const int ledUp    = 6;
const int ledDown  = 7;

void setup() {
  pinMode(ledLeft, OUTPUT);
  pinMode(ledRight, OUTPUT);
  pinMode(ledUp, OUTPUT);
  pinMode(ledDown, OUTPUT);

  Serial.begin(9600);
}

void loop() {
  int x = analogRead(joyX);
  int y = analogRead(joyY);

  // Turn all LEDs off
  digitalWrite(ledLeft, LOW);
  digitalWrite(ledRight, LOW);
  digitalWrite(ledUp, LOW);
  digitalWrite(ledDown, LOW);

  // Horizontal movement
  if (x < 300) {
    digitalWrite(ledLeft, HIGH);
  }
  else if (x > 700) {
    digitalWrite(ledRight, HIGH);
  }

  // Vertical movement
  if (y < 300) {
    digitalWrite(ledDown, HIGH);
  }
  else if (y > 700) {
    digitalWrite(ledUp, HIGH);
  }

  // Debug values (optional)
  Serial.print("X: ");
  Serial.print(x);
  Serial.print("  Y: ");
  Serial.println(y);

  delay(50);
}

Build 03Level 2 of 3

Ultrasonic Radar Scanner

A sonar sweep for your desk. An HC-SR04 rides a servo across 180°, pinging distance at every angle and streaming it over serial to a glowing green radar display built in Processing.

Servo librarypulseIn()serial data

Parts4 items

  • Arduino Uno
  • HC-SR04 ultrasonic sensor
  • SG90 micro servo
  • Breadboard + jumper wires

Wiring2 connections

  • HC-SR04: VCC → 5V, GND → GND, TRIG → D9, ECHO → D10
  • Servo: red → 5V, brown → GND, yellow (signal) → D6

The radar display runs in Processing (free). Set your serial port near the top of radar_display.pde — COM3-style on Windows, /dev/cu.usbmodem… on Mac.

#include <Servo.h>

Servo radarServo;

// Pins
const int servoPin = 6;
const int trigPin  = 9;
const int echoPin  = 10;

// Sweep settings
int angle = 0;
int stepDir = 1;                 // +1 goes right, -1 goes left
const int minAngle = 0;
const int maxAngle = 180;

const unsigned long servoIntervalMs = 20;  // 20ms = smooth (50 Hz-ish)
unsigned long lastServoMove = 0;

long getDistanceCM() {
  // Trigger pulse
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  // Read echo (timeout prevents freezing if no echo)
  unsigned long duration = pulseIn(echoPin, HIGH, 30000UL); // 30ms timeout

  if (duration == 0) return 999; // out of range / no reading

  // Speed of sound ~0.0343 cm/us, divide by 2 for round trip
  return (long)(duration * 0.0343 / 2.0);
}

void setup() {
  Serial.begin(9600);

  radarServo.attach(servoPin);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  radarServo.write(angle);
}

void loop() {
  unsigned long now = millis();

  // Move servo at a steady interval (smooth back-and-forth)
  if (now - lastServoMove >= servoIntervalMs) {
    lastServoMove = now;

    radarServo.write(angle);

    // Take distance reading
    long distance = getDistanceCM();

    // Send to PC: "angle,distance"
    Serial.print(angle);
    Serial.print(",");
    Serial.println(distance);

    // Update angle and bounce at ends
    angle += stepDir;
    if (angle >= maxAngle) {
      angle = maxAngle;
      stepDir = -stepDir;
    } else if (angle <= minAngle) {
      angle = minAngle;
      stepDir = -stepDir;
    }
  }
}

Build 04Level 3 of 3

Reaction Time Tester

How fast are you, in milliseconds? After a random wait one of three LEDs fires — hit the matching button and the LCD prints your reaction time. Press early and it calls you out.

LiquidCrystalmillis()random()

Parts7 items

  • Arduino Uno
  • 16×2 LCD
  • 10 kΩ potentiometer (contrast)
  • 4 push buttons — 1 start + 3 reaction
  • 3 LEDs
  • 4 × 220 Ω resistors (3 LEDs + LCD backlight)
  • Breadboard + male-to-male jumpers

Wiring4 connections

  • LCD: RS → D7, E → D8, D4–D7 → D9–D12; VSS, RW, K → GND; VDD → 5V; A → 5V via 220 Ω
  • LCD VO → potentiometer middle pin (outer pins to 5V and GND) for contrast
  • LEDs → D2, D3, D4, each through 220 Ω to GND
  • Buttons: start → A0, reaction → A1–A3 — other leg to GND (internal pull-ups)

Install the LiquidCrystal library from the Arduino IDE’s Library Manager before uploading.

reaction_test.ino
#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

// LED pins
const int leds[3] = {2, 3, 4};

// Button pins
const int startButton = A0;
const int buttons[3] = {A1, A2, A3};

unsigned long startTime;
int activeLED = -1;

void setup() {
  lcd.begin(16, 2);

  // LEDs
  for (int i = 0; i < 3; i++) {
    pinMode(leds[i], OUTPUT);
    digitalWrite(leds[i], LOW);
  }

  // Buttons (internal pullups)
  pinMode(startButton, INPUT_PULLUP);
  for (int i = 0; i < 3; i++) {
    pinMode(buttons[i], INPUT_PULLUP);
  }

  showStartScreen();
}

void loop() {
  // Wait for START button
  if (digitalRead(startButton) == LOW) {
    delay(300); // debounce
    runReactionTest();
    showStartScreen();
  }
}

void showStartScreen() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Reaction Test");
  lcd.setCursor(0, 1);
  lcd.print("Press START");
}

void runReactionTest() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Get Ready...");

  delay(random(2000, 5000)); // random wait

  activeLED = random(0, 3);
  digitalWrite(leds[activeLED], HIGH);

  startTime = millis();

  while (true) {
    // Check reaction buttons
    for (int i = 0; i < 3; i++) {
      if (digitalRead(buttons[i]) == LOW) {
        unsigned long reactionTime = millis() - startTime;
        digitalWrite(leds[activeLED], LOW);

        lcd.clear();

        if (i == activeLED) {
          lcd.setCursor(0, 0);
          lcd.print("Reaction Time:");
          lcd.setCursor(0, 1);
          lcd.print(reactionTime);
          lcd.print(" ms");
        } else {
          lcd.setCursor(0, 0);
          lcd.print("Wrong Button!");
          lcd.setCursor(0, 1);
          lcd.print("Try Again");
        }

        delay(3000);
        return;
      }
    }

    // Prevent early press before LED
    if (digitalRead(startButton) == LOW) {
      digitalWrite(leds[activeLED], LOW);
      lcd.clear();
      lcd.print("Too Early!");
      delay(2000);
      return;
    }
  }
}

Build 05Level 3 of 3

Pomodoro Timer

A desktop focus timer: 25-minute work blocks, 5-minute breaks, start / pause / reset buttons and a buzzer between phases. Debouncing, millis() timing and a real state machine — the fundamentals behind every bigger build.

state machinedebouncingmillis()

Parts7 items

  • Arduino Uno
  • 16×2 LCD
  • 10 kΩ potentiometer (contrast)
  • 3 push buttons
  • 1 buzzer
  • 1 × 220 Ω resistor
  • Breadboard + jumper wires

Wiring4 connections

  • LCD: RS → D12, E → D11, D4–D7 → D5, D4, D3, D2; VSS, RW, K → GND; VDD → 5V; A → 5V via 220 Ω
  • LCD VO → potentiometer middle pin for contrast
  • Buttons: start → D8, pause → D9, reset → D10 — other leg to GND (internal pull-ups)
  • Buzzer → D6 and GND

Uses the LiquidCrystal library — install it from the Library Manager first.

pomodoro.ino
#include <LiquidCrystal.h>

// LCD: RS, E, D4, D5, D6, D7
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Buttons
const int BTN_PLAY  = 8;   // Start
const int BTN_PAUSE = 9;   // Pause
const int BTN_RESET = 10;  // Reset

// Optional buzzer
const int BUZZ_PIN = 6;

// Pomodoro times (seconds)
const long FOCUS_TIME_SEC = 25L * 60L;  // 25 minutes
const long BREAK_TIME_SEC = 5L  * 60L;  // 5 minutes

// State
enum Phase { FOCUS, BREAK };
Phase phase = FOCUS;

bool running = false;
long remainingSec = FOCUS_TIME_SEC;
unsigned long lastTickMs = 0;

// Debounce struct
struct Btn {
  int pin;
  bool lastStable;
  bool lastRead;
  unsigned long lastChangeMs;
};

Btn bPlay  {BTN_PLAY,  HIGH, HIGH, 0};
Btn bPause {BTN_PAUSE, HIGH, HIGH, 0};
Btn bReset {BTN_RESET, HIGH, HIGH, 0};

const unsigned long DEBOUNCE_MS = 35;

bool pressed(Btn &b) {
  bool r = digitalRead(b.pin);
  unsigned long now = millis();

  if (r != b.lastRead) {
    b.lastRead = r;
    b.lastChangeMs = now;
  }

  if ((now - b.lastChangeMs) > DEBOUNCE_MS && b.lastStable != r) {
    b.lastStable = r;
    if (b.lastStable == LOW) return true; // pressed
  }
  return false;
}

void beep(int times) {
  for (int i = 0; i < times; i++) {
    tone(BUZZ_PIN, 2000);
    delay(100);
    noTone(BUZZ_PIN);
    delay(100);
  }
}

void setPhase(Phase p) {
  phase = p;
  running = false;
  remainingSec = (p == FOCUS) ? FOCUS_TIME_SEC : BREAK_TIME_SEC;
  lastTickMs = millis();
}

void drawLCD() {
  // Top line: FOCUS or BREAK
  lcd.setCursor(0, 0);
  lcd.print("                ");
  lcd.setCursor(0, 0);
  lcd.print(phase == FOCUS ? "FOCUS" : "BREAK");

  // Bottom line: MM:SS
  int mm = remainingSec / 60;
  int ss = remainingSec % 60;

  lcd.setCursor(0, 1);
  lcd.print("                ");
  lcd.setCursor(0, 1);

  if (mm < 10) lcd.print("0");
  lcd.print(mm);
  lcd.print(":");
  if (ss < 10) lcd.print("0");
  lcd.print(ss);
}

void resetPomodoro() {
  setPhase(FOCUS);
}

void setup() {
  pinMode(BTN_PLAY,  INPUT_PULLUP);
  pinMode(BTN_PAUSE, INPUT_PULLUP);
  pinMode(BTN_RESET, INPUT_PULLUP);

  pinMode(BUZZ_PIN, OUTPUT);
  noTone(BUZZ_PIN);

  lcd.begin(16, 2);
  lcd.clear();

  resetPomodoro();
  drawLCD();
}

void loop() {
  unsigned long now = millis();

  // Buttons
  if (pressed(bPlay)) {
    if (!running) {
      running = true;
      lastTickMs = now;
      beep(1);
    }
  }

  if (pressed(bPause)) {
    if (running) {
      running = false;
      beep(1);
    }
  }

  if (pressed(bReset)) {
    resetPomodoro();
    beep(2);
  }

  // Countdown
  if (running && (now - lastTickMs) >= 1000) {
    lastTickMs += 1000;

    if (remainingSec > 0) remainingSec--;

    if (remainingSec == 0) {
      beep(3);
      if (phase == FOCUS) setPhase(BREAK);
      else setPhase(FOCUS);
    }
  }

  // Refresh LCD
  static unsigned long lastDraw = 0;
  if (now - lastDraw > 200) {
    lastDraw = now;
    drawLCD();
  }
}

Stuck on a build? DM me on Instagram @engineeringwithpalden — end your message with “arduino” so it doesn’t get lost in my inbox.

Ready for more? See what I'm building now Study library Notes and resources