ESP32 Sensor and Control Schematic

Work done
  • Applied the required explicit per-net trace-width rules: 12V and HEATER_12V_SW at 2.0mm, GND at 1.0mm with Bottom preference, 3V3/5V at 0.8mm, and remaining named signal/control nets at 0.3mm.
  • Reconfirmed the PCB is on a 120mm × 100mm, Standard 2-layer stackup.
  • Reworked placement once to improve separation and keep the high-current zone on the right; relay/J1/J2 remain intended for the right-side power/heater area.
  • Fixed the Layers with Multiple Fills issue by limiting unintended sublayout fill participation; latest review shows that category is now clean.
Success criteria review
  • ✅ Net-specific trace-width rules applied and verified for the listed power/signal nets.
  • ✅ Bottom-layer GND fill conflict improved: Layers with Multiple Fills is now clean.
  • ❌ Routing is not complete: latest review still reports 24 airwires.
  • ❌ DRC is not clean: latest review still reports 15 overlapping copper errors and 24 airwire errors.
  • ❌ Final fabrication-ready state could not be confirmed: not at 0 airwires / 0 DRC errors.
Next steps
  • Continue with the fix-verify loop: resolve the remaining U5/TFT and 46116ccf copper overlaps, then route all nets in phases — high-current 12V/heater first, then 5V/3V3/GND, then SPI/control/sensor signals — and rerun DRC until clean.

Refine this doc
Ask about this doc
Firmware Getting Started
ESP32 Pin Mapping

Table


FunctionSchematic netESP32 DevKit pinArduino GPIO
DS18B20 sensor 1 dataONEWIRE_TEMP1U1:D44
DS18B20 sensor 2 dataONEWIRE_TEMP2U1:RX216
TFT SCKSPI_SCKU1:D1818
TFT MISOSPI_MISOU1:D1919
TFT MOSISPI_MOSIU1:D2323
TFT CSSPI_CS_TFTU1:D55
TFT DC/RSTFT_DCU1:D2121
TFT RESETTFT_RSTU1:D2222
Relay controlRELAY_CTRLU1:D2525
Active buzzer controlBUZZER_CTRLU1:D2626
Red LED controlLED_CTRLU1:D2727
Push button inputBUTTON_INPUTU1:D3232
PlatformIO Setup

Ini


[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
  paulstoffregen/OneWire
  milesburton/DallasTemperature
  adafruit/Adafruit ILI9341
  adafruit/Adafruit GFX Library
Arduino Starter Code

Cpp


#include <Arduino.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

#define PIN_TEMP1       4
#define PIN_TEMP2       16
#define PIN_TFT_CS      5
#define PIN_TFT_DC      21
#define PIN_TFT_RST     22
#define PIN_TFT_SCK     18
#define PIN_TFT_MISO    19
#define PIN_TFT_MOSI    23
#define PIN_RELAY       25
#define PIN_BUZZER      26
#define PIN_LED         27
#define PIN_BUTTON      32

#define TEMP_SETPOINT_C 50.0
#define TEMP_HYST_C     2.0

OneWire oneWire1(PIN_TEMP1);
OneWire oneWire2(PIN_TEMP2);
DallasTemperature temp1(&oneWire1);
DallasTemperature temp2(&oneWire2);
Adafruit_ILI9341 tft(PIN_TFT_CS, PIN_TFT_DC, PIN_TFT_RST);

bool heaterOn = false;
unsigned long lastReadMs = 0;

void setHeater(bool on) {
  heaterOn = on;
  digitalWrite(PIN_RELAY, on ? HIGH : LOW);
  digitalWrite(PIN_LED, on ? HIGH : LOW);
}

void setup() {
  Serial.begin(115200);
  pinMode(PIN_RELAY, OUTPUT);
  pinMode(PIN_BUZZER, OUTPUT);
  pinMode(PIN_LED, OUTPUT);
  pinMode(PIN_BUTTON, INPUT_PULLUP);
  setHeater(false);
  digitalWrite(PIN_BUZZER, LOW);

  temp1.begin();
  temp2.begin();
  SPI.begin(PIN_TFT_SCK, PIN_TFT_MISO, PIN_TFT_MOSI, PIN_TFT_CS);
  tft.begin();
  tft.setRotation(1);
  tft.fillScreen(ILI9341_BLACK);
  tft.setTextColor(ILI9341_WHITE);
  tft.setTextSize(2);
  tft.setCursor(10, 10);
  tft.println("Heater Controller");
}

void loop() {
  if (millis() - lastReadMs >= 1000) {
    lastReadMs = millis();
    temp1.requestTemperatures();
    temp2.requestTemperatures();
    float t1 = temp1.getTempCByIndex(0);
    float t2 = temp2.getTempCByIndex(0);
    float controlTemp = min(t1, t2);

    if (!heaterOn && controlTemp < TEMP_SETPOINT_C - TEMP_HYST_C) setHeater(true);
    if (heaterOn && controlTemp > TEMP_SETPOINT_C + TEMP_HYST_C) setHeater(false);

    bool alarm = (t1 == DEVICE_DISCONNECTED_C || t2 == DEVICE_DISCONNECTED_C);
    digitalWrite(PIN_BUZZER, alarm ? HIGH : LOW);

    Serial.printf("T1=%.2f C, T2=%.2f C, Heater=%s\n", t1, t2, heaterOn ? "ON" : "OFF");
    tft.fillRect(0, 40, 320, 120, ILI9341_BLACK);
    tft.setCursor(10, 50);
    tft.printf("T1: %.1f C\n", t1);
    tft.setCursor(10, 75);
    tft.printf("T2: %.1f C\n", t2);
    tft.setCursor(10, 100);
    tft.printf("Heater: %s\n", heaterOn ? "ON" : "OFF");
  }

  if (digitalRead(PIN_BUTTON) == LOW) {
    setHeater(false);
    digitalWrite(PIN_BUZZER, LOW);
  }
}
Bring-Up Sequence
  1. Power the board from 12V input and verify the 5V rail before installing the ESP32 DevKit.
  2. Verify ESP32 powers from VIN and 3V3 appears on the DS18B20 pull-up rail.
  3. Upload firmware and confirm serial output at 115200 baud.
  4. Confirm both sensors read valid temperatures before enabling the heater.
  5. Test relay switching with the heater disconnected first, then with the heater connected.
  • ESP32 Pin Mapping

  • PlatformIO Setup

  • Arduino Starter Code

  • Bring-Up Sequence

Assets

Assets are files uploaded to this project which can be used in various ways.

NSS Heater — Automatic Normal Saline Solution Warming System thumbnail
ESP32-based automatic Normal Saline Solution warmer with dual DS18B20 temperature sensing, ILI9341 TFT display, relay-controlled 12V heater output, buzzer/LED alerts, push button input, and segregated high-current PCB layout for thesis prototyping.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$7.25–$7.41

Digi-Key

$7.26–$9.40

LCSC

$7.86

Mouser

$18.76

TME

$0.27

Verical

$7.17–$8.88

Controls