Inspiration

It's 2am. You're studying in your hostel room and haven't moved in 45 minutes. The lights go off, so you wave your hand in the dark to turn them back on. Then the AC shuts off because it thinks the room is empty. You're still there, just sitting still.

This happens every day in colleges, offices and hospitals across India. It's more than an inconvenience, because it wastes electricity. Appliances run in empty rooms, or shut off when someone is still inside. We wanted a system that actually understands whether someone is in the room.

What it does

LunaSense is a smart room-automation system that detects real human presence, even when you're sitting completely still, and controls lights and AC accordingly.

  • Reliable presence detection: a PIR sensor reacts instantly when someone enters, and a mmWave radar keeps confirming presence by detecting breathing.
  • Smart lighting: a WS2812B RGB strip with full color control, warm white, and automatic brightness based on distance from the sensor.
  • AC control without touching the unit: an IR blaster sends the same signals as your remote to turn the AC on and off and change temperature and mode.
  • Closed-loop temperature control: a DHT22 sensor reads actual room temperature, and the system steps the AC up or down to hit your target.
  • Anomaly mode: if someone enters when they shouldn't, the light blinks red and an alert is sent to the app.
  • App control: change color, warm white and brightness (e.g. 30%) from your phone.

How we built it

Hardware: an ESP32-CAM microcontroller reads both sensors 10 times per second. Two sensors with different strengths feed one decision (sensor fusion):

  • PIR: the fast trigger for entry.
  • mmWave radar: the precision layer that confirms presence continuously, including micro-movements like chest motion while breathing.

The light turns off only when both sensors agree the room is empty and a set timer expires. The WS2812B strip handles lighting, an IR blaster controls the AC, and a DHT22 provides temperature feedback.

Software: custom firmware on the ESP32 plus a control app. Everything runs over local WiFi, with no cloud, no subscription and no data leaving the room.

Why it matters, in numbers: an AC left running in an empty room for 8 hours wastes about 8 units of electricity:

$$8\ \text{units} \times ₹8.75/\text{unit} \approx ₹70/\text{day} \approx ₹2100/\text{month}$$

The full build costs under ₹1500, needs no rewiring, and works with any AC that has a remote, so it doesn't void warranties.

Challenges we ran into

  • Fusing two sensors that behave differently: PIR is instant but blind to stillness, while radar is precise but continuous. Deciding when each one should override the other, so lights neither flicker off nor stay on forever, took a lot of tuning.
  • Controlling an AC with no feedback: an IR remote signal is one-way. We added the DHT22 so the system can check the room temperature and correct itself, rather than blindly sending commands.
  • Building a full hardware and app system in weeks, as students, with limited time to test every real-world scenario like sitting, sleeping, entering and leaving.
  • Keeping it private and cheap: designing everything to run locally on WiFi, under ₹1500, without relying on cloud services.

Accomplishments that we're proud of

  • A working live demo: walk in and the light turns on, sit completely still and it stays on, walk out and it turns off after the timer.
  • Detecting presence through breathing alone, which a PIR-only system can't do.
  • Anomaly mode that blinks red and alerts the app on unexpected entry.
  • Real closed-loop AC control, not just on/off.
  • Delivering all of it for under ₹1500, with no rewiring and no subscription, in a few weeks.

What we learned

  • Sensor fusion beats any single sensor. Combining a fast sensor with a precise one gives results neither can alone.
  • Real-world behavior (stillness, sleeping, entering unexpectedly) matters far more than ideal lab conditions.
  • Saving energy doesn't require changing human behavior. It requires smarter infrastructure.
  • How to scope a hardware project and work as a team across firmware, hardware, app and demo.

What's next for LunaSense

  • Pilot LunaSense in classrooms, hostel rooms, offices and hospital rooms to gather real energy-savings data.
  • Add energy dashboards showing units saved per room and per building.
  • Extend control to fans and other appliances, and support more AC brands and remote protocols.
  • Scale to full campus and hospital deployments, with centralized monitoring over the local network.

Built With

Share this project:

Updates

Submission history