Meet the Devices
Let’s look at what’s actually in that room. We have a device with a temperature sensor. Maybe it also has a fan. Let’s break down what each part does.
Sensor: Reading the World
A sensor reads something from the physical world. In our story, it’s a temperature sensor.
What it does:
- Measures temperature
- Outputs a number (like 23.4°C)
- Does this automatically, on a schedule
Other examples:
- Motion sensor: detects movement (true/false)
- Light sensor: measures brightness (a number)
- Humidity sensor: measures moisture (a percentage)
Key point: Sensors only read. They don’t change anything.
Actuator: Changing the World
An actuator changes something in the physical world. In our story, we might have a fan.
What it does:
- Turns the fan on or off
- Can control speed (low, medium, high)
- Responds to commands from the device
Other examples:
- Light: turns on/off, dims
- Relay: switches power to other devices
- Motor: moves something
Key point: Actuators only act. They don’t read anything.
Device/Node: The Small Computer
The device (also called a “node”) is the small computer that owns the sensor and actuator.
What it does:
- Reads from sensors
- Controls actuators
- Runs code (your program)
- Connects to the network
- Sends data to the cloud
What’s inside:
- CPU (processor)
- Memory (RAM)
- Storage (flash memory)
- Network interface (Wi-Fi chip, Ethernet port, etc.)
- GPIO pins (connect sensors and actuators)
In our story:
- One temperature sensor connected
- One fan connected (optional)
- Wi-Fi for network connection
- Code that reads sensor every 10 seconds
Gateway: The Bridge (Optional)
A gateway bridges your local network to the internet. Not all systems need one.
When you need it:
- Devices use a different protocol (like Zigbee or Bluetooth)
- Devices can’t connect directly to Wi-Fi
- You want to manage many devices locally first
What it does:
- Receives data from local devices
- Translates between protocols
- Sends data to the cloud
- Can buffer data if cloud is offline
In our story:
- We don’t need a gateway
- Device connects directly to Wi-Fi
- Goes straight to the cloud
Our Device Setup
For this tutorial, we have:
Device (MCU - Microcontroller Unit)
- Small computer board
- Runs our code
- Has Wi-Fi
Temperature Sensor
- Connected to the device
- Reads temperature every 10 seconds
- Sends value to device
Fan (Optional)
- Connected to the device
- Can be turned on/off
- Controlled by device code
Network Connection
- Wi-Fi connection
- Device talks directly to cloud
- No gateway needed
Visual Breakdown
Here’s how the components connect:
Quick Check
Which part talks to the cloud?
- The device. It reads from the sensor, creates a message, and sends it over Wi-Fi.
Which part touches the physical world?
- The sensor (reads temperature) and the actuator (controls fan). The device itself is just a computer.
What’s the difference between sensor and actuator?
- Sensor reads (input). Actuator acts (output). One measures, the other changes.
Real-World Examples
Smart Thermostat
- Sensor: temperature
- Actuator: HVAC system control
- Device: the thermostat itself
Smart Light
- Sensor: motion (optional)
- Actuator: the light bulb
- Device: smart switch or bulb
Security Camera
- Sensor: camera (captures images)
- Actuator: none (or LED indicator)
- Device: the camera unit
What’s Next?
Now that you know what the device is, let’s see what happens when it reads the sensor. In the next page, we’ll turn that raw temperature reading into a message that can travel to the cloud.