Coding School Participant guide

Hands-on workshop

Physical AI

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.

Setup timeAbout 20 minutes
ExperienceNo coding needed
Works onWindows, macOS, Linux

Before you come

What to bring

You will work in pairs, so one laptop per pair is enough. We provide all the electronics.

A laptop

Windows 10 or 11, macOS 11 or later, or Linux, with the software below installed.

A free USB port

USB-A, or a USB-C to USB-A adapter. The board connects with a micro-USB cable, which we provide.

Your charger

There are power sockets at every table, so you can keep the laptop charged during the lab.

Laptop setup

Install the software in five steps

Everything is free. Follow the steps in order; each one takes a few minutes.

  1. Install Arduino IDE 2

    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.

  2. Add support for the ESP8266 board

    1. Open File › Preferences. On macOS this is Arduino IDE › Settings.
    2. Paste this address into Additional boards manager URLs, then click OK:
    1. Open Tools › Board › Boards Manager, search for esp8266 and install esp8266 by ESP8266 Community. The download takes a few minutes.
    2. Select Tools › Board › ESP8266 Boards › NodeMCU 1.0 (ESP-12E Module).
  3. Install two libraries

    Open Tools › Manage Libraries, search for each library below and click Install.

    • DHT sensor library by Adafruit. When asked, choose Install all so that Adafruit Unified Sensor is installed as well.
    • PubSubClient by Nick O'Leary.
  4. Install the CH340 USB driver

    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.

    Windows

    Download CH341SER.EXE from the chip maker, WCH. Run it and click Install.

    macOS 11 or later

    CH340 support is built in. There is nothing to install.

    Linux

    The driver is built in. Add your user to the dialout group so the IDE can open the port.

    CP2102 boards

    If the board is not detected, install the CP210x driver from Silicon Labs.

  5. Check that everything works

    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 Tools › Port (COM3 or similar on Windows, /dev/cu.wchusbserial… on macOS) and upload File › Examples › 01.Basics › Blink.

Lab code

Download the three sketches

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.

All three sketches

physical-ai-sketches.zip · Levels 1, 2 and 3

Download all

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.

Download

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.

Download

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.

Download

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

Wiring and quick fixes

We will build the circuit together in the lab. Keep this page open as a reference.

Wiring, the same for all three levels

PartPin on the partBoard pin
DHT11 sensorVCC (+)3V3
DHT11 sensorGND (−)G
DHT11 sensorDATA (out)D5
LEDLong leg, through the 220 Ω resistorD6
LEDShort legG
Buzzer (optional)+ legD7
Buzzer (optional)− legG

Avoid pins D3, D4 and D8 for the sensor: they control how the board starts up.

If something doesn't work

What you seeWhat to do
No port under Tools › PortThe 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 listCheck the address from step 2, then install esp8266 in Boards Manager.
Strange characters in Serial MonitorSet 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

Tell us how it went

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
QR code for the workshop feedback form

sketch.ino