Week 10: Output devices & power measurement

Output devices week. Our group measures output power on the bench (below). For my individual assignment I split sensing and display across two boards from my bench tree (WROOM上传程序 + S3上传程序): the Seeed XIAO ESP32‑S3 on my Week 8 hub still reads DHT11 and light (Week 9), then acts as an I²C master pushing an 8-byte telemetry frame to an ESP32‑S3 WROOM module at address 0x55. The WROOM drives a colour ST7789 TFT (the output device) and paints humidity, temperature, and light on its Environment page. I am not revising the Week 8 PCB or populating NanoStat this week.

Individual assignment: XIAO I²C → WROOM ST7789

Per Output Devices I must add an output device to a microcontroller board I designed and program it. My designed board is still the Week 8 hub with the XIAO and sensors; the programmed output is the ST7789 on the WROOM carrier (Senlin ESP32‑S3 WROOM + touch TFT assembly). Week 10 is a two-MCU firmware link extracted from my download tree, not a PCB spin.

1. Task

Week 9 proved the hub can measure light and RH / temperature and log them on USB serial. Week 10 adds a machine-readable bus and a human-readable faceplate: XIAO packs RH, °C, and light into TelemetryPacked (cmd 0x01, slave 0x55); WROOM parses the frame in an I²C slave ISR ring buffer and redraws the Environment panel (Temperature / Humidity / Light + status pill).

  • Hub (XIAO, Week 8 PCB): same sensor pins as Week 9 hub firmware: DHT11 on D2 (GPIO3), light ADC on D3 (GPIO4); D4/D5 = I²C SDA/SCL to the display board.
  • Display MCU (WROOM): ST7789 over SPI; I²C slave Wire1 on GPIO37/36 (HostLink in board_pins.h).
  • On-screen payload: the same three quantities as Week 9 serial: humidity %, temperature °C, light % of ADC full scale.
  • Out of scope for this week’s repo slice: WiFi/Deepseek, ASR, five-page swipe UI, soil Modbus. Those stay in the full WROOM上传程序 / S3上传程序 trees.

Board context (Week 8) vs scope (Week 10)

The JLCPCB panel from Week 8 is laid out for two sites: a soldered XIAO ESP32‑S3 and a NanoStat landing zone for later plant impedance experiments. That geometry still fits both modules mechanically, but I am not changing the board or NanoStat bring-up in Week 10, same decision as Week 9. Evidence this week is: designed MCU board + new output device under firmware control.

The academy FAQ says the assessed output should not live on a breadboard forever. My sensors and MCU are already on the carrier; the TFT module is cabled from the XIAO header for now (like the small OLED I used at the end of Week 9). When I route a dedicated FPC or pin header for the plant enclosure I will update the bench photo, without respinning the Week 8 panel.

2. Learning

Week 9 was slow sensing; Week 10 is framed I²C plus pixel output. I copied the protocol header and the env-only paths from my upload folders rather than inventing a second format.

  • Master framing: one Wire.endTransmission() writes 8 bytes: magic 0xA5, cmd 0x01, flags, RH %, temp×10, light×10.
  • Slave parsing: bytes land in a ring buffer from onReceive; the main loop assembles TelemetryPacked and bumps a dataVersion so the TFT redraws only when values change.
  • ST7789 / SPI: the WROOM firmware rotates MADCTL to match the Senlin module, then draws the same Environment layout as the full UI tree’s drawPageEnv().
  • Power (group): TFT backlight current dominates. See group measurements.

3. Plan

  1. Keep Week 9 sensor pins; add XIAO D4/D5 → WROOM GPIO37/36 with 4.7 kΩ pull-ups and common GND.
  2. Flash WROOM week-10 slave build; confirm serial [HOST_I2C] slave 0x55.
  3. Flash XIAO master; boot I²C scan must list 0x55.
  4. Verify serial banner on XIAO and live Environment fields on the TFT.
  5. Bench photo: Week 8 hub + linked display showing RH / °C / light.

4. Build (carried from Week 9 → ST7789)

Same hub, new output

Custom PCB with Seeed XIAO ESP32-S3 and rainbow harnesses to light and DHT11 sensors
Figure I-1 (hub): Week 8 panel with XIAO and Week 9 sensors, unchanged layout for Week 10; NanoStat site still empty.

Input chain (unchanged from Week 9)

Light and DHT11 stay soldered on the carrier with rainbow bring-outs. I will not move those nets onto a breadboard shim for Week 10.

XIAO on custom PCB reading light and DHT11 successfully
Figure I-2: Week 9 proof that the input path works. The Week 10 UI reads the same firmware variables.

Pin map: HostLink (XIAO master ↔ WROOM slave)

