olivergrabinski/weather-station

A compact ESP32-S3 Wi‑Fi/Bluetooth module is powered by an AP2112K 3.3 V regulator, with a JST SH connector and blue status LED.

Version
1.6.0
License
unset
Stars
0

Files

README.md

# Wi-Fi Weather Station (tscircuit)

A small 60 × 49 mm, 2-layer board that measures **temperature, relative
humidity and UV index** and reports over **Wi-Fi**. Designed entirely in
[tscircuit](https://tscircuit.com); every part is a stocked JLCPCB basic /
extended part so the board can be ordered assembled.

| Function | Part | Interface | Notes |
|---|---|---|---|
| MCU + Wi-Fi/BLE | ESP32-S3-WROOM-1-N8R2 (`U1`) | native USB | 8 MB flash, 2 MB PSRAM, on-module PCB antenna |
| Temperature + humidity | Sensirion SHT40-AD1B (`U3`) | I2C `0x44` | ±0.2 °C, ±1.8 %RH |
| UV index + ambient light | Lite-On LTR-390UV-01 (`U4`) | I2C `0x53` | INT on IO10 |
| Power in / programming | USB-C 16-pin (`J1`) | USB 2.0 | 5.1 k CC pull-downs (UFP), USBLC6-2SC6 ESD (`U5`), 750 mA polyfuse (`F1`), SMF5.0A TVS (`D3`) |
| 3.3 V rail | AP2112K-3.3 (`U2`) | | 600 mA, 55 µA quiescent, 250 mV dropout; 10 µF in, 22 µF + 100 nF out |
| Expansion | Qwiic / STEMMA-QT JST-SH 4-pin (`J2`) | I2C | GND, 3V3, SDA, SCL; ESD array `U6` |
| Debug / spare I/O | 8-pin 2.54 mm header (`J3`) | UART0 + GPIO | 3V3, GND, TXD0, RXD0, IO4–IO7; ESD arrays `U7`–`U9` |
| Buttons | RESET (`SW1`, EN), BOOT (`SW2`, IO0) | | hold BOOT + tap RESET → USB download mode |
| LEDs | `D1` power (green), `D2` status on IO21 (blue) | | |

## ESP32-S3 pin map

| Signal | GPIO | Signal | GPIO |
|---|---|---|---|
| I2C SDA | IO8 | USB D− | IO19 |
| I2C SCL | IO9 | USB D+ | IO20 |
| LTR-390 INT | IO10 | Status LED | IO21 |
| UART0 TX / RX | IO43 / IO44 (TXD0/RXD0) | Spare ADC-capable | IO4, IO5, IO6, IO7 |

I2C pull-ups (4.7 k) live on the board, so nothing on the Qwiic bus needs
its own. Strapping pins IO0/EN are handled by the buttons + 10 k pull-ups;
IO3, IO45, IO46 are left floating as Espressif recommends.

## Revision history

### 1.6.0 — placement verification
* The USBLC6 ESD arrays, both LEDs and the debug header now use the exact
  JLCPCB (EasyEDA) land patterns with the supplier's pin numbering, joining the
  USB-C, Qwiic, regulator, sensors and switches. Because the local footprint is
  the supplier's footprint at rotation 0, the pick-and-place rotations in the
  export are correct by construction. tscircuit still prints "cannot verify"
  for parts whose pads are perfectly symmetric (the 0603 LEDs, the SOT-23-6
  arrays), since it infers pin 1 from geometry; the polarity of each LED is
  checked separately against the supplier data.
* The header's pin 1 is a square pad, so its orientation is verifiable, and it
  gets a proper courtyard (the auto-generated one did not rotate with it).
* `F1` and `D3` are now real `<fuse>` and `<diode variant="tvs">` elements
  with proper schematic symbols instead of generic chips.

### 1.5.0 — protection
* VBUS now passes through `F1`, a 750 mA-hold / 1.5 A-trip polyfuse (Bourns
  MF-MSMF075/24-2), with `D3`, an SMF5.0A 200 W TVS, clamping the connector
  side to ground. The USB-C `VBUS` pins sit on the new `VBUS_IN` net.
* Every signal that leaves the enclosure gets an ESD array: `U6` on the Qwiic
  SDA/SCL, `U7` on TXD0/RXD0, `U8` on IO4/IO5, `U9` on IO6/IO7. They are the
  same USBLC6-2SC6 already used for USB (3.5 pF per line, VBUS pin tied to
  3V3), so no new part type is added to the assembly.

### 1.4.0 — regulator, board notch for the antenna
* AMS1117-3.3 replaced by the AP2112K-3.3 (SOT-23-5, JLCPCB C51118): 600 mA,
  55 µA quiescent instead of 5 mA, 250 mV dropout instead of 1.1 V, so the
  board stays efficient on USB and is ready for a battery supply. EN is tied
  to VIN; the existing 10 µF / 22 µF / 100 nF capacitors stay.
* The board is now 60 × 49 mm with a 21 × 5.5 mm notch in the top edge under
  the module's antenna. The antenna still hangs in free air, but the outline's
  bounding box covers it, so the auto-sized enclosure fits again and the
  USB-C / Qwiic openings stay only 3 mm behind the wall (an 8 mm recess would
  have made the plugs unreachable). The thermal slots and the top-right screw
  hole follow the new edge.

### 1.3.0 / 1.3.1 — antenna corner (1.3.1 is an identical re-push)
* The ESP32-S3 module now overhangs the top edge by 5 mm, so its PCB antenna
  sits in free air as Espressif recommends instead of over FR4.
* The top-left M3 hole is gone (three mounting holes remain) so no metal screw
  head sits beside the antenna; copper keep-outs cover the strip under the
  antenna base and 6 mm on each flank.
* The enclosure grows to cover the overhang automatically.

### 1.2.0 — power delivery
* 3V3 and VBUS nets route at 0.5 mm, GND at 0.4 mm (signals stay 0.25 mm), so
  Wi-Fi transmit bursts no longer run through 0.25 mm copper.
* `C9`, a 22 µF ceramic, added at the module's 3V3 pin next to the existing
  10 µF + 100 nF; the regulator keeps its own 22 µF.

### 1.1.x

* **Thermal isolation for the SHT40.** `U3` and its decoupling cap now sit on
  a 6.5 × 7.5 mm island at the top-right corner, separated from the rest of
  the board by three 1.2 mm milled slots (the left and right slots run out
  through the top edge). A single 3.2 mm bridge at the bottom carries the
  four traces (SDA, SCL, 3V3, GND), so heat from the LDO and the module can
  only reach the sensor through that narrow neck. Cutouts are routing
  obstacles in tscircuit, and the build verifies no trace or via crosses a
  slot.
* **Enclosure model.** The board is wrapped in an `<assembly.device>` with an
  `<enclosure.fdm.box>` (2 mm walls, 1 mm board clearance). Parts declare
  their own openings, so the printed lid and base get:
  * a 6 mm round **window above the UV sensor** `U4` — cover it with a
    UV-transparent material (0.1–0.2 mm PTFE film or a quartz disc; ordinary
    acrylic and polycarbonate block UV-B and would zero the UV index);
  * a 5 × 7 mm **vent above the SHT40 island** so outside air reaches the
    humidity sensor;
  * 4 mm holes above both buttons, a pill opening for USB-C and a rectangular
    opening for the Qwiic connector in the bottom wall.
  The debug header `J3` has no opening; use it with the lid off. Export the
  base and lid from the 3D view of `tsci dev` (or `tsci export -f glb`).
* The Qwiic connector `J2` now uses the exact JLCPCB footprint for
  SM04B-SRSS-TB, which also fixes pin-1 orientation for assembly.
* The USB-C receptacle `J1` uses the exact JLCPCB land pattern and 3D model
  for TYPE-C-31-M-12 (C165948), with each shell anchor as its own pin, so it
  shows up in the 3D/enclosure view and its placement rotation is verified.

## Layout notes

* The module sits at the top-left with its antenna overhanging the board edge
  by 5 mm; keep-outs keep copper away from the antenna base and flanks, and the
  top-left corner has no screw hole. Keep metal away from that corner in the
  enclosure.
* USB-C at the bottom edge, LDO next to it, buttons and expansion on the
  right, sensors along the top edge away from the LDO and the module (see
  Revision 1.1 for the SHT40 island and the enclosure openings).

## Files

* `index.circuit.tsx` – the whole board (schematic + PCB + BOM)
* `imports/` – JLCPCB parts pulled in with `tsci import` (exact EasyEDA
  footprints and 3D models). The ESP32 module's nine thermal-pad pads were
  merged into one pad; the SHT40 centre pad is labelled `EP` and left
  unconnected (Sensirion allows floating or VSS).
* `__snapshots__/` – rendered schematic and PCB SVGs

## Build / view / order

```bash
bun install            # or npm install
bun run dev            # live preview at http://localhost:3020
bun run build          # dist/index/circuit.json (+ routing)
bunx tsci snapshot     # refresh __snapshots__/*.svg
bunx tsci export index.circuit.tsx -f gerbers   # fabrication zip
bunx tsci export index.circuit.tsx -f kicad_zip # open in KiCad
```

Fab rules used: 0.25 mm traces (0.15 mm minimum), vias 0.3 mm drill / 0.6 mm
pad, 1.2 mm slots, all inside JLCPCB's standard 2-layer capability.

Checks that pass on this revision: `tsci check netlist`, `tsci check
placement`, `tsci check shorts`, full autoroute with no unconnected ports.

## Firmware sketch

Any ESP32-S3 Arduino / ESP-IDF / MicroPython image works over the USB-C
port (USB-Serial/JTAG, no driver chip). With Arduino:
`Wire.begin(8, 9)`, `Adafruit_SHT4x` for `U3`, `Adafruit_LTR390` for `U4`,
then publish over Wi-Fi (MQTT / HTTP) as you like.