Week 8 – Unusual Switch

When thinking of an unusual switch, I looked for something that is less used in the kit and unconventional. I chose to explore how I can use the temperature sensor creatively as a switch. When thinking of the same, I realized most air conditioning units require manual input which may be an inconvenience to people who have specific and fixed room temperature requirements. I therefore decided to create a program that can be preset so that the AC unit can adjust automatically as it has been configured. For the MVP I had one LED light to show the change in temperature such that it lit when the temperatures went above a certain threshold and went off when the temperatures reduced below a certain level. I later added two more LED lights so that together with the three led lights could show the signal when the temperature was within certain ranges. Why is this important? This program could be modified and connected to a thermostat so that instead of only turning the A/C on and off, one could set it to self-modify the temperatures when the room temperature is at a certain level without necessarily changing it manually.

CODE HIGHLIGHTS

The only part that was slightly challenging was converting the reading from the TMP36 to voltage and later on to degrees celsius. I realized that the TMP36 sensor has a linear output of 10mV per °C, with an offset of 500mV at 0°C. And therefore to convert to volts and degrees I used the following block of code;

void loop() {
  reading = analogRead(A0);  // read analog pin
  volts = reading * aref_voltage / 1023.0; // convert to voltage
  millivolts = 1000 * volts; // convert to millivolts
  degreesC = (millivolts - 500)/10;  // convert to deg C
  degreesF = (degreesC * 9/5) + 32;  // convert to deg F

 

IMAGES AND DEMO

REFLECTIONS AND FUTURE IMPROVEMENTS

Using the temperature sensors was fun but as the Professor noted in one of the classes it can be a boring tool in the sense that it takes long to actually test it’s efficacy owing to the rigidity of the independent variable – temperature. Going forward I’d love to make projects that are more user friendly and more interactive that is; makes more use of the physical things around us. Also, I definitely will be exploring the other items in the toolkit even more.

Demonstration Video

To analyze the thermal response of the circuit, I positioned it near the heat emission area of my laptop, then incrementally increased the distance to observe variations in temperature effect

Demonstration

 

Assignment 9: Digital and Analogue Detection

This is my Analogue and Digital device sensing machine. It uses an Ultrasonic sensor and Push button to change the brightness of LEDs and to toggle them on/off.

Assignment Brief

  • Get information from at least one analogue sensor and at least one digital sensor
  • Use this information to control at least two LEDs, one in a digital fashion and the other in an analog fashion
  • Include a hand-drawn schematic in your documentation

Conceptualisation

The idea for this project was inspired by the desire to create an interactive system that responds to both user input and environmental conditions. I wanted to design a setup where users could actively engage with the system while also observing dynamic feedback. By using an ultrasonic sensor as the analog input, I aimed to create a setup where distance could influence the brightness of an LED, making it visually engaging. Additionally, I incorporated a pushbutton as the digital input to provide manual control over another LED, allowing for a tactile interaction. This combination of sensors and LEDs was chosen to demonstrate how analog and digital inputs can work together in a creative and functional way.

Process

  1. Component Selection: I gathered an Arduino board, an Ultrasonic Sensor (HC-SR04), LEDs, Resistors, Pushbutton Switch, and Jumper Wires

  2. Circuit Assembly: I connected the ultrasonic sensor to the Arduino, ensuring proper wiring for its VCC, GND, TRIG, and ECHO pins. I connected the pushbutton switch to one of the digital pins on the Arduino with an internal pull-up resistor. I wired two LEDs: one LED was connected to a PWM pin for analog brightness control; the other LED was connected to a digital pin for simple on/off functionality.

  3. Code Development: I wrote Arduino code that: Reads distance data from the ultrasonic sensor; maps the distance data to control the brightness of one LED using PWM; reads input from the pushbutton switch to toggle another LED on or off. The code also included debugging statements for monitoring sensor data via the Serial Monitor.

  4. Calibration: I tested and calibrated the ultrasonic sensor by experimenting with different distance thresholds. This involved adjusting the mapping range for brightness control and ensuring accurate detection of distances within 100 cm. For the pushbutton, I verified its functionality by toggling the digital LED on and off during testing.

Challenges

  1. Sensor Accuracy: The ultrasonic sensor occasionally gave inconsistent readings due to interference or non-flat surfaces. To address this, I ensured proper alignment of objects in front of the sensor during testing

  2. False Triggers: Early versions of the code caused unintended behavior due to incorrect wiring and delays in signal processing. I resolved this by carefully re-checking connections and optimizing delay times in the code

  3. Brightness Mapping: Mapping distance values (0–100 cm) to PWM brightness (0–255) required fine-tuning to achieve smooth transitions in LED brightness.

Potential Improvements

  1. Multiple Sensors: Adding more ultrasonic sensors could allow for multi-directional distance sensing, enabling more complex interactions.

  2. Enhanced Visual Feedback: Using RGB LEDs instead of single-color LEDs could provide more dynamic visual responses based on distance or button presses.

  3. Energy Efficiency: Exploring low-power modes and more efficient components could extend battery life for portable applications.

Schematic Diagram

Source Code

// Pin assignments
const int trigPin = 7;       // Trig pin for ultrasonic sensor
const int echoPin = 6;       // Echo pin for ultrasonic sensor
const int buttonPin = 2;     // Digital pin for pushbutton
const int ledAnalogPin = 9;  // PWM pin for analog-controlled LED
const int ledDigitalPin = 13; // Digital pin for on/off LED

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(buttonPin, INPUT_PULLUP); // Enable internal pull-up resistor
  pinMode(ledDigitalPin, OUTPUT);
  pinMode(ledAnalogPin, OUTPUT);

  Serial.begin(9600); // For debugging
}

