From offline to online
On this page
You built something that works. A thermostat that holds temperature, a pump that runs on a schedule, a motor that spins at the right speed. It sits on the bench doing its job perfectly, and you have no idea what it is doing when you walk away. That gap, between a thing that works and a thing you can see and trust, is the entire reason to connect a device.
The fast loop belongs in firmware
Before we reach for the cloud, one rule keeps you honest: anything that has to happen fast and reliably stays on the microcontroller. Reading a sensor, holding a setpoint, cutting power when a limit trips, these run in a tight loop measured in milliseconds. They must keep working when the Wi-Fi drops, when the internet is down, when a server is being restarted. If your motor's over-current shutoff depends on a round trip to a server, you have built something dangerous, not something smart.
So the control loop is not what we are moving to the cloud. The firmware still owns it. What we are adding is a second thing on top: oversight.
What the cloud can do that a microcontroller cannot
A microcontroller is excellent at controlling one thing in the moment. It is bad at almost everything that involves a human, a memory, or the rest of the fleet. That is exactly where the cloud earns its place:
- Tell the right person, reliably. A board can flash an LED or even send one SMS, but getting a message to whoever is on duty, retrying until it is acknowledged, and escalating if nobody answers, is a job for a service that never sleeps.
- Catch its own silent failures. A device that has crashed cannot tell you it crashed. Something outside it has to notice that the readings stopped and raise a flag. A device cannot supervise itself.
- Remember and prove. Weeks of history, so you can see a slow drift, compare today to last month, or show a customer what actually happened. Flash memory on a chip cannot hold that, and cannot be trusted as a record.
- Coordinate the fleet. One node is firmware. A hundred nodes with shared thresholds, rollups, and one place to look is a platform problem.
- Reconfigure without a reflash. Change a threshold or a schedule from a dashboard, on a device installed on a roof three towns away, without pulling out a laptop.
So when do you connect?
Connect when the value is in knowing and reacting across time and distance, not in the split-second control. A greenhouse controller can open a vent on its own all day long; you connect it so a person gets a warning the night the heater fails and the temperature starts falling, hours before the crop is lost. The control was always local. The save came from oversight.
Check yourself
A machine must shut off within 50 ms if vibration spikes. Where does that logic belong?
A device crashes. Why can it not simply tell you it crashed?
When is connecting a device most worth it?
In one line, what is the cloud's role next to the device?
- The fast, safety-critical loop stays in firmware and must survive with no internet.
- The cloud is oversight: alert a human, catch silent failures, remember, coordinate, reconfigure.
- Connect when the value is in knowing and reacting across time and distance, not split-second control.
Next, the practical question: how does a device actually talk to a cloud without a fragile pile of custom networking? The answer almost everyone reaches for is a small, sturdy protocol called MQTT.
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.