# RoastIQ Temp Sensor — Circuit Reference Wiring guide for soldering the ESP32 dual-thermocouple temperature sensor board. --- ## Bill of Materials | Qty | Component | Notes | |-----|------------------------|------------------------------------| | 1 | ESP32 DoIt DevKit v1 | 38-pin, USB powered | | 2 | MAX6675 module | With screw terminals or pin header | | 2 | K-Type thermocouple | One for BT (bean), one for ET (exhaust) | | — | 22 AWG hookup wire | 6 colours recommended for clarity | | — | Breadboard or perfboard| Breadboard for prototyping, perfboard for permanent build | --- ## Wiring Diagram ``` ┌──────────────────────────────────────────────────────────────────┐ │ RoastIQ Ventures Temp Sensor — Wiring │ │ │ │ SPI Bus 1 — BT (Bean Temperature) │ │ ┌────────────┐ GPIO 5 ─────────────────── SCLK │ │ │ │ GPIO 23 ─────────────────── CS ┌─────────┐ │ │ │ ESP32 │ GPIO 19 ◄────────────────── SO │MAX6675 │ │ │ │ DevKit v1 │ 3V3 ─────────────────── VCC │ #1 │ │ │ │ │ GND ─────────────────── GND │ (BT) │ │ │ │ │ │ │ │ │ │ │ │ T+ T- │ │ │ │ │ └───┬──┬──┘ │ │ │ │ │ │ │ │ │ │ ┌─────┴──┴──┐ │ │ │ │ │ K-Type │ │ │ │ │ │ Probe │ │ │ │ │ │ (BT) │ │ │ │ │ └───────────┘ │ │ │ │ │ │ │ │ SPI Bus 2 — ET (Exhaust Temperature) │ │ │ │ GPIO 26 ─────────────────── SCLK │ │ │ │ GPIO 25 ─────────────────── CS ┌─────────┐ │ │ │ │ GPIO 33 ◄────────────────── SO │MAX6675 │ │ │ │ │ 3V3 ─────────────────── VCC │ #2 │ │ │ │ │ GND ─────────────────── GND │ (ET) │ │ │ └────────────┘ │ │ │ │ │ T+ T- │ │ │ └───┬──┬──┘ │ │ │ │ │ │ ┌─────┴──┴──┐ │ │ │ K-Type │ │ │ │ Probe │ │ │ │ (ET) │ │ │ └───────────┘ │ └──────────────────────────────────────────────────────────────────┘ ``` --- ## Pin Reference — Soldering Cheatsheet ### MAX6675 #1 — BT (Bean Temperature) | ESP32 Label | GPIO | → | MAX6675 Pin | |-------------|------|---|-------------| | 3V3 | — | → | VCC | | GND | — | → | GND | | D5 | 5 | → | SCLK | | D23 | 23 | → | CS | | D19 | 19 | ← | SO | ### MAX6675 #2 — ET (Exhaust Temperature) | ESP32 Label | GPIO | → | MAX6675 Pin | |-------------|------|---|-------------| | 3V3 | — | → | VCC | | GND | — | → | GND | | D26 | 26 | → | SCLK | | D25 | 25 | → | CS | | D33 | 33 | ← | SO | > `→` = ESP32 drives the signal `←` = ESP32 reads the signal --- ## Power - MAX6675 runs on **3.3 V** — use the ESP32's **3V3** pin, **not VIN or 5V** - Both modules share the same 3V3 and GND rails - The ESP32 is USB-powered; no external supply is needed for bench testing - Total current draw of both MAX6675 modules is under 10 mA — well within the 3V3 regulator limit --- ## Thermocouple Wiring (K-Type) K-Type thermocouples have two conductors. Connect them to the screw terminals on the MAX6675 module: | Thermocouple wire | MAX6675 terminal | |-------------------|------------------| | **Yellow / (+)** | T+ | | **Red / (−)** | T− | > Colour codes vary by manufacturer. When in doubt, check the label on the probe or its datasheet. > Reversing polarity gives inverted readings, not damage. - Route thermocouple leads away from mains wiring to reduce noise - If the MAX6675 detects an open (disconnected) thermocouple it reports **1023.75 °C** — the firmware checks this bit --- ## Soldering Tips 1. **Tin all wire ends** before soldering to module headers 2. **Use flux** — MAX6675 module pads are small and flux prevents cold joints 3. After soldering, **verify continuity** with a multimeter before powering up: - Each signal wire point-to-point (e.g. D5 → SCLK of #1) - No shorts between adjacent pins 4. **Common fault — 1023.75 °C reading**: SO or CS wire is loose or swapped 5. **Common fault — 0 °C reading**: VCC or GND missing; probe not connected 6. **Common fault — both channels identical**: CLK or CS wires crossed between modules --- ## Firmware Reference Pin definitions are in [`src/main.cpp`](src/main.cpp): ```cpp // MAX6675 #1 — BT int thermoDO = 19; // SO int thermoCS = 23; // CS int thermoCLK = 5; // SCLK // MAX6675 #2 — ET int thermoDO2 = 33; // SO int thermoCS2 = 25; // CS int thermoCLK2 = 26; // SCLK ``` Data is read every 3 seconds and broadcast over WebSocket at `ws://:80/ws` in the format `{"data": {"BT": 185.5, "ET": 210.25}}`.