Smart Office Building
Picture a small office building on your Learning Group's city tile. Entrance access, floor lighting, and occupancy should work together: lights respond to people and outside light, and the door is a controlled stand-in for revolving or sliding entry. That is embedded logic: light and presence inputs drive coordinated door and lighting outputs across more than one zone.
In this challenge you design and build a smart office building for your Learning Group city tile: control entrance access, dim or switch lights from outside light and presence, and track people inside across multiple floors or zones. Because this challenge spans two sprints, the delivered result is a multi-zone system — not a single lamp with one button. You integrate into the city’s shared firmware, make sensor data and controls available to full-stack classmates, and work through research, advice, design, and realisation for your Sprint 1-2 Learning Goal. Follow the city Requirements.
Your Learning Goal title in Portflow
Use: Sprint 1-2 - Learning Goal - Smart Office Building (adjust the sprint number if needed). See the Learning Goal page for the Portflow template.
Illustration
The animation below shows the idea in simplified form (door, presence, lights). Your delivered system must cover at least two floors or zones (or entry + lighting + occupancy as coordinated features) — each with clear sensing and outputs.
Challenge
Your Learning Group city needs a smart office building on a city tile. Entrance, lighting, and occupancy must work across at least two floors or zones (or a documented equivalent multi-feature set: entry + lighting + occupancy). Your work is part of one shared embedded firmware for the city — not a separate personal project.
You will deliver a working prototype and the documents that justify and explain it. Work in this order:
- Understand the problem. How many floors/zones do you control (at least two, or entry + lighting + occupancy as three coordinated features)? How does the door open? How do lights dim from outside light (LDR) and brighten with presence? How do you count or detect people inside? Write clear rules. Agree which tile template you use and how this challenge fits the city plan.
- Research. Compare realistic ways to drive an entrance servo, sense ambient light (LDR), detect presence (PIR/button/ultrasonic), and light multiple floors/zones, plus how to keep occupancy consistent. Include how you will expose building data and controls to the full-stack side. Use datasheets and cite resources for decisions.
- Advise. Recommend one architecture: microcontroller role in the shared city firmware, door, lighting per floor/zone, occupancy approach, and the data/control interface for full-stack. State what you are not building in this period.
- Design. Specify hardware (wiring, pin map, BOM) and software (state machine for multiple floors/features, thresholds, timing, interface messages) so someone else could rebuild your system and integrate it into the shared firmware.
- Realise. Build and test in small steps. Prefer separate Arduino sketches for parts (LDR dimming, PIR, door servo, one floor lights, then second floor/zone) before you merge working pieces into the shared city firmware on GitLab
main. Keep each test sketch tiny. Then demonstrate: door, dimming, and occupancy/lights work across multiple floors or features. Use simulation or stubs if full-stack or other tiles are not ready yet — do not wait on classmates to progress.
Minimum scope (Sprint 1–2)
Your contribution must include:
- Ownership of one city tile based on a LightBurn template, with the office building placed on that tile (or a clear bench stand-in while the tile is cut).
- Integration into the city’s one shared embedded firmware (follow the city’s code conventions; do not ship a parallel personal firmware stack).
- A microcontroller (e.g. ESP32-class board) that runs that shared firmware with your multi-zone office behaviour included.
- A multi-feature / multi-zone building that includes:
- An entrance driven by a servo (revolving/sliding door stand-in), with a button (or RFID-stand-in button) to request entry,
- Lighting that responds to outside light via LDR (dimmer or brightness level) on at least one zone,
- People presence / count inside (PIR, entry/exit buttons, or ultrasonic as stand-ins),
- At least two floors or light zones, OR a clear combination of entry + lighting + occupancy that spans enough work for two sprints (document which you chose; prefer two floors if hardware allows).
- Firmware that coordinates door, lights, and occupancy. Example pattern:
- Idle: door closed, lights at ambient-dimmed level when empty,
- Entry request → door opens briefly, occupancy updates,
- Presence on a floor/zone → that zone brightens; when empty again → return toward ambient dimming.
- A documented behaviour sequence for entry, occupancy update, and lighting. Keep it simple and explain your choice.
- Filtering or debouncing on buttons/PIR/LDR readings and timeouts so the door cannot chatter and lights cannot flicker endlessly.
- A documented data and control interface for full-stack developers: occupancy per floor/zone, light levels, door state, plus commands that can override lights or request door open (message names, payload fields, and an example). Full-stack may connect later — you still define and demo the interface (Serial, MQTT, or another city-agreed protocol), with simulation if needed.
- Updates to the city’s shared BOM and wiring diagram for your hardware.
Recommended scope
If you have time, add one or more of:
- A third floor/zone with the same lighting rules.
- Serial debug output showing LDR, occupancy, and light levels.
- A simple building model (cardboard floors) so zones are obvious in demos.
- An OLED status line (occupancy count, light mode).
- A stub or simulator feed that full-stack can use before your hardware is on the desk.
Out of scope for this challenge
These are not part of this challenge:
- Full HVAC, fire alarms as certified systems, or elevator control beyond a simple demo gimmick.
- Access control with real RFID security stacks or biometrics.
- Computer vision / ML people counting.
- Production PCB fabrication.
- Building the city back-end, front-end, or Raspberry Pi stack yourself — that is full-stack work. You do define and expose the embedded interface they connect to.
- A separate personal firmware repo that never merges into the city’s shared embedded application.
Demo and safety context
Treat the prototype as lab equipment, not a real building management system:
- Default to closed on the door when idle; default lights to a documented safe/ambient state when sensors are unsure.
- Predictable rules. Document exactly when the door opens and when each zone’s lights change.
- Clear demo script. Anyone in your Learning Group can show at least: ambient dimming with LDR; entry opens door and updates occupancy; presence brightens a zone; second floor/zone (or second feature) responds independently.
- Independent progress. You can demo your tile and interface with simulation or stubs while classmates finish their parts.
Starting points
Use these concrete first steps early in Sprint 1:
- Read the city Requirements and agree your challenge with the Learning Group (no duplicate challenges).
- Pick your tile template and sketch door, floors/zones, LDR, and presence sensors.
- Agree on multi-zone rules. For each floor/zone: when are lights dim vs bright, and how does occupancy change? Write rules in plain language.
- Inventory hardware. List what your studio kit provides (ESP32, servo, LDR, PIR/buttons, LEDs or WS2812, breadboard). Note gaps early and ask your coach. Start the city’s shared BOM. Optional KY modules from coach stock are fine if documented.
- Test in small sketches first. Create short Arduino sketches for one concern at a time (e.g. LDR → LED brightness, PIR, door servo, floor 1 lights, then floor 2). Do not develop everything only inside the city’s main shared firmware.
- Blink one LED to confirm toolchain: IDE, upload,
Serial.begin, one GPIO. See First ESP32 project. - Draft the full-stack interface with your city (per-zone topics/messages and a door/light override example). Agree a simulation path so neither side waits. Prove the messages in a small sketch before wiring them into shared firmware.
- Draft your research question. Example: Which door actuator, ambient/presence sensors, and per-floor lighting approach best fit a multi-zone office tile given GPIO limits and full-stack integration?
- Create your Learning Goal in Portflow. Link the product deliverables you plan to submit. Follow Learning Goal.
- Integrate only what works. Prove entry or one floor in sketches, then the second floor/zone, then coordination; move proven behaviour into the shared firmware in small merges.
Suggested sprint timeline
The Learning Group does not use Scrum, but you still follow the sprint rhythm of the Group Project: two sprints for this challenge (Sprint 1-2).
In the first sprint you focus on research and advice (including the multi-zone concept) and prove one subsystem (e.g. LDR dimming or door) in small sketches. In the second sprint you focus on design and realisation of the full multi-zone system: remaining floors/features, coordination, shared-firmware integration, and the full-stack interface.
| Sprint | Focus | Outcome |
|---|---|---|
| 1 | Research & advise (+ first subsystem in sketches) | Research report; advisory report; tile and zones chosen; door/light/occupancy rules; hardware choice; draft per-zone data/control interface; one subsystem proven in a small test sketch |
| 2 | Design & realisation (multi-zone) | Wiring diagram + pin map + multi-zone state diagram; shared BOM updated; at least two floors/zones (or entry + lighting + occupancy) coordinated in shared firmware on city GitLab main; demo (with simulation if needed); Portflow evidence linked; reflection |
Tools, frameworks, and hardware
| Area | Suggestions |
|---|---|
| City tile | One of the five LightBurn templates |
| Microcontroller | ESP32 / ESP32-S3 / ESP32-C3 (align with city hardware choices) |
| Actuators | SG90 servo (door); LEDs + resistors and/or WS2812 strip for floor lights |
| Sensors | LDR (ambient); PIR and/or buttons for entry/exit; optional ultrasonic, DHT11 for “comfort” status on OLED |
| Display | Optional OLED for occupancy / mode |
| IDE | Arduino IDE or PlatformIO |
| Version control | City GitLab project, shared firmware on main |
| Documentation | Markdown on the city MkDocs site and in the repo (English); cite sources for decisions |
| Full-stack link | Documented messages (Serial, MQTT, or city-agreed protocol); stubs/simulation so you do not block each other |
Profile knowledge worth revisiting:
- Arduino overview
- Sensors and actuators together
- Sketch structure and timing
- LED component
- Microcontrollers
Products
Your challenge evidence is a set of products: studio deliverables tied to learning outcomes. Submit them in Portflow and link them from your Learning Goal.
Analyse & Advise
| Product | What you deliver | Template |
|---|---|---|
| Research | Analysis of entrance control, ambient/presence-based lighting, and multi-zone occupancy; comparison with criteria; recommendation for design | Research product |
| Advice | Decision document: chosen MCU role in shared firmware, door, sensors, and lights per floor/zone, coordination rules, full-stack data/control interface, and implementation order (one zone → second zone → coordination) | Advisory report |
Suggested titles for Portflow
- Research: Multi-zone sensing and lighting for smart office building
- Advice: Coordinated office entry, lighting, and occupancy architecture
The advice report should build on the research report. Do not repeat the full comparison tables.
Design & Realise
Product pages for design and realisation are still being added to the studio catalogue. For this challenge, deliver the following and attach them as evidence (repository links, PDFs, or videos as your coach specifies).
| Product | Learning outcome | What you deliver |
|---|---|---|
| System design | Design & Realise | Self-contained design document: context, city requirements link-in, block diagram for multiple floors/zones, circuit/wiring diagram, pin assignment table, office state machine (diagram + description), timing parameters, software module overview for the shared firmware, per-zone data/control interface for full-stack, contribution to the city BOM, and test plan |
| Prototype realisation | Design & Realise | Working multi-zone prototype on your city tile (or documented bench stand-in), code integrated in the city’s shared firmware on GitLab main, README with build/upload steps, interface demo (live or simulated), and validation evidence showing coordinated behaviour across floors/features |
Suggested titles for Portflow
- Design: Smart Office Building — multi-zone hardware and firmware specification
- Realisation: Smart Office Building — multi-zone prototype and validation
System design — minimum contents
Your design document should let a peer rebuild and integrate the system without guessing:
- Requirements. Per-zone rules for occupied / empty, LDR dimming, and door behaviour; how this fits the city Requirements.
- Architecture diagram. MCU, door servo, LDR, presence sensors, lights per floor/zone, power, and the path to full-stack (protocol boundary).
- State machine. States that cover idle/closed, entry, occupied bright, empty dim, and optional override commands.
- Timing table. Door open duration; presence timeout before dimming; LDR sampling interval.
- Pin map and wiring diagram. GPIO ↔ component for every zone; include resistor values for LEDs/LDR.
- BOM. Parts list aligned with the city’s shared BOM.
- Sensor handling. Threshold, debounce/filter, and timeout logic per input.
- Full-stack interface. Messages for occupancy and light state per zone, plus door/light controls; example payloads; how to test with a stub or simulator.
- Shared firmware. Where your modules live in the city codebase and which code conventions you follow.
- Test plan. e.g. “empty → dim”, “entry → door + occupancy”, “floor A bright / floor B dim”, “override lights”, “LDR change”.
Realisation — minimum evidence
- Small test sketches (or a short test log) showing you verified parts separately: door, LDR, presence, floor 1, floor 2 (or each feature) — before integration.
- Work on the city GitLab project: proven multi-zone behaviour merged (or ready to merge) into
mainas part of the shared firmware — not a dump of unfinished experiments into main. - Photo or diagram of the physical build on the tile (or bench stand-in with a clear path to the tile), with floors/zones labelled.
- Demo script (numbered steps) matching your video or live assessment, covering at least two floors/zones (or entry + lighting + occupancy) and the data/control interface.
- Proof you can progress without waiting on full-stack (simulation, Serial demo, or stub consumer).
- Honest known limitations (e.g. PIR false triggers, interface not yet wired to the Pi).
Quality indicators
When assessing this challenge as a whole, the following indicators are used. Use them as a self-check before you submit.
Problem fit
- The floors/zones (or features) and door / light / occupancy rules are described in plain language.
- Scope is explicit: this challenge delivers a multi-zone smart office on your city tile (at least two floors/zones or entry + lighting + occupancy), integrated into shared firmware — not a single-lamp demo or a solo firmware fork.
- The work respects the city Requirements (tile, shared firmware, BOM/wiring, full-stack interface, no waiting on classmates).
Analyse & Advise products
- Research and advice reports meet the research and advisory report quality indicators.
- The advice report references the research report and states one clear recommended architecture for coordinated zones, including how per-zone data and controls reach full-stack.
- Component and approach choices are supported by datasheets or comparable evidence, not only opinion. Decisions cite resources.
Design
- The design document is self-contained and includes a multi-zone state machine plus timing rules that match the intended firmware behaviour.
- Pin map, wiring diagram, and BOM cover door, sensors, and every controlled zone and match the realised prototype (or differences are documented with reason).
- Fail-safe behaviour is designed explicitly (door default closed, timeouts, stable dimming).
- The data/control interface for full-stack is specified with example messages per zone.
Realisation
- The prototype demonstrates entrance, LDR-related lighting, and occupancy-driven behaviour across at least two floors/zones (or the documented multi-feature set).
- Behaviour lives in the city’s shared firmware on GitLab
main(or is clearly opened as an integration MR), following city code conventions. - Firmware is readable: meaningful names, constants for thresholds/timings, no unexplained magic numbers.
- Sensor input is filtered or debounced; light and door changes are observable via Serial log or demo script.
- The full-stack interface is demonstrable (live or with simulation/stubs) without depending on a finished back-end.
- Validation evidence covers entry, zone A, zone B (or each feature), and at least one edge case (e.g. brief false PIR, override).
- Repository README explains how to build, flash, and run the multi-zone demo as part of the city project.
Professional practice
- Learning Goal in Portflow uses the correct naming format and links to all product evidence.
- End-of-sprint reflection connects results to your learning question and to embedded practice (timing, I/O, multi-zone coordination, city integration).
- Documentation is in English Markdown and usable by other city students on their tiles.
- You did not block on classmates: simulation, stubs, or a local demo kept you moving.
Focus points
Watch out for these common issues while you work:
- Stopping at one floor. Two sprints mean a multi-zone result; one lamp alone is not enough for this challenge.
- Occupancy drift. Entry/exit counting can desync; document recovery (reset button, timeout to empty).
- Everything in main firmware. Develop and test parts in small Arduino sketches first; only integrate working pieces into the shared city firmware.
- Solo firmware forever. Test sketches are fine for learning; the assessed integration still joins the shared city firmware per the Requirements.
- Waiting on full-stack. Define the interface early and demo with Serial/stubs; do not pause realisation until the Pi dashboard exists.
- Blocking
delay()everywhere. Longdelay()calls miss presence on other zones. Prefermillis()-based state machines or timers. - LDR flicker. Smooth or threshold ambient readings so lights do not strobe.
- Servo power. Do not starve the MCU; power the door servo appropriately and document it.
- Advice without analysis. Coaches will send back an advice report that invents new comparisons not present in research.
- Design–code drift. Update the design document when you change pins, thresholds, timings, zones, or interface messages during realisation.
Key points
- Core task: coordinate entrance, lighting, and occupancy across multiple floors/zones on your city tile.
- Because this is Sprint 1-2, the delivered system is multi-zone (at least two floors/zones or entry + lighting + occupancy), not a single feature.
- Test small parts in separate Arduino sketches; integrate only what works into one shared firmware.
- Expose per-zone data and controls for full-stack; keep a shared BOM and wiring diagram.
- Deliver four products: research, advice, system design, and prototype realisation.
- Work research → advice → design → realise; Sprint 1 emphasises research & advice (and proving one subsystem); Sprint 2 emphasises multi-zone design & realisation.
- Full BMS / CV and city-wide building networks beyond your tile are out of scope; building the city back-end/front-end is out of scope for you.
- Link everything to your Learning Goal in Portflow and reflect at the end of Sprint 1-2.