MicroPython for Microcontrollers Module 11
Power, application updates and firmware OTA interview questions
Interview questions on power, application updates and firmware OTA: warm-ups, then what each harder question tests and how a good answer starts.
Warm-up questions
Short questions with short answers, each answered in full.
-
Fresher
What does a board keep through lightsleep() that it loses in deepsleep(), and where does the program carry on after each?
Questions with model answers
What each question tests, the first step of a good answer and the follow-ups to expect.
-
Mid to senior
An ESP32 soil sensor on a development board should run about 8 months on a 2,000 mAh cell: it wakes every 10 minutes for 2 s and calls machine.deepsleep(600_000) in between. In the field it is flat after 9 days. How do you find where the charge goes, and what do you change?
- What it tests
- Turning a battery's life into an average current, splitting it between the wakes and the sleep, telling a board's sleep current from the chip's, and checking that the sleep happens at all.
- First step
- Turn the failure into a number. 2,000 mAh in 9 days is 2,000 ÷ 216 h = 9.26 mA on average, against the 0.343 mA of the plan. Then ask which half can carry it: the 2 s wakes at 100 mA give 0.33 mA, so either the wakes last far longer than planned or about 9 mA flows while the board should be asleep. Measure the current between wakes.
- Follow-ups
-
- What if the meter shows 10 µA between wakes?
- How can the board itself show that it really sleeps?
- What if the sensor must stay on this development board?
From the lesson Sleep modes and battery life
Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.Opening the model answers with your pass…
Model answers open with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; nothing renews unless you choose to. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so the model answers can’t be opened at the moment. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
Design the firmware of a door sensor on an ESP32 that runs for a year on a 2,000 mAh battery, reports every opening and closing, and sends a heartbeat every hour. Which sleep does it use, what wakes it, what does each boot do, and how do you check the battery budget?
- What it tests
- Choosing deep sleep with a pin wake and a timer wake, reading wake_reason() and wake_pins() at boot, arming the right level, and turning a lifetime into a budget of wakes.
- First step
- Start from the budget. A year on 2,000 mAh allows 2,000 ÷ 8,760 h = 0.228 mA on average. Deep sleep at 10 µA leaves 0.218 mA for the wakes, about 786 mA·s an hour. A 2 s wake at 100 mA costs 200 mA·s, so the board can afford about 3.9 such wakes an hour, the heartbeat included.
- Follow-ups
-
- What happens to the battery if the door is opened 20 times an hour?
- How does the board tell a heartbeat from a door event?
- What do you test before the sensor is installed?
From the lesson Sleep modes and battery life
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
All MicroPython for Microcontrollers interview questions · The MicroPython for Microcontrollers track