The Harsh Reality of the Edge
"In Cloud AI, you optimize for speed and accuracy. In Edge AI, you optimize so the battery doesn't die by tomorrow morning."
1. SRAM vs Flash Memory
Microcontrollers use Flash Memory (ROM) to store program code and read-only data, such as your quantized TensorFlow Lite model weights. SRAM is used for dynamic execution (variables, activations, intermediate tensor data). SRAM is usually extremely scarce (e.g., 256KB). If your model's tensor arena exceeds this, the device crashes immediately.
2. Duty Cycling
An ESP32 running flat-out consumes ~50-70mA. On a small 1000mAh coin cell, that lasts a single day. Duty Cycling means turning the microcontroller on for only a fraction of a second to sample a sensor and run inference, then placing it in Deep Sleep (~0.01mA) for the rest of the time. This pushes battery life from days to months.
❓ FAQ: Edge Optimization
Why not just use a bigger battery?
Edge devices are often deployed in environments where size, weight, or cost are strictly limited (e.g., wearables, smart home sensors). Increasing battery size destroys form-factor.
Does reducing inference time save power?
Yes! Energy = Power × Time. If you quantize a model and it runs twice as fast, it means the CPU can return to Deep Sleep twice as quickly, saving massive amounts of energy per cycle.