Chapter 01: Moving In

404 ERROR: Alarms not found (Buzzers)

404 ERROR: Alarms Not Found

The silence is deafening. Where there should be warning klaxons echoing through the corridors, there's nothing. You press your ear against the cold metal wall of Sector 7's power management station and hear only the faint hum of dying electronics.

Three months ago, before the AI uprising, this place buzzed with activity. Automated systems monitored every battery cell, every solar panel, every power drain in the facility. The central AI would sound alarms when power levels dropped, when charging systems failed, when the delicate balance between energy generation and consumption tipped toward disaster.

Now the screens flicker with error messages. The building's power grid limps along on backup protocols that were never meant to run for months. The battery banks that once held weeks of reserve power now drain faster than they charge. Without warning systems, the lights simply go dark when the power runs out.

You've managed to scavenge a photoresistor from the defunct solar monitoring array and an active buzzer from the emergency communications panel. Combined with your HERO Board and the circuits you've already mastered, you can build something the AI never had: a charging controller with human intuition. A system that doesn't just manage power, but warns you when trouble is coming.

The old world relied on perfect automation. The new world requires adaptive intelligence. Time to teach your microcontroller the difference between a power shortage and a catastrophe, between conservation and survival. The alarms may be broken, but the warnings don't have to be silent.

What You'll Learn

When you complete this lesson, you'll be able to:

  • Build an intelligent battery charging system that monitors solar input and manages power consumption
  • Use analog sensors to measure light levels and convert them into charging rates
  • Implement floating-point math to track precise battery levels over time
  • Create warning systems that sound alarms when power levels become critical
  • Combine multiple subsystems (lighting, charging, monitoring, alarms) into one integrated controller
  • Use the Serial Plotter to visualize real-time data from your power management system
  • Apply hysteresis logic to prevent rapid on/off cycling that damages batteries

This isn't just about making noise when batteries run low. You're building the kind of sophisticated power management system that keeps critical infrastructure running when everything else fails.

Understanding Power Management Systems

Think of your smartphone's battery indicator. It doesn't just show you a percentage – it changes color when power gets low, dims the screen to conserve energy, and eventually shuts down non-essential functions to prevent damage. That's exactly what we're building, but for a post-apocalyptic survival shelter.

Real power management systems face a fundamental challenge: balancing energy generation, storage, and consumption while protecting expensive equipment. Solar panels generate power inconsistently depending on weather and time of day. Batteries can be damaged by overcharging or deep discharge. Loads like lights and electronics create unpredictable power demands.

The key insight is hysteresis – the idea that turning something on and off should happen at different thresholds. Your car's cooling fan doesn't turn on and off at exactly the same temperature, because that would make it cycle rapidly. Instead, it might turn on at 210°F but not turn off until it drops to 200°F. This prevents wear and tear from constant switching.

Our battery charging system uses the same principle. We'll stop charging at 90% capacity, but we won't resume charging until the level drops to 85%. This protects the batteries from stress while ensuring we have power when we need it. The photoresistor simulates our solar panels – more light means faster charging, just like real solar cells.

The buzzer adds the critical human interface element: situational awareness. In a survival scenario, you need to know when power is running low before the lights go out. The warning system gives you time to take action, whether that means rationing power, checking the solar panels, or firing up a backup generator.

Wiring Your Power Management System

Wiring diagram for battery charging controller
  1. LED to Pin 22: This represents your facility's lighting system. Pin 22 can source enough current for our LED without additional components.
  2. Button to Pin 23: Your manual light switch. The internal pullup resistor eliminates the need for external resistors – the pin reads LOW when pressed.
  3. Active Buzzer to Pin 24: