#electronics #sensorbox #esphome #home-assistant #air-quality #made-with-layers #youtube
# Overview
Distillation of Thomas Sanladerer's (Made with Layers) build video *I made it easier to measure your 3D printer's emissions!* (17 min, 2024-11-19) — the assembly and setup guide the Printables page defers to. His framing: a next-generation Sensorbox for 3D printer emissions and general home air quality, optimized to be as easy as possible to build using the cheapest parts that still give good measurements. [0:00](https://youtu.be/OzFAtCZh_fM?t=0) [0:14](https://youtu.be/OzFAtCZh_fM?t=14)
Every bullet deep-links to the moment in the video. Sections follow the build: **Parts** → **Sensor Selection** (the four sensor classes and his loadouts) → **Firmware Setup** (flash before you assemble) → **Assembly** → **Home Assistant**. Pinouts, PCB revisions and the sensor gotchas from the Printables page live in [[Sensorbox V2]]; this note only covers what's said in the video.
# Resources
- [Build video](https://www.youtube.com/watch?v=OzFAtCZh_fM) · full timestamped transcript: [[Made with Layers Sensorbox V2 Transcript]]
- Links from the description: [Printables page](https://www.printables.com/model/1079858-3d-printer-emission-sensor-array-sensorbox-v2) (print files, full parts list, PCB order files) · [Home Assistant install](https://www.home-assistant.io/installation/) · [ESPHome add-on setup](https://esphome.io/guides/getting_started_hassio.html) · [JLCPCB](https://jlcpcb.com/?from=TSPCB) (sponsor)
- Related: [[Sensorbox V2]] (project note and build log) · [[JLCPCB Design Notes]]
# Parts
## What you need
- Printed parts for the case, the main PCB, the main components (ESP, display, DC-DC converter, button, headers, a couple of screws) and whichever sensors you want. [4:35](https://youtu.be/OzFAtCZh_fM?t=275)
- Design concept: a fully built, functional "controller puck" that slides into the outer shell — this is what makes it easy to assemble and easy to print. [4:50](https://youtu.be/OzFAtCZh_fM?t=290)
| Part | Notes | Video |
|---|---|---|
| ESP32-S2 | Usually about two bucks | [5:48](https://youtu.be/OzFAtCZh_fM?t=348) |
| DC-DC converter | Simple module to supply 3.3V | [5:53](https://youtu.be/OzFAtCZh_fM?t=353) |
| Button, pin headers and sockets, a few screws | Standard parts | [5:56](https://youtu.be/OzFAtCZh_fM?t=356) |
| 2.8" LCD | Cheap and pretty large but poor viewing angles; "the best compromise for now" and what the software is set up for out of the box | [6:05](https://youtu.be/OzFAtCZh_fM?t=365) |
| 1.3" IPS or 2.13" e-ink (optional) | PCB has headers for both; the IPS is "surprisingly crisp"; hardware fully supports them | [6:22](https://youtu.be/OzFAtCZh_fM?t=382) |
## Printed parts
- Shell prints upside down, needs no support material, any material and colour. [5:00](https://youtu.be/OzFAtCZh_fM?t=300)
- Screen spacers and the shelf for the wired sensors are simple prints any printer can handle. [5:10](https://youtu.be/OzFAtCZh_fM?t=310)
## Ordering the PCB
- Upload the zip, select the lead-free option, pick the cheapest shipping: less than five bucks for five boards, in hand in about two weeks — about the same lead time as AliExpress parts. [5:17](https://youtu.be/OzFAtCZh_fM?t=317) [5:32](https://youtu.be/OzFAtCZh_fM?t=332)
- It's a simple two-layer board. Five boards cost so little that he dropped the idea of also documenting the old jumper-cable version. [1:28](https://youtu.be/OzFAtCZh_fM?t=88) [1:44](https://youtu.be/OzFAtCZh_fM?t=104)
- You don't have to populate every sensor header — the spare boards can become simpler air-quality monitors. [5:36](https://youtu.be/OzFAtCZh_fM?t=336)
## Sourcing sensors
- All of his came from AliExpress (cheapest with sales/discounts); most are also on Amazon or Arduino/Raspberry Pi shops. [7:37](https://youtu.be/OzFAtCZh_fM?t=457)
- Some sensors have subtle variations between versions — the Printables components list says which one to get. [7:47](https://youtu.be/OzFAtCZh_fM?t=467)
# Sensor Selection
## The four sensor classes
| Class | His take | Video |
|---|---|---|
| Temperature / humidity | Generally useful, and other sensors need it for reference | [6:37](https://youtu.be/OzFAtCZh_fM?t=397) |
| CO2 | Great for knowing when indoor air is "used up" from living and breathing; not useful at all for 3D printer emissions — "If your printer emits CO2, it's literally on fire," and a smoke detector would do a better job | [6:46](https://youtu.be/OzFAtCZh_fM?t=406) [6:58](https://youtu.be/OzFAtCZh_fM?t=418) |
| Particles | Largest and most expensive sensor, but gives the most meaningful data for FDM emissions and for general degradation from fires and combustion heaters | [7:08](https://youtu.be/OzFAtCZh_fM?t=428) |
| Gas / VOC | Not super necessary for FDM; highly useful for resin printing | [7:20](https://youtu.be/OzFAtCZh_fM?t=440) |
All supported sensors are cheap plug-and-play breakout boards that ESPHome already has drivers for; the PCB lets you mix and match. [2:22](https://youtu.be/OzFAtCZh_fM?t=142) [7:28](https://youtu.be/OzFAtCZh_fM?t=448)
## Recommended loadouts
| Scenario | Sensors | Video |
|---|---|---|
| FDM printing | AHT20 + BMP280 (temp/humidity/pressure), SGP30 (overall VOC), PMS5003 (particle counts) | [7:56](https://youtu.be/OzFAtCZh_fM?t=476) |
| Resin printing | AHT20 + BMP280, SGP30, and a ZE08 formaldehyde sensor in place of the particle sensor | [8:15](https://youtu.be/OzFAtCZh_fM?t=495) |
| Home air quality | AHT20 + BMP280 + SGP30 as a decent approximate indicator; add PMS5003 if you're near wood-burning fireplaces or a busy road; add SCD40 if you want precise indoor CO2 | [8:50](https://youtu.be/OzFAtCZh_fM?t=530) [9:00](https://youtu.be/OzFAtCZh_fM?t=540) [9:11](https://youtu.be/OzFAtCZh_fM?t=551) |
- Why both SGP30 and ZE08 for resin: general VOC sensors have some formaldehyde sensitivity and the ZE08 responds a little to other VOCs, but having both lets you tell ethanol fumes (which standard VOC sensors are very sensitive to) apart from nastier stuff like formaldehyde, which the ZE08 shows more clearly. [8:27](https://youtu.be/OzFAtCZh_fM?t=507) [8:36](https://youtu.be/OzFAtCZh_fM?t=516)
- Any combination works; these are just what he finds most effective. [9:17](https://youtu.be/OzFAtCZh_fM?t=557)
## Optional and alternative sensors
- **MQ-7 (modified) carbon monoxide** — dedicated header; useful for open fireplaces or gas furnaces, not for 3D printing ("Maybe for laser cutting?"). [9:30](https://youtu.be/OzFAtCZh_fM?t=570)
- **ENS160 VOC** — low-cost but doesn't always produce repeatable VOC measurements; when he used it he ran two of them plus another sensor type to verify. The AHT20 usually bundled on the same board isn't helpful because the ENS160 heats the whole board. Its upside: very cheap, and its estimated CO2 (like the SGP30's) is often close enough for a rough good/bad indicator at a fraction of an SCD40's cost. [9:45](https://youtu.be/OzFAtCZh_fM?t=585) [9:57](https://youtu.be/OzFAtCZh_fM?t=597) [10:05](https://youtu.be/OzFAtCZh_fM?t=605) [10:15](https://youtu.be/OzFAtCZh_fM?t=615)
- **SGP41** — drop-in alternative to the SGP30, newer, but under ESPHome it only reports a VOC index rather than a ppm concentration, so for now he considers the SGP30 more useful. [10:30](https://youtu.be/OzFAtCZh_fM?t=630)
- **Spare I2C header** for your own sensors (e.g. a combined SEN55) if you modify the config; a header for WS2812-style addressable LEDs; and the spare ESP32-S2 GPIOs broken out — solder a pin header on and use them for whatever. [10:51](https://youtu.be/OzFAtCZh_fM?t=651) [11:02](https://youtu.be/OzFAtCZh_fM?t=662)
# Firmware Setup
Do this first: once everything is assembled the ESP is "a little bit inaccessible." [13:00](https://youtu.be/OzFAtCZh_fM?t=780)
## Home Assistant prerequisites
- The project is ESP32 + ESPHome rather than hand-written Arduino code; ESPHome is part of the Home Assistant project, so it integrates well. [2:13](https://youtu.be/OzFAtCZh_fM?t=133) [2:40](https://youtu.be/OzFAtCZh_fM?t=160)
- Run HA on a spare Raspberry Pi or in a VM on your NAS (he runs it in a VM on Unraid). [3:52](https://youtu.be/OzFAtCZh_fM?t=232)
- Use the full **Home Assistant OS** — in a plain Docker container "you don't quite get the full functionality." [4:10](https://youtu.be/OzFAtCZh_fM?t=250)
- Set up and manage the Sensorbox with the **ESPHome add-on inside Home Assistant**; he found that the best way overall. [4:00](https://youtu.be/OzFAtCZh_fM?t=240)
## Flashing the ESP32-S2
1. Plug the ESP into a computer and open the ESPHome Web Flasher in a Chrome-based browser. [11:16](https://youtu.be/OzFAtCZh_fM?t=676)
2. Enter bootloader mode by holding the **"0"** button while plugging in, then select the serial port and flash the basic ESPHome firmware. [11:29](https://youtu.be/OzFAtCZh_fM?t=689)
3. If it fails to connect: leave it plugged in, hold **"0"**, briefly tap **"RST"**, then release **"0"**. [11:37](https://youtu.be/OzFAtCZh_fM?t=697)
4. After flashing, unplug and replug, connect once more, and use the web flasher to join the ESP to your WiFi. [11:47](https://youtu.be/OzFAtCZh_fM?t=707)
5. In the ESPHome add-on the new ESP shows up automatically — click **Adopt**. [11:54](https://youtu.be/OzFAtCZh_fM?t=714)
6. Open the **secrets** menu and fill in WiFi name and password again ("extra insurance to make sure things go smoothly"), then save. [12:00](https://youtu.be/OzFAtCZh_fM?t=720)
7. Edit the new ESP's config, replace it with the sample Sensorbox config, and hit **Install** to flash over WiFi — a minute or two. Any later config changes are edited and reflashed the same way. [12:12](https://youtu.be/OzFAtCZh_fM?t=732) [12:22](https://youtu.be/OzFAtCZh_fM?t=742)
## Getting the sensors into Home Assistant
- It should appear automatically as a new device under HA Settings. [12:27](https://youtu.be/OzFAtCZh_fM?t=747)
- If not: ESPHome tab → open the ESP's logs → note its IP address → Settings → Devices and Integrations → Add Integration → ESPHome → enter the IP. This creates a device holding all the Sensorbox readings. [12:35](https://youtu.be/OzFAtCZh_fM?t=755) [12:50](https://youtu.be/OzFAtCZh_fM?t=770)
# Assembly
## PCB
- Only two components solder directly to the PCB — the pushbutton and the DC-DC converter; everything else plugs into headers. [13:07](https://youtu.be/OzFAtCZh_fM?t=787)
- Pushbutton: make sure it sits flush, pushed all the way against the PCB. [13:13](https://youtu.be/OzFAtCZh_fM?t=793)
- DC-DC converter: orientation matters — the silkscreen has a graphical layout hint. [13:18](https://youtu.be/OzFAtCZh_fM?t=798)
- Sensor headers: populate just the ones you'll use, or all of them for maximum flexibility. [13:25](https://youtu.be/OzFAtCZh_fM?t=805)
- ESP headers: plug the ESP board into the headers while soldering to keep everything aligned. [13:35](https://youtu.be/OzFAtCZh_fM?t=815)
- The left-side headers (PMS, ZE08, addressable LEDs and so on) get **pins**; all the others get **sockets**. The display sockets go in from the opposite side. [13:42](https://youtu.be/OzFAtCZh_fM?t=822) [13:50](https://youtu.be/OzFAtCZh_fM?t=830)
- Two footprints for electrolytic capacitors, one on 5V and one on 3.3V — optional, but if you get random reboots or instability, adding them often helps. [13:53](https://youtu.be/OzFAtCZh_fM?t=833)
## Sensor breakouts
- Breakout pins come unsoldered; the PCB is laid out so every carrier board sits with its sensor element facing **away** from the main PCB. [14:03](https://youtu.be/OzFAtCZh_fM?t=843)
- Cover the sensor element while soldering so it doesn't get flux splatter. [14:15](https://youtu.be/OzFAtCZh_fM?t=855)
- ZE08 and PMS5003 come with a ribbon cable: his recommendation is to crimp Dupont-style connectors; the shortcut is soldering the wires straight to the PCB with hot glue for strain relief. Pinouts are shown on screen at [14:42](https://youtu.be/OzFAtCZh_fM?t=882) (see [[Sensorbox V2]] for the written-out pinouts). [14:22](https://youtu.be/OzFAtCZh_fM?t=862) [14:33](https://youtu.be/OzFAtCZh_fM?t=873)
## Mechanical
- With sensors and ESP plugged in, add the printed frames. M3 (or similar) screws thread straight into the screen spacer; a 25 mm screw from the sensor side sandwiches the PCB between the rear shelf and the screen spacer. [14:47](https://youtu.be/OzFAtCZh_fM?t=887) [14:56](https://youtu.be/OzFAtCZh_fM?t=896)
- Mount the wired sensors (ZE08, PMS, or MQ-7) on the shelf — there isn't much spare height, so keep them flush to the spacer. [15:02](https://youtu.be/OzFAtCZh_fM?t=902)
- Plug in the screen on the other side; the holes line up. [15:14](https://youtu.be/OzFAtCZh_fM?t=914)
- Connect a USB-C cable to the ESP for power, then slide the block into the outer shell and fix it with M3x10 countersunk screws (or whatever's on hand) — these sandwich the screen between shell and spacer and pull it tight to the front. [15:20](https://youtu.be/OzFAtCZh_fM?t=920) [15:28](https://youtu.be/OzFAtCZh_fM?t=928)
- A small zip tie on the USB cable for strain relief finishes it. [15:40](https://youtu.be/OzFAtCZh_fM?t=940)
- Some sensors need about a day of runtime to settle and give plausible readings — leave it plugged in. [15:48](https://youtu.be/OzFAtCZh_fM?t=948)
# Home Assistant
- The on-device screen shows current readings, but the data is more useful inside HA, which logs everything automatically with graphs and statistics. [3:27](https://youtu.be/OzFAtCZh_fM?t=207) [15:58](https://youtu.be/OzFAtCZh_fM?t=958)
- Quick start: create a new dashboard and add a **statistics diagram** card for one sensor. [16:03](https://youtu.be/OzFAtCZh_fM?t=963)
- Air cleaner automation: with a smart plug in HA, create an automation triggered every time the sensor reading changes; the action checks whether the reading is above your threshold and turns the plug on, otherwise off. He calls this the simplest possible use of the data. [16:10](https://youtu.be/OzFAtCZh_fM?t=970) [16:32](https://youtu.be/OzFAtCZh_fM?t=992)
- Other examples he gives: a Hue bulb flashing red on unsafe particle levels only when you're home, a Zigbee smoke detector alerting your phone when you're away, and his basement dehumidifiers running only when his SMA solar inverters report spare power. [2:59](https://youtu.be/OzFAtCZh_fM?t=179) [3:17](https://youtu.be/OzFAtCZh_fM?t=197)
- The top button dims the screen for bedroom use; everything is customizable. [0:27](https://youtu.be/OzFAtCZh_fM?t=27)
# References
- [[Sensorbox V2]] — project note, build log, pinouts and PCB-revision gotchas
- [[3D Printer Emission Sensor Array (Sensorbox v2) by Tom Download free STL model]] — clipped Printables page
- [[Made with Layers Sensorbox V2 Transcript]] — companion transcript