Level 1 · Read the sensor
L1_sensor_read.ino
Reads temperature and humidity and shows them in the Serial Monitor. The LED switches on above a threshold you choose. No Wi-Fi needed.
Hands-on workshop
Connecting AI agents to the real world with IoT and edge computing
You will build a small Wi-Fi sensor node and let an AI agent read it and control it with plain English. Set up your laptop before the day, so the workshop time goes on building rather than downloading.
Before you come
You will work in pairs, so one laptop per pair is enough. We provide all the electronics.
Windows 10 or 11, macOS 11 or later, or Linux, with the software below installed.
USB-A, or a USB-C to USB-A adapter. The board connects with a micro-USB cable, which we provide.
There are power sockets at every table, so you can keep the laptop charged during the lab.
Laptop setup
Everything is free. Follow the steps in order; each one takes a few minutes.
Download Arduino IDE 2 from arduino.cc/en/software and install it with the default options. On Windows, click Install if Windows asks whether to install USB drivers.
Open , search for each library below and click Install.
Our boards use a CH340 USB chip, and your computer needs its driver to see the board. A few boards use a CP2102 chip instead; the chip name is printed next to the board's USB port.
Download CH341SER.EXE from the chip maker, WCH. Run it and click Install.
CH340 support is built in. There is nothing to install.
The driver is built in. Add your user to the dialout group so the IDE can open the port.
If the board is not detected, install the CP210x driver from Silicon Labs.
Download the sketches below, open L3_mqtt_control.ino and click Verify, the tick button at the top left. When the output ends with "Done compiling", your laptop is ready. If an error names a missing .h file, one of the libraries from step 3 is missing.
Already have a NodeMCU board? Plug it in, choose its port under (COM3 or similar on Windows, /dev/cu.wchusbserial… on macOS) and upload .
Lab code
One sketch for each level of the lab. Each zip keeps the sketch in its own folder, which is how Arduino IDE expects it. Unzip it, then double-click the .ino file.
Level 1 · Read the sensor
L1_sensor_read.ino
Reads temperature and humidity and shows them in the Serial Monitor. The LED switches on above a threshold you choose. No Wi-Fi needed.
Level 2 · Send your data
L2_mqtt_publish.ino
Joins the workshop Wi-Fi and sends a reading every 5 seconds over MQTT. Your node appears on the dashboard projected at the front.
Level 3 · Let the AI control it
L3_mqtt_control.ino
Also listens for commands, so the AI agent can switch or blink your LED. Adds an on-board alert and an optional buzzer.
You don't need to change anything before the workshop. On the day you will edit four lines at the top of Levels 2 and 3: the Wi-Fi name, the Wi-Fi password and the Raspberry Pi's address, which will be on the whiteboard, and your NODE_ID from your kit label.
Reference
We will build the circuit together in the lab. Keep this page open as a reference.
| Part | Pin on the part | Board pin |
|---|---|---|
| DHT11 sensor | VCC (+) | 3V3 |
| DHT11 sensor | GND (−) | G |
| DHT11 sensor | DATA (out) | D5 |
| LED | Long leg, through the 220 Ω resistor | D6 |
| LED | Short leg | G |
| Buzzer (optional) | + leg | D7 |
| Buzzer (optional) | − leg | G |
Avoid pins D3, D4 and D8 for the sensor: they control how the board starts up.
| What you see | What to do |
|---|---|
| No port under Tools › Port | The cable may be charge-only, so try another. Otherwise install the USB driver from step 4. |
| Upload stops at "Connecting..." | Hold the board's FLASH button as the upload starts, or set Tools › Upload Speed to 115200. |
| "DHT.h: No such file" | Install the Adafruit DHT sensor library (step 3). |
| "PubSubClient.h: No such file" | Install PubSubClient by Nick O'Leary (step 3). |
| NodeMCU missing from the board list | Check the address from step 2, then install esp8266 in Boards Manager. |
| Strange characters in Serial Monitor | Set the Serial Monitor speed to 115200 baud. |
Still stuck? Arrive ten minutes early on the day and a helper will finish the setup with you.
After the workshop
Your feedback takes two minutes and shapes the next workshop. Scan the code with your phone's camera, or open the link.
forms.gle/XU3xqJ3iBfB3X7tR8