Week 12: Final Project Proposal and Progress

Concept

For my final project, I am building a Voice-Controlled Car.
The main idea is to create a small robotic vehicle that moves based on simple spoken commands such as “forward,” “left,” “right,” “backward,” and “stop.”

Instead of using a remote controller, buttons, or joysticks, the user interacts with the car entirely through speech. The goal is to make the interaction feel natural and intuitive, almost like the car is “listening” and responding in real time.

The project uses bi-directional communication between Arduino and p5.js:

  • p5.js listens to the user’s voice, recognizes the command, and sends it to the Arduino.

  • Arduino moves the motors and sends back status messages to p5.js.

This creates a complete loop where the user, p5.js, and the car are constantly communicating.

Arduino and P5 Communication

These are the main components I’m using in the project:

  • Arduino Uno

  • Adafruit Motor/Stepper/Servo Shield

  • 4 DC motors + wheels

  • Wooden board chassis

  • Battery pack (to power the motors)

  • USB cable or Bluetooth module (Adafruit Bluefruit EZ-Link)

  • Optional: LEDs or buzzer for feedback

Here is how the system is organized:

  • Microphone is connected to  p5.js to detect speech.

  • p5.js sends simple movement commands to the Arduino.

  • The Arduino controls the motors through the motor shield.

  • Arduino also sends responses back to p5.js to display status.

This makes the communication two-way, not just one-directional.

Arduino → P5 Communication

Every time the Arduino receives a command and performs the movement, it sends back a message so p5.js can update the interface.

For example: car_forward, car_left, car_right, car_backward, car_stopped

These messages allow the p5.js program to show real-time feedback about what the car is doing.
This also helps with testing and makes the experience feel more responsive.

Later on, this system can be expanded to include things like speed

P5 → Arduino Communication

The p5.js sketch uses the p5.SpeechRec() library to listen for specific keywords.
When a valid direction is heard, p5.js sends a short command to the Arduino through serial.

Spoken Word Code Sent to Arduino
forward F
left L
right R
backward B
stop S

Using one-letter codes keeps communication fast and reduces errors.

Arduino then reads the code and moves the motors accordingly using the Adafruit motor shield

Project Progress So Far

I began by building the physical structure of the car before working on the code.

What I have completed:

  • Attached four DC motors to the corners of my wooden chassis

  • Mounted the Adafruit Motor Shield onto the Arduino Uno

  • Fitted the wheels onto the motors

  • Tested spacing and placement for the battery pack

  • Ensured that the chassis is stable and balanced

  • Confirmed that all electronic components fit properly

Preliminary Concept : Voice-Controlled Car (Speech to Movement)

Concept  : Voice-Controlled Car

The main idea is to build a car that responds to spoken words like “forward,” “left,” “right,” and “stop.”
Instead of a remote control or buttons, the user interacts only through speech, making the experience feel natural and intuitive.

Interaction (How it Works)

On the laptop, a p5.js sketch uses the SpeechRec library to listen through the microphone.
When the user says a direction:

  • “forward” → the car should drive straight

  • “left” → the car turns left

  • “right” → the car turns right

  • “stop” → the car stops moving

p5.js identifies the spoken word and sends the corresponding command through serial communication to the Arduino.

The Arduino receives these simple messages and activates the correct motors to move the car.
The entire system becomes a loop of:

You speak → p5 listens → p5 processes → Arduino moves the car

The goal is to make it feel almost like the car is “listening” and responding to the user in real time.

Arduino Components

  • 1 Arduino Uno

  • 2 DC motors (for movement and turning)

  • 1 motor driver (L298N or similar)

  • Wheels + chassis

  • External battery pack for the motors

  • USB cable for serial communication

I might later add optional components like LED indicators or a small buzzer that reacts to commands, depending on how the project develops.

Why I Like This Idea

I like this concept because it feels fun, intuitive, and a bit magical.
Anyone can walk up and immediately understand how it works since people naturally speak commands like “go” or “stop.”

Reading Reflection

When I read this, I was struck by how much it changed the way I see the things we design for people with disabilities. I always thought the main goal was to make these products as invisible and discreet as possible,  thus to hide the need for them. It made sense to me that if something was medical, it should be quiet and blend in.

But then the reading talked about glasses. I wear glasses, and I never think of them as a medical device. I think about which frames look good on me. I feel more confident in some pairs than others. The reading pointed out that glasses became successful not by being hidden, but by becoming a fashion item , it’s something people are proud to wear. This was a big shift in my thinking. Why should a hearing aid or a prosthetic leg be any different? Why does it have to be hidden or made from “skin-colored” plastic?

