Brain on Break
Concept & Inspiration
This project started from the chaos of studying late nights and running on caffeine. I wanted to make a circuit that visualizes the mental shift between being focused and completely done, the moment when my brain decides, without warning, “we’re taking a break now.”
The concept connects light, motion, and emotion. The light sensor represents my surroundings and productivity levels , the brighter the space, the more alert I am. The foil switch stands for that physical collapse when I lean head onto the desk. Together, they create a system that reads like a tiny, glowing version of my attention span.
How It Works
The project combines one analog sensor and one digital sensor, controlling two LEDs in different ways.
- Light sensor (Analog Input): Reads the brightness of the environment. The green LED glows brighter in bright light, symbolizing focus and clarity.
- Foil Switch (Digital Input): Made of two pieces of aluminum foil connected to D2 and GND. When my elbow or cheek touches them together, it signals “brain on break.”
- Red LED (Digital Output): Turns on when the foil pads touch — representing mental shutdown.
- Green LED (Analog Output): Fades according to light level but turns completely off when the foil switch is activated.
This mix of analog and digital behavior mirrors how people work — not everything in us is gradual or logical. Sometimes focus fades; sometimes it just stops.
Circuit Design
When the light changes, the green LED fades smoothly using analogWrite(). When the foils touch, the orange LED turns on and the green one shuts off completely.
Coding:
const int LDR_PIN = A0; // Analog input from photoresistor
const int SWITCH_PIN = 2; // Digital input from foil switch
const int GREEN_LED = 9; // Analog (PWM) output LED
const int RED_LED = 8; // Digital ON/OFF LED
void setup() {
pinMode(SWITCH_PIN, INPUT_PULLUP);
pinMode(GREEN_LED, OUTPUT);
pinMode(RED_LED, OUTPUT);
Serial.begin(9600);
}
void loop() {
int lightValue = analogRead(LDR_PIN); // Light level
int switchState = digitalRead(SWITCH_PIN); // Foil contact: LOW when touched
// Map light value to LED brightness (inverted so bright light = brighter LED)
int brightness = map(lightValue, 600, 880, 0, 255);
brightness = constrain(brightness, 0, 255);
analogWrite(GREEN_LED, brightness);
// If foil switch is touched, turn on red LED
if (switchState == LOW) {
// Foil pads touching → brain on break
digitalWrite(RED_LED, HIGH); // burnout light ON
analogWrite(GREEN_LED, 0); // focus light OFF
} else {
// Normal state → focused
digitalWrite(RED_LED, LOW); // burnout light OFF
analogWrite(GREEN_LED, brightness); // focus light fades with light
}
//serial monitor
Serial.print("Light Value: ");
Serial.print(lightValue);
Serial.print(" | Brightness: ");
Serial.print(brightness);
Serial.print(" | Switch: ");
Serial.println(switchState == LOW ? "Touched" : "Not touched");
delay(50);
}
Testing & Results
In bright light, the green LED glows intensely — that’s focus mode. When the room dims, the light softens, mimicking a fading mind. But the real moment comes when I touch the foil pads. This happens when my head touches the desk, indicating that I fell asleep. The red LED flashes alive, and the green one shuts off instantly. It’s like watching my brain say, “enough.”
The light sensor worked better once I narrowed the range (600–880) so the fade became more dramatic. The foil switch needed tighter contact, but once secured, it triggered perfectly.
Video demo:
8088D1BA-7146-49C3-97C8-CCAB51934422
Challenges
- Calibrating the light sensor so the fading felt visible but not jumpy.
- Making sure the foil switch responded to soft touches without staying on permanently.
Future Improvements
If I develop it further, I’d like to:
Include a buzzer or heartbeat sound to show the switch between focus and burnout.
Reflection
This assignment pushed me to merge function with symbolism. The project isn’t just about inputs and outputs — it’s about mood as circuitry. The light patterns represent focus, fatigue, and the strange middle space between both.
It reminded me that even in electronics, balance matters. Circuits need both current and resistance. Brains need both light and rest.