Signal XIAO (hub) WROOM (display)
I²C SDA D4 → GPIO9 GPIO37
I²C SCL D5 → GPIO8 GPIO36
7-bit address Master writes 0x55
DHT11 data D2 → GPIO3 — (remote on hub)
Light ADC D3 → GPIO4
ST7789 SPI (CS/DC/RST/BL on Senlin board_pins.h)

UI layout (WROOM Environment page)

The trimmed WROOM build draws the same three fields as the full UI’s drawPageEnv(): Temperature, Humidity, Light, plus a status pill ( WAIT S3 0x55 / AIR OK / STALE / DHT ERR). In the five-page firmware, swipe to page index 2; the week-10 teaching build stays on that page only.

Small OLED showing humidity temperature and light from Week 9 bring-up
Figure I-3: Week 9 OLED check. Same three quantities, now routed over I²C to the WROOM ST7789 Environment page.

Firmware in the repo (extracted from upload trees)

Documented in code/week10-i2c-env/README.md:

// XIAO — one telemetry write (see pushTelemetry in week10-i2c-env/xiao)
I2cEnvLink::TelemetryPacked pkt{};
pkt.magic = 0xA5;
pkt.cmd   = 0x01;  // telemetry v1
pkt.flags = dhtOk ? 0x01 : 0;
// rh_percent, temp_c_x10, light_pct_x10 …
Wire.beginTransmission(0x55);
Wire.write((uint8_t*)&pkt, sizeof(pkt));
Wire.endTransmission();

Full bench trees (WiFi, LLM, touch swipe, ASR) remain in Downloads; the integrated copy for later weeks is also under code/week15-individual/final/.

Problems I watch for

  • No 0x55 on scan: WROOM not flashed, missing GND, or weak pull-ups. Fix before blaming sensors.
  • WAIT S3 0x55 on TFT: slave OK but master not running or SDA/SCL swapped.
  • DHT ERR with good serial on XIAO: flags bit not set. Check kFlagDhtOk packing on the master.

5. Conclusion

Week 10 links sensing to showing: the Week 8 hub still reads the plant-facing transducers, and the programmed output is the WROOM’s ST7789, fed by the same 8-byte I²C frame I use in the full upload trees. Splitting MCU roles matches how I want the final companion to work: hub near sensors, display module at the human edge.

Design files: Week 6 electronics design · Week 8 production. Week 9 serial: week09-s3-serial-env.ino. Week 10 I²C + display: code/week10-i2c-env/. Group reflection: power measurement below.

Group assignment

Guangzhou (Chaihuo) group documentation: measuring the power consumption of output devices.

Week 10 assignment:

  1. Group assignment: measure the power consumption of an output device.
  2. Individual assignment: add an output device to your own board and program it.

Objective

We measured the power behavior of a simple output load with a bench supply and multimeter, and documented a repeatable method that can be reused in individual projects.

Instruments and setup

  • Bench DC supply (CV mode)
  • Digital multimeter
  • Output load fixture
  • Alligator clips and test leads
Week 10 bench setup overview
Figure 1. Full bench setup with supply, meter, and test fixture.
Week 10 wiring close-up
Figure 2. Close-up of the wiring and fixture connection.

Calculation method

Power is calculated with:

P (W) = V (V) × I (A)

Current can be cross-checked with Ohm's law when resistor voltage is measured:

I = V / R

Experiment 1: Device ON state

We energized the load and recorded voltage/current from the bench supply and multimeter after readings stabilized.

Week 10 team operation
Figure 3. Team operation during ON-state measurement.
Meter reading example 1
Figure 4. Meter/supply readings under load.
Meter reading example 2
Figure 5. Additional ON-state reading snapshot.

Experiment 2: Open-circuit baseline

We disconnected/opened the loop to verify near-zero baseline current and confirm wiring behavior.

Zero current baseline example
Figure 6. Open-circuit baseline (current near zero).

Experiment 3: Dynamic / repeated operation

We repeated operation and observed current/power changes across multiple states to verify consistency.

Team operation close view
Figure 7. Repeated operation test and observation.
Meter reading example 3
Figure 8. Dynamic-state reading snapshot.
Load working state test
Figure 9. Output working-state verification under power.

Summary table

Condition Observation Conclusion
Load ON Current and power rise from baseline Output device consumes measurable power under operation
Open circuit Current near zero Baseline behavior is validated
Repeated/dynamic test Readings change with operating state Method is stable and reusable for future tests

Result summary

  • The workflow successfully captured state-dependent current and power changes.
  • Open-circuit baseline and loaded conditions were both observed.
  • We can reuse the same bench setup when measuring output power on our own boards.