I loved the story about Aimee Mullins and her collection of legs. She has running legs, elegant legs, and even beautifully carved wooden legs that she matches with her outfits. To her, they are not just tools; they are part of her identity and style. That idea felt  human to me. It’s not about ignoring the disability, but about embracing it as part of who you are and even celebrating it through design.

It also made me realize that good design isn’t just about solving a problem in the most efficient way. It’s about emotion, identity, and culture. When designers from fashion or art get involved, they bring new perspectives. They ask not just “How does it work?” but “How does it make you feel?”

I now  see disability not as something to be corrected or hidden, but as a source of inspiration for more creative, more personal, and more beautiful design. It made me hope that in the future, everyone will have the option to use assistive products that they don’t just need, but truly love.

Week 11

Exercise 1: Arduino to p5.js  – Potentiometer

Concept

This project shows how a physical sensor can control a digital object. A potentiometer on the Arduino sends its values to p5.js . In the sketch, these values move an ellipse left or right on the screen. Turning the knob changes the ellipse’s position instantly. 

Arduino Code

The Arduino reads the potentiometer value and sends it over serial:

int interval = 100; // milliseconds between readings

void setup() {
  Serial.begin(9600); // start serial communication
}

void loop() {
  int potValue = analogRead(A1); // read potentiometer
  int mappedValue = map(potValue, 0, 1023, 0, 255); // scale value
  Serial.println(mappedValue); // send value to p5.js
  delay(interval); // avoid flooding serial
}

p5.js Code

The p5.js sketch reads the serial data and moves the ellipse:

let positionX = 0;
let port;
let sensorValue = 0;

function setup() {
  createCanvas(400, 400);
  positionX = width / 2;

  port = createSerial();
  let used = usedSerialPorts();
  if (used.length > 0) port.open(used[0], 9600);
}

function draw() {
  background(220);

  let line = port.readUntil("\n");
  if (line.length > 0) {
    sensorValue = int(line.trim());
  }

  positionX = map(sensorValue, 0, 255, 0, width);

  ellipse(positionX, height / 2, 50, 50);
}

Video of the final result : Video

Excercise 2 : p5.js-to-Arduino LED Control

Concept

This project demonstrates how a digital signal from p5.js can control hardware on Arduino. Using a p5.js sketch, we can send commands over serial to turn an LED on or off.

Arduino Code

The Arduino listens for serial commands from p5.js and controls the LED accordingly:

The Arduino listens for serial commands from p5.js and controls the LED accordingly:
int ledPin = 13; // onboard LED

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600); // start serial communication
}

void loop() {
  if (Serial.available() > 0) {
    String command = Serial.readStringUntil('\n'); // read command
    command.trim(); // remove whitespace

    if (command == "ON") {
      digitalWrite(ledPin, HIGH); // turn LED on
    } 
    else if (command == "OFF") {
      digitalWrite(ledPin, LOW); // turn LED off
    }
  }
}

p5.js Code

The p5.js sketch sends commands to the Arduino based on events:

let port;
let connectBtn;

function setup() {
  createCanvas(400, 400);
  background(220);

  // initialize serial connection
  port = createSerial();
  let used = usedSerialPorts();
  if (used.length > 0) port.open(used[0], 9600);

  connectBtn = createButton("Connect");
  connectBtn.position(10, 10);
  connectBtn.mousePressed(toggleConnection);
}

function draw() {
  background(220);
}

function keyPressed() {
  if (port.opened()) {
    if (key === 'L') {         // press L to turn LED on
      port.write("ON\n");
    } else if (key === 'K') {  // press K to turn LED off
      port.write("OFF\n");
    }
  }
}

Video of the final result : Video

Excercise 3 : Bidirectional : Bouncing Ball with LED and Potentiometer

Concept

This project demonstrates bidirectional communication between Arduino and p5.js, combining physics simulation with hardware interaction. In this : A ball bounces on the p5.js canvas, following simple gravity physics. The horizontal wind affecting the ball is controlled by a potentiometer connected to Arduino. Turning the knob changes the wind force in real-time. Every time the ball hits the floor, p5.js sends a “BOUNCE” signal to Arduino, lighting up an LED. When the ball stops bouncing, p5.js sends a “STOP” signal, turning the LED off.

Arduino Code

Arduino reads the potentiometer and controls the LED based on serial commands:

 

