Design the firmware for a battery-powered sensor that must run for 5 years on a coin cell and report data every 15 minutes.
What the interviewer wants to hear
- Power budget calculation from battery capacity and duty cycle
- Deep sleep most of the time, wake by RTC
- Minimise radio on-time: batch data, efficient protocol
- Turn off peripherals and configure pins correctly
- Measure real current with a power profiler
- Handle battery voltage drop, brownout and robust recovery
Model answer
I start with a power budget. A CR2032 has about 220 mAh, and 5 years is roughly 43,800 hours, so the average current must be under about 5 uA, minus margin for self-discharge and temperature. That means the device sleeps almost always. I pick an MCU and radio with sub-microamp sleep and an RTC wake-up. Every 15 minutes it wakes, powers the sensor, takes a reading, and goes back to sleep. The radio is the biggest consumer, so I batch several readings and transmit less often if allowed, use a low-power protocol like BLE advertising, LoRaWAN or Zigbee, and keep packets short. Before sleep, I turn off peripheral clocks, put unused GPIOs in analog mode and cut sensor power with a load switch. I measure the real current profile with a power analyser like a Nordic PPK2, check the coin cell can handle radio current peaks, often with a capacitor, and handle brownout and low-battery reporting gracefully.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Embedded Systems Engineer questions
- How would you secure an IoT device's firmware against tampering and cloning?
- How do you make sure a real-time system always meets its deadlines?
- How do you build a strong automated testing strategy for embedded firmware?
- How do you choose a microcontroller for a new product?
- Design a secure, fail-safe over-the-air firmware update system for a fleet of IoT devices.
- You receive the first prototype of a new custom board. How do you bring it up?
- What changes when you write firmware for a safety-critical product, such as automotive or medical?
- How do you safely share data between interrupt handlers and tasks while keeping interrupt latency low?
- A variable is randomly overwritten in devices running in the field, but you cannot reproduce it on your desk. How do you find the cause?