void loop() {
  // Measure distance using ultrasonic sensor
  long duration, distance;
  
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  
  digitalWrite(trigPin, LOW);
  
  duration = pulseIn(echoPin, HIGH);
  
  // Calculate distance in centimeters
  distance = duration * 0.034 / 2;

  // Map distance (0-100 cm) to PWM range (0-255)
  int brightness = map(distance, 0, 100, 0, 255);

  // Control brightness of analog-controlled LED
  analogWrite(ledAnalogPin, brightness);

  // Read pushbutton state
  int buttonState = digitalRead(buttonPin);

  // Toggle digital-controlled LED based on button press
  if (buttonState == LOW) { // Button pressed
    digitalWrite(ledDigitalPin, HIGH);
  } else {
    digitalWrite(ledDigitalPin, LOW);
  }

  // Debugging output
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.print(" cm | Brightness: ");
  Serial.println(brightness);

  delay(100); // Small delay for stability
}

Week 9 – Serial/Analog Input – Smile and Wink!

CONCEPT:

For this week’s assignment, I made a smiley face with two glowing eyes, where they “wink” in between. One of the LEDs brightness was controlled using a photoresistor, and the other turned on/off using a switch.

MATERIALS USED:

Arduino UNO

Breadboard

Photoresistor

10K Ohm resistor

330 Ohm resistor

Switch

LED

Jumper wires

WORKING:

So one of the LEDs are controlled using the photoresistor. It gets brighter when the photoresistor is covered(less light), and vice versa. The other LED is controlled using the switch. The code for it is as follows:

const int button = 2;
const int led1 = 13;
const int led2 = 9;
const int ldr = A0;

int state = LOW; //state of LED1
int brightness = 0; //brightness of LED2
int ldrValue = 0; //photoresistor value

void setup() {
  pinMode(button, INPUT_PULLUP); 
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  
  //serial monitor for debugging
  Serial.begin(9600);
}