int ledPin = 13;   // LED pin
int potPin = A1;   // potentiometer pin
int potValue = 0;

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // Read potentiometer value
  potValue = analogRead(potPin);
  Serial.println(potValue);  // send to p5.js

  // Check for incoming serial commands
  if (Serial.available() > 0) {
    String command = Serial.readStringUntil('\n');
    command.trim();

    if (command == "BOUNCE") {
      digitalWrite(ledPin, HIGH);   // light LED on bounce
    } else if (command == "STOP") {
      digitalWrite(ledPin, LOW);    // turn LED off when ball stops
    }
  }

  delay(50); // small delay for stability
}

p5.js Code

The p5.js sketch simulates a bouncing ball and sends commands to Arduino:

 

let velocity, gravity, position, acceleration, wind;
let mass = 50;
let drag = 0.99;

// SERIAL
let port;
let sensorValue = 0;

function setup() {
  createCanvas(640, 360);
  noFill();

  // physics
  position = createVector(width/2, 0);
  velocity = createVector(0, 0);
  acceleration = createVector(0, 0);
  gravity = createVector(0, 0.5 * mass);
  wind = createVector(0, 0);

  // serial
  port = createSerial();
  let used = usedSerialPorts();
  if (used.length > 0) port.open(used[0], 9600);
}

function draw() {
  background(255);

  // read potentiometer from Arduino
  let line = port.readUntil("\n");
  if (line.length > 0) sensorValue = int(line.trim());
  wind.x = map(sensorValue, 0, 1023, -1, 1);

  // apply forces
  applyForce(wind);
  applyForce(gravity);

  velocity.add(acceleration);
  velocity.mult(drag);
  position.add(velocity);
  acceleration.mult(0);

  ellipse(position.x, position.y, mass, mass);

  // bounce detection
  if (position.y > height - mass/2) {
    position.y = height - mass/2;

    if (abs(velocity.y) > 1) {
      velocity.y *= -0.9;
      if (port.opened()) port.write("BOUNCE\n"); // LED on
    } else {
      velocity.y = 0;
      if (port.opened()) port.write("STOP\n");   // LED off
    }
  }
}

function applyForce(force) {
  let f = p5.Vector.div(force, mass);
  acceleration.add(f);
}

Video of the final result : Video


Challenges and Improvements

In all three projects, the hardest part was making sure the Arduino and p5.js talked to each other correctly. Sometimes the data from the potentiometer didn’t come through clearly, which made the ellipse or bouncing ball move strangely or the LED turn on and off at the wrong time. It was also tricky to scale the sensor values so they controlled the visuals in a smooth way. In the bouncing ball project, making the LED light only when the ball bounced was challenging because the ball slowed down naturally. To improve, I could smooth the sensor readings to make movement less jumpy, make the ball bounce more realistically, or add more sensors or LEDs for extra interaction. These changes would make the projects work better and feel more interactive.

Ref:  In the last exercise, ChatGPT helped us by explaining and guiding the use of p5.Vector, physics calculations, and serial communication, which made Implementation easier.

Reflection

When I read “A Brief Rant on the Future of Interaction Design” by Bret Victor and its follow-up article, I began to think differently about how technology shapes the way we interact with the world. Victor argues that designers often focus too much on screens and touch gestures, forgetting that humans are physical beings with hands meant to explore, build, and create. He believes that the future of design should go beyond flat screens and should instead give people tools that let them use their bodies, senses, and creativity more naturally.

This idea really connected with me because, as someone interested in computer science and interactive media, I often think about how to make technology feel more human. I realized that many modern interfaces such as  phones, tablets, laptops imit our movements and creativity, even though they feel advanced. Victor’s point made me reflect on my own projects and how I can design in ways that allow people to move, touch, and engage with technology more freely.

The second  article deepened this idea by exploring how designers and engineers are beginning to create more physical and immersive experiences. It reminded me that innovation isn’t just about new technology but about how it connects with human experience. Reading both pieces made me want to think more carefully about how design can make people feel present and creative, not just efficient.



Week 10 Assignment

Concept

This week, Jayden and I  made a small musical instrument inspired by the piano. The piano is easy to understand and fun to play, so it was perfect for our Arduino project. We used three switches to play notes.  We also added a potentiometer that can change the pitch of the notes while playing. This means the player can make higher or lower sounds with the same switches. Using the switches and potentiometer together makes the instrument more interactive and fun, giving the player control over both the notes and their frequency.

Video : Link

Schematic

Code:

// Mini Piano: 3 switches, Piezo buzzer, optional pitch adjustment

const int buzzerPin = 8;      // Piezo buzzer
const int switch1 = 2;        // Key 1 (C)
const int switch2 = 3;        // Key 2 (E)
const int switch3 = 4;        // Key 3 (G)
const int potPin = A0;        // Optional: pitch adjust

