# Termostato WiFi da Incasso 230Vac NodeMCU
## Description
Termostato da incasso con NodeMCU ESP8266, sensore DS18B20, alimentazione isolata 230 Vac, uscita relè SPDT a contatto pulito per caldaia e controllo via pagina web Wi-Fi.
## Project Details
- **Owner:** pierpa86
- **Created:** 3/21/2026
- **Last Updated:** 3/21/2026
- **Visibility:** Public
- **Field Interface - Mains:** 230 Vac 50 Hz input, mains section separated from LV logic and clearly labeled L and N
- **Connectivity:** Wi-Fi
- **System Architecture:** flowchart TD
subgraph HV [HV Zone 230Vac]
J_AC[AC input terminals]
PS1[HLK 5V AC DC]
K1[Relay SPDT contacts]
end
subgraph BARRIER [Safety Barrier]
U4[PC817 optocoupler]
ISO[6mm isolation boundary]
end
subgraph LV [LV Zone 5V 3V3]
U3[AP2112K 3V3]
U1[NodeMCU ESP8266]
U2[DS18B20]
Q1[2N2222A driver]
end
J_AC --> PS1
PS1 --> U3
U3 --> U1
U1 --> U2
U1 --> U4
U4 --> Q1
Q1 --> K1
- **Software:** NodeMCU web server with hysteresis control 0.5 K
- **Field Interface - Boiler:** Dry contact SPDT relay interface, isolated from LV control, target compatibility 5(3) A at 250 Vac
- **Operating Voltage:** 230 Vac, 50 Hz
- **Domain:** HVAC thermostat
- **Manufacturing Quantity Target:** Prototype
- **Isolation Boundary:** HV/LV split for 230 Vac thermostat; maintain 6 mm minimum creepage and clearance between mains and low voltage; prefer PCB slot barrier between zones
- **Reliability Target (MTBF):** Continuous thermostat duty for residential boiler control
- **Target Phase:** Proto
- **Power Requirements:** 230 Vac input, isolated 5 V and regulated 3.3 V rails
- **Human Interface:** Web page thermostat UI
- **Compliance:** IEC 62368-1 oriented zoning, HV/LV separation 6mm minimum
## Key Components
### D1 — [1N4148WS-7-F](https://www.flux.ai/adrian95/1n4148ws-7-f.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Role: Flyback Protection
- Manufacturer Name: Diodes Incorporated
- Datasheet URL: https://www.diodes.com/assets/Datasheets/1N4148WS_BAV16WS.pdf
- Package: SOD-323
- Role Details: Protezione flyback sulla bobina del relè
- Part Type: Diode
- Manufacturer Part Number: 1N4148WS-7-F
**Pins:**
- A [pin 2]
- K [pin 1]
### D2 — [SS14-E3/5AT](https://www.flux.ai/adrian95/ss14-e35at.md)
- Manufacturer Name: Vishay General Semiconductor - Diodes Division
- Package: SMA
- License: https://creativecommons.org/licenses/by/4.0/
- Role Details: Diodo Schottky serie su rail 5 V per protezione e isolamento
- Role: Reverse Protection
- Datasheet URL: https://www.vishay.com/docs/88746/ss12.pdf
- Part Type: Diode
- Manufacturer Part Number: SS14-E3/5AT
**Pins:**
- A [pin 2]
- K [pin 1]
### K1 — [SRA-05VDC-CL](https://www.flux.ai/jecstronic/sra-05vdc-cl.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: SRA-05VDC-CL
- Role: Boiler Relay
- Part Type: Relay
- Datasheet URL: https://datasheet.lcsc.com/lcsc/1811021915_Ningbo-Songle-Relay-SRA-05VDC-CL_C99666.pdf
- Role Details: Relè SPDT dry contact con coil 5 V e contatti >= 5 A 250 Vac
- Manufacturer Name: Ningbo Songle Relay
- Package: PCB Relay
**Pins:**
- A1 [pin 3]
- A2 [pin 4]
- COM [pin 5]
- NC [pin 2]
- NO [pin 1]
### PS1 — [HLK-5M05](https://www.flux.ai/jecstronic/hlk-5m05.md)
- Role: AC-DC Power
- Package: Through Hole Module
- Manufacturer Name: Hi-Link
- Part Type: Power Source
- Datasheet URL: https://5.imimg.com/data5/JI/JR/RP/SELLER-1833510/hlk-5m05-power-module.pdf
- License: https://creativecommons.org/licenses/by/4.0/
- Manufacturer Part Number: HLK-5M05
- Role Details: Modulo AC-DC isolato da 230 Vac a 5 V per alimentazione termostato
**Pins:**
- -VO [pin 3]
- +VO [pin 4]
- AC_1 [pin 1]
- AC_2 [pin 2]
### Q1 — [2N2222A](https://www.flux.ai/lcsc/2n2222a.md)
- Product Info Url: https://lcsc.com/product-detail/Transistors-NPN-PNP_2N2222_C118536.html
- Part Type: Transistors/Thyristors/Bipolar (BJT)
- Package or Case Code: TO-92-3_L4.9-W3.7-P1.27-L
- Role: Relay Driver
- Manufacturer Name: ST(先科)
- Frequency: 250MHz
- Role Details: Transistor NPN low-side per bobina relè 5 V
- Manufacturer Part Number: 2N2222A
- Compliance: RoHS
- Transistor Type: NPN
- JLCPCB Part Class: Extended Part
- Package: TO-92-3
- LCSC Part Number: C118536
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/1809200018_ST-Semtech-2N2222A_C118536.pdf
**Pins:**
- B [pin 2]
- C [pin 3]
- E [pin 1]
### U1 — [Nodemcu-12E ESP8266](https://www.flux.ai/jharwinbarrozo/nodemcu-12e-esp8266.md)
- Part Type: Microcontroller
- Package: Module
- Datasheet URL: https://components101.com/development-boards/nodemcu-esp8266-pinout-features-and-datasheet
- Role: Controller
- Role Details: NodeMCU WiFi per controllo termostato, web server e logica relè
- Manufacturer Part Number: Nodemcu-12E ESP8266
**Pins:**
- 3V3 [pin 25]
- 3V3 [pin 16]
- 3V3 [pin 11]
- A0 [pin 1]
- CMD GPIO11 [pin 7]
- D0 GPIO16 [pin 30]
- D1 GPIO5 SCL [pin 29]
- D2 GPIO4 SDA [pin 28]
- D3 GPIO0 [pin 27]
- D4 GPIO2 [pin 26]
- D5 GPIO14 [pin 23]
- D6 GPIO12 [pin 22]
- D7 GPIO13 [pin 21]
- D8 GPIO15 [pin 20]
- EN [pin 12]
- GND [pin 10]
- GND [pin 24]
- GND [pin 14]
- GND [pin 17]
- RST [pin 13]
- RSV1 [pin 2]
- RSV2 [pin 3]
- RX GPIO3 [pin 19]
- SCLK GPIO6 [pin 9]
- SD0 GPIO7 MISO [pin 8]
- SD1 GPIO8 MOSI [pin 6]
- SD2 GPIO10 [pin 4]
- SD2 GPIO9 [pin 5]
- TX GPIO1 [pin 18]
- VIN [pin 15]
### U2 — [DS18B20](https://www.flux.ai/lcsc/ds18b20.md)
- Role: Temperature Sensor
- Part Type: Temperature Sensors
- Package: TO-92
- Manufacturer Name: UMW(友台半导体)
- Package or Case Code: TO-92-3_L4.9-W3.7-P1.27-L
- JLCPCB Part Class: Extended Part
- Role Details: Sensore digitale ambiente per misura temperatura 5-30 C
- Manufacturer Part Number: DS18B20
- LCSC Part Number: C376006
**Pins:**
- DQ [pin 2]
- GND [pin 1]
- VDD [pin 3]
### U3 — [AP2112K-3.3TRG1](https://www.flux.ai/adrian95/ap2112k-33trg1.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: Diodes Incorporated
- Role Details: LDO 5 V a 3.3 V per logica e sensore
- Manufacturer Name: https://www.diodes.com/assets/Datasheets/AP2112.pdf
- Part Type: Integrated Circuit
- Role: Regulator
- Manufacturer Part Number: AP2112K-3.3TRG1
- Package: SOT-25
**Pins:**
- EN [pin 3]
- GND [pin 2]
- NC [pin 4]
- VIN [pin 1]
- VOUT [pin 5]
### U4 — [PC817](https://www.flux.ai/kicad-part-library/pc817.md)
- Role Details: Isolamento galvanico tra NodeMCU e stadio pilotaggio relè
- Package or Case Code: DIP-4_W7.62mm
- Role: Optocoupler
- Datasheet URL: http://www.soselectronic.cz/a_info/resource/d/pc817.pdf
- Package: DIP-4
- Manufacturer Part Number: PC817
**Pins:**
- ~ [pin 1]
- ~ [pin 3]
- ~ [pin 2]
- ~ [pin 4]
*The full schematic, PCB layout, bill of materials, and interactive design are available at [https://www.flux.ai/pierpa86/termostato-wifi-da-incasso-230vac-nodemcu](https://www.flux.ai/pierpa86/termostato-wifi-da-incasso-230vac-nodemcu).*
---
*Generated from [https://www.flux.ai/pierpa86/termostato-wifi-da-incasso-230vac-nodemcu](https://www.flux.ai/pierpa86/termostato-wifi-da-incasso-230vac-nodemcu)*