void loop() {
  if (digitalRead(button) == LOW) {
    state = HIGH;  //turn LED1 on
  } else {
    state = LOW;   //turn LED1 off
  }
  
  //read photoresistor value and map it to LED2 brightness (0 to 120)
  ldrValue = analogRead(ldr);
  brightness = map(ldrValue, 0, 1023, 0, 120);
  
  Serial.print("LDR Value: ");
  Serial.println(ldrValue);
  
  //control LED1 using switch (physical input)
  digitalWrite(led1, state);
  
  //control LED2 brightness using analog input
  analogWrite(led2, brightness);

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

CHALLENGES :

The challenging part about this was my biggest careless mistake! I put the LED on oppositely (anode and cathode), so I spent a good 30 minutes trying to figure out what went wrong. I also used the serial monitor to help with debugging.

Hand drawn schematic:

LINK TO VIDEO :

https://youtube.com/shorts/UVZ-qTWX1aE?feature=share

IMPROVEMENTS :

I would like the photoresistor-controlled LED to be better, maybe some other form of coding that makes it more…interesting. I also realised that we wink using our eyelids and not the eyes themselves, but overall, as a form of cartoonish smiley-ness, I’m happy with this project. It was a fresh start after the spring break!

Physical Computing’s Greatest Hits (and misses)

The text explores recurring themes in physical computing projects and makes a strong case for embracing these ideas, even if they’ve been done before. I really appreciated the encouragement to view these themes as starting points for originality rather than dismissing them as unoriginal. It’s easy to feel discouraged when you think your idea isn’t new, but this perspective reframes those recurring concepts as opportunities to innovate and personalize. For example, the section on theremin-like instruments stood out to me. While the basic idea of waving your hand over a sensor to create music might seem simple, the challenge lies in adding meaningful gestures or context to make it more expressive and unique. That idea of taking something familiar and pushing it further really resonates with me.

One theme that caught my attention was the “gloves” section, particularly the drum glove. I love how it builds on a natural human behaviour- tapping rhythms with your fingers- and turns it into something interactive and fun. The text points out that gloves already come with a gestural language we understand, which makes them accessible while still offering room for creativity. I started imagining how I could expand on this concept, maybe by incorporating haptic feedback or connecting the gloves to other devices for collaborative performances. It’s exciting to think about how these simple ideas can evolve into something much bigger.

That said, not all the themes felt equally engaging to me. For instance, while “video mirrors” are visually appealing, the text acknowledges that they lack structured interaction and often devolve into simple hand-waving. I agree with this critique- while they’re beautiful, they don’t feel as immersive or meaningful compared to something like “body-as-cursor” projects, which involve more dynamic movement and interaction. It made me think about how important it is to balance aesthetics with functionality in interactive design.

Overall, this text inspired me to see recurring project ideas not as limitations but as creative challenges. It also got me thinking about how physical computing bridges the gap between art and technology in such playful and human ways. Moving forward, I want to approach my own projects with this mindset- taking familiar concepts and finding ways to make them personal, meaningful, and interactive. There’s so much potential in these themes, and I’m excited to explore where they could lead.

Making Interactive Art: Set the Stage, Then Shut Up and Listen

This text really made me rethink the way I approach art and creativity. I love how it frames interactive art as a conversation between the artist and the audience, rather than a one-sided statement. The idea that the audience completes the work through their actions is so refreshing- it feels collaborative and alive. It reminds me of immersive installations like Yayoi Kusama’s “Infinity Rooms,” where the experience is deeply personal and shaped by how each person interacts with the space. I’m drawn to this idea of stepping back as an artist and letting others bring their own perspectives to the work.

At the same time, I struggle with the idea of completely “getting out of their way.” While I understand the importance of leaving room for interpretation, I think too little guidance can leave people feeling lost or disconnected. The text mentions giving hints or context, but it doesn’t really explain how much is enough. For example, if an interactive piece doesn’t make it clear what’s meant to be touched or explored, people might misinterpret it or feel unsure about how to engage. I think there needs to be a balance- enough structure to guide people without taking away their freedom to explore.

This text really got me reflecting on my own creative process. It made me think about how interactive art mirrors other forms of storytelling, like theater or video games, where the audience or players shape the experience. I love the idea of creating something that invites others to bring their own interpretations, but I also want to make sure they feel welcomed into that process. It’s definitely something I’ll keep in mind as I work on my own projects- how to create that balance between structure and freedom so that my work feels open but still accessible.

Reading Response – Physical Computing Greatest hits (and misses)

This article explores various themes in physical computing, their mechanisms and applications. Many different projects are shown here, including theremin-like instruments, gloves, video mirrors, dolls and pets and Scooby-Doo paintings. 

The ones that I found most interesting are definitely the mechanical pixels and the multi-touch interfaces. The mechanical pixels were very similar to many projects I saw in fashion, where there are moving parts in structured ball gowns; adding mechanical components to clothing was pretty interesting. These certainly aren’t very practical, but rather serve as a structured display of fashion and aesthetics. I wondered whether the same technique was being applied here. I have interacted with multi-touch interfaces before at art exhibitions and installations at Expo 2020 Dubai, where the movements of my hands would direct shooting stars and flying comets. This sort of physical computing has always fascinated me, it really feels fun and interactive. 

Overall, I found many of the projects very inspirational and interesting. Physical computing is a very new discipline for me, and these projects helped me see the trends and themes evolving within the broad field. These projects definitely serve as a foundation for many great projects, some hits and some misses.



Week 8 : Unusual Switch

For this week’s assignment, we had to create a switch that didn’t use our hands. I started messing around with different objects, trying to figure out what could act as a switch without actually being one. While thinking, I was absentmindedly playing with my keychain, and that’s when I realized all its connecting parts are metal and I decided to seperate it into two to act as the break in my circuit.

From there, I needed a way to complete the circuit without using my hands, so I came up with a foot pedal-style switch. I wrapped the sole of my slippers in foil to make them conductive, then taped the two separate pieces of my keychain onto a sheet of paper to keep them stable. When I step down on the connection point, my foil-covered foot acts as the bridge, completing the circuit and lighting up the bulb.

Link to video :  https://drive.google.com/drive/folders/10NqetPFYwhogeYTs0krIon77jGHFkyMm?usp=sharing

It was a really enjoyable assignment, and I had fun playing around with the circuit, switching the bulb on and off and even syncing it to the beats of songs by tapping my foot.

Assignment 8: Unique Switches

This is my body-based switch, which turns on when the ultrasonic sensor detects a barrier within its range.

Assignment Brief

  • Create an unusual switch that doesn’t require the use of your hands
  • This should be a switch that opens and closes a circuit
  • You should use digitalRead in the Arduino to get the state of your switch and do something based on that information

Conceptualisation

The idea for this project emerged from my will to create something interactive, something that responds to input and only works when someone makes the active choice to be continually using it. I was considering a domino effect game where an initial topple or roll of a marble caused a chain reaction that connected the contact points. However, I decided to take advantage of the equipment provided, instead, and use the motion sensor. By choosing the motion sensor for this experience, I hoped to make it a more interactive and sustainable, as people are able to enjoy an extent of interactivity without needing to reset the entire set-up every time it is going to be used.

Process

  1. Component Selection: I gathered an Arduino board, an ultrasonic sensor (HC-SR04), LEDs, resistors, and jumper wires

  2. Circuit Assembly: I carefully wired the ultrasonic sensor to the Arduino, ensuring proper connections for power, ground, trigger, and echo pins. I then connected the LEDs to digital pins on the Arduino through a current-limiting resistor

  3. Code Development: I wrote Arduino code to control the ultrasonic sensor and LED. The code sends out ultrasonic pulses, measures the time for the echo to return, calculates the distance, and turns the LED on or off based on that distance

  4. Calibration: I experimented with different distance thresholds to determine the optimal range for triggering the LED. This involved repeated testing and code adjustments

Challenges

  1. Sensor Accuracy: The sensor is limited by the hardware it is made from. Signals may be deflected and so sometimes the sensor won’t receive the signals back. Hence, it only works against flat surfaces

  2. False Triggers: Early versions of the system would sometimes trigger in the wrong order due to mis-labelling and mis-wiring. I addressed this by adjusting the sensor’s sensitivity and implementing a minimum detection time to filter out momentary false positives

Potential Improvements

  1. Multiple Sensors: Incorporating additional ultrasonic sensors could create a more comprehensive detection field, allowing for directional awareness

  2. Variable LED Response: Instead of a simple on/off state, the LED brightness could vary based on the detected distance, creating a more nuanced interaction.

  3. Energy Efficiency: Exploring low-power modes and more efficient components could extend battery life for portable applications.

Source Code

const int echo = 13;
const int trig = 12;

int duration = 0;
int distance = 0;

void setup() 
{
  // put your setup code here, to run once:
  pinMode(trig, OUTPUT);
  pinMode(echo, INPUT);
  Serial.begin(9600);
}

void loop() 
{
  // put your main code here, to run repeatedly:
  digitalWrite(trig, HIGH);
  delayMicroseconds(1000);
  digitalWrite(trig, LOW);

  duration = pulseIn(echo, HIGH);
  distance = (duration/2) / 28.5;
  Serial.println(distance);
}

Her Code Got Humans on the Moon

I think this is a fascinating exploration of Margaret Hamilton’s groundbreaking work in software engineering and it shows how crucial her contributions to NASA’s Apollo program were.

First and foremost, what stands out immediately is how Hamilton defied the gender expectations of her time, becoming a pioneer in a male-dominated field during the 1960s. She worked and flourished in an environment where she was unique and would not be blamed for finding hard to work in. Hamilton’s story isn’t just about coding; it’s about breaking barriers and reshaping perceptions of women’s roles in science and technology. The image of Hamilton working late nights with her young daughter sleeping nearby in the office is particularly striking, illustrating the challenges and determination of working mothers in STEM fields.

One of the most interesting aspects of the piece is how it reveals the evolution of software’s importance in the space program. Initially overlooked in budgets and schedules, software quickly became central to Apollo’s success. Hamilton’s work not only helped land humans on the moon but also laid the foundation for modern software engineering practices. The anecdote about her daughter accidentally crashing the simulator, leading to Hamilton’s push for error-checking code, is a powerful example of how real-world experiences informed critical technological developments.

The article also effectively conveys the high-stakes nature of Hamilton’s work. The description of the Apollo 11 landing, where Hamilton’s software prioritisation system proved crucial, highlights how her foresight and technical arguments literally saved the mission. This incident underscores the vital role of robust, well-designed software in complex systems- a principle that remains relevant today.

Norman,“Emotion & Design: Attractive things work better”

I found this to be a very thought-provoking piece that everyone should read to understand the world that they experience. What stands out is Norman’s emphasis on the power of positive effect in design. The idea that positive emotions can make complex tasks feel easier is both intuitive and profound. It’s not just about making things look pretty; it’s about creating an emotional connection that enhances the user’s ability to interact with and utilise a product effectively. This principle is beautifully illustrated through examples like the colour displays in computers, which were once considered superfluous but later became essential for user experience.

I found Norman’s work to be groundbreaking in how it challenges the traditional separation between form and function. By arguing that attractive things actually work better, he’s pushing designers to think beyond mere aesthetics or pure functionality. His concept of the three levels of design- visceral, behavioural, and reflective- provides a comprehensive approach to understanding how users interact with products on multiple levels, from immediate visual appeal to long-term emotional connection. This framework helps designers create products that not only look good but also perform well and foster a lasting bond with users.

One of the most compelling aspects of Norman’s approach is how he integrates cognitive science with design principles. By explaining how our brains process information and how emotions affect our cognitive abilities, he provides a scientific basis for why attractive design matters. This interdisciplinary approach elevates the discussion beyond subjective taste to a more rigorous understanding of human-product interaction. The teapot examples he uses are particularly effective in illustrating the spectrum from purely aesthetic to purely functional design, and how the best designs find a sweet spot that satisfies both. These examples vividly demonstrate how form and function can be harmoniously combined.

The idea that attractive interfaces can make complex software feel more approachable is particularly relevant in our increasingly digital world. Norman’s work predates the smartphone era, yet his insights remain remarkably applicable today. His emphasis on creating products that are not just functional or beautiful, but emotionally resonant and truly user-centered, is a holistic view of user experience that is often overlooked but crucial for success.

This reading is an integration of cognitive science, emotion, and design principles, which cumulatively offer a unique perspective that underscores the importance of balancing aesthetics and usability. By recognising that attractive things indeed work better, designers can create products that are both beautiful and functional, ultimately enhancing user satisfaction and engagement.