// Base frequencies for the notes (Hz)
int note1 = 262;  // C4
int note2 = 330;  // E4
int note3 = 392;  // G4

void setup() {
  pinMode(buzzerPin, OUTPUT);
  pinMode(switch1, INPUT);
  pinMode(switch2, INPUT);
  pinMode(switch3, INPUT);
  Serial.begin(9600); // optional for debugging
}

void loop() {
  // Read potentiometer to adjust pitch
  int potValue = analogRead(potPin);        // 0-1023
  float multiplier = map(potValue, 0, 1023, 80, 120) / 100.0;  // 0.8x to 1.2x

  bool anyKeyPressed = false;

  // Check switches and play corresponding notes
  if (digitalRead(switch1) == HIGH) {
    tone(buzzerPin, note1 * multiplier);
    anyKeyPressed = true;
  }

  if (digitalRead(switch2) == HIGH) {
    tone(buzzerPin, note2 * multiplier);
    anyKeyPressed = true;
  }

  if (digitalRead(switch3) == HIGH) {
    tone(buzzerPin, note3 * multiplier);
    anyKeyPressed = true;
  }

  // Stop sound if no switch is pressed
  if (!anyKeyPressed) {
    noTone(buzzerPin);
  }

  delay(10); // short delay for stability
}

Github link : Paino

Reflection

This week’s assignment felt highly interactive, building upon previous projects while introducing multiple input elements and user-controlled parameters. We learned how to combine both digital and analog inputs to create a responsive musical instrument. For future improvements, we would like to implement a more realistic note duration system, where each note fades out naturally after being played, similar to a real piano. Additionally, adding more switches and possibly multiple buzzers could allow for more complex melodies and chords, enhancing the expressive possibilities.

Reflection- Week 9

When I read Physical Computing’s Greatest Hits and Misses and Making Interactive Art: Set the Stage, Then Shut Up and Listen, I started to think more deeply about what it really means to make something interactive. The first reading talked about how many beginner projects in physical computing repeat the same ideas, like using a sensor to make lights blink or to trigger sound. At first, I felt a little unsure because my own project also used simple tools like a light sensor and a button. But as I continued reading, I understood the real message: it’s okay to build something that has been done before, as long as I make it my own and give it a purpose. That made me feel more confident about my project. It reminded me that creativity doesn’t always mean doing something completely new, but doing something familiar in a meaningful or personal way.

The second reading focused on how interactive art should let people explore freely. It said that once we build something, we should “set the stage” and then step back, allowing others to interact with it in their own way. I really liked this idea because it made me think differently about my project. When I pressed the button or covered the light sensor, I realized that I was not just testing the circuit, I was actually engaging with it and discovering what it could do.

Both readings made me see that physical computing is not just about coding or wiring but it’s about creating an experience. It’s about giving people something they can explore and learn from on their own.

Analog Sensor

Concept

For this project, I used one analog sensor and one digital sensor (switch) to control two LED lights.

The analog sensor I used was a photoresistor (light sensor). It changes how much electricity passes through it depending on how bright the light in the room is. The Arduino reads this change and adjusts the brightness of one LED  when it’s dark, the LED gets brighter, and when it’s bright, the LED becomes dimmer.

For the digital sensor, I used a pushbutton connected to a digital pin. When I press the button, it turns the second LED on or off.

To make it different from what we did in class, I added a “night light” feature. When the photoresistor detects that the room is very dark, the button-controlled LED automatically turns on, like a small night light. When the light comes back, the button goes back to working normally.

This made my project more interactive and closer to how real sensors are used in everyday devices.

 Schematic of my circuit
It shows the Arduino connected to:

  • A photoresistor and 10 kΩ resistor forming a voltage divider to read light levels.

  • A pushbutton connected to a digital pin.

  • Two LEDs , one controlled by the light sensor and the other controlled by the button

Final Results

When I tested the circuit:

  • The first LED smoothly changed its brightness depending on how much light the photoresistor sensed.

  • The second LED turned on and off with the button as expected.

  • When the room got dark, the second LED automatically turned on, working like a night light.

It was a simple but satisfying project, and the extra feature made it stand out from the class example.

Video: video-url

Arduino Code

Part of Cold I am proud of

void loop() {
  // --- Read photoresistor ---
  int lightValue = analogRead(lightPin); // 0–1023
  int brightness = map(lightValue, 0, 1023, 255, 0);
  analogWrite(ledAnalog, brightness);

  // --- Button toggle ---
  if (digitalRead(buttonPin) == LOW) {
    ledState = !ledState;
    delay(200);
  }

  // --- Night light feature ---
  if (lightValue < 300) { // If it's dark, auto turn on LED
    digitalWrite(ledDigital, HIGH);
  } else {
    digitalWrite(ledDigital, ledState ? HIGH : LOW);
  }

  // --- Print readings ---
  Serial.print("Light: ");
  Serial.print(lightValue);
  Serial.print(" | Brightness: ");
  Serial.print(brightness);
  Serial.print(" | LED State: ");
  Serial.println(ledState ? "ON" : "OFF");

  delay(200);
}

Github url: Github

Challenges and Further Improvements

While I was able to make both the analog and digital sensors work, I struggled a bit with arranging all the wires and resistors neatly on the breadboard. It took a few tries to get everything connected correctly.

I also had to test different threshold numbers for the night light feature to decide when the LED should automatically turn on. Once I found the right value, it worked well.

For my next project, I want to try using other kinds of sensors, like sound or temperature sensors, and make the circuit respond in new ways. I’ll also practice reading the code line by line to understand how each part works better before adding new features.

Reflection – week 8

When I was reading these two articles side by side, I was struck by how they both explore the crucial role of human emotion in successful design, even though one is about teapots and the other about space travel.

Don Norman’s piece, “Emotion & Design,” argues that attractive things aren’t just a luxury but they actually function better. He explains that when we find a product pleasing, it puts us in a positive state of mind. This positive feeling makes us more tolerant of minor problems and more creative in solving them. I can see this in my own life; when I use a beautifully designed website, I feel more patient and engaged, and I don’t get frustrated easily. It’s not just about the tool working correctly, but about how it makes me feel while I’m using it.

This idea perfectly connects to the story of Margaret Hamilton. “Her Code Got Humans on the Moon” shows that the most brilliant technical system is useless if it doesn’t account for human nature. Hamilton understood that even the most highly trained astronauts were human and could make mistakes under immense pressure. Her fight to include error-checking code, which was initially dismissed, proved to be vital. Her software was designed with a deep understanding of human stress and fallibility, making it resilient and, in the end, heroic.

For me, the powerful lesson from both authors is that true excellence in any field requires blending logic with empathy. Norman shows us that beauty improves function by improving the user’s mindset. Hamilton shows us that anticipating human error is not a sign of weak design, but of strong, intelligent design. It reminds me that in my own work and studies, embracing creativity and understanding the human element is just as important as getting the technical details right.

Assignment

Concept

I created a simple switch using aluminum foil around my index finger and thumb. The goal was to make a switch that doesn’t use hands in the traditional sense ,  instead, it works by touching two parts of my own body together. When I bring my thumb and index finger together, the LED turns on. When they are apart, the LED turns off.

For this Arduino project.  I wrapped foil around my thumb and index finger to extend the conductivity, and connected each foil piece to the Arduino using jumper wires. . This simple prototype shows how the human body can become part of an electronic circuit.

 Link to video : Video

Highlight of the code

The code itself is simple. The Arduino reads the input from the foil on your fingers using digitalRead(). When your fingers touch (closing the circuit), it reads HIGH and turns on the LED. When you separate your fingers, the input reads LOW and the LED turns off.

int footSwitch = 2;   // Define the digital pin connected to the  switch (foil pad)
int ledPin = 13;      // Define the digital pin connected to the LED

void setup() {
  pinMode(footSwitch, INPUT);   // Set the foot switch pin as an input to read HIGH/LOW
  pinMode(ledPin, OUTPUT);      // Set the LED pin as an output so we can turn it on/off
}

void loop() {
  int switchState = digitalRead(footSwitch);  // Read the current state of the  switch

  if (switchState == HIGH) {    // If the switch is pressed (fingers touching)
    digitalWrite(ledPin, HIGH); // Turn the LED on
  } else {                      
    digitalWrite(ledPin, LOW);  // Otherwise, turn the LED off
  }
  
  delay(10); // Small delay to stabilize readings and avoid flickering
}

Reflection

This prototype is simple but effective. I noticed that the foil doesn’t always maintain perfect contact, so the LED sometimes flickers if the foil slips or my skin doesn’t touch the metal fully. I could improve this by using stretchable conductive tape  to make contact more consistent.

Even with these small issues, it was exciting to see how my body can act as a switch. Using just fingers and foil, I was able to control the LED and experiment with a non-traditional, hands-free interaction. It’s a great demonstration of how electronics and the human body can be creatively combined in fun, unexpected ways.