# 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~jvm.md) - Manufacturer Name: Diodes Incorporated - Part Type: Diode - Manufacturer Part Number: 1N4148WS-7-F - Role Details: Protezione flyback sulla bobina del relè - Package: SOD-323 - Datasheet URL: https://www.diodes.com/assets/Datasheets/1N4148WS_BAV16WS.pdf - Role: Flyback Protection - License: https://creativecommons.org/licenses/by/4.0/ **Pins:** - A [pin 2] - K [pin 1] ### D2 — [SS14-E3/5AT](https://www.flux.ai/adrian95/ss14-e35at~pyx.md) - Package: SMA - Manufacturer Part Number: SS14-E3/5AT - Role: Reverse Protection - Part Type: Diode - Manufacturer Name: Vishay General Semiconductor - Diodes Division - Datasheet URL: https://www.vishay.com/docs/88746/ss12.pdf - License: https://creativecommons.org/licenses/by/4.0/ - Role Details: Diodo Schottky serie su rail 5 V per protezione e isolamento **Pins:** - A [pin 2] - K [pin 1] ### K1 — [SRA-05VDC-CL](https://www.flux.ai/jecstronic/sra-05vdc-cl~wr.md) - License: https://creativecommons.org/licenses/by/4.0/ - Role: Boiler Relay - Manufacturer Part Number: SRA-05VDC-CL - Datasheet URL: https://datasheet.lcsc.com/lcsc/1811021915_Ningbo-Songle-Relay-SRA-05VDC-CL_C99666.pdf - Part Type: Relay - Package: PCB Relay - Role Details: Relè SPDT dry contact con coil 5 V e contatti >= 5 A 250 Vac - Manufacturer Name: Ningbo Songle 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~ry.md) - Role Details: Modulo AC-DC isolato da 230 Vac a 5 V per alimentazione termostato - Part Type: Power Source - Manufacturer Name: Hi-Link - Datasheet URL: https://5.imimg.com/data5/JI/JR/RP/SELLER-1833510/hlk-5m05-power-module.pdf - Role: AC-DC Power - Manufacturer Part Number: HLK-5M05 - Package: Through Hole Module - License: https://creativecommons.org/licenses/by/4.0/ **Pins:** - -VO [pin 3] - +VO [pin 4] - AC_1 [pin 1] - AC_2 [pin 2] ### Q1 — [2N2222A](https://www.flux.ai/lcsc/2n2222a~00rk.md) - Part Type: Transistors/Thyristors/Bipolar (BJT) - JLCPCB Part Class: Extended Part - Frequency: 250MHz - Manufacturer Part Number: 2N2222A - LCSC Part Number: C118536 - Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/1809200018_ST-Semtech-2N2222A_C118536.pdf - Product Info Url: https://lcsc.com/product-detail/Transistors-NPN-PNP_2N2222_C118536.html - Compliance: RoHS - Package: TO-92-3 - Role: Relay Driver - Manufacturer Name: ST(先科) - Package or Case Code: TO-92-3_L4.9-W3.7-P1.27-L - Role Details: Transistor NPN low-side per bobina relè 5 V - Transistor Type: NPN **Pins:** - B [pin 2] - C [pin 3] - E [pin 1] ### U1 — [Nodemcu-12E ESP8266](https://www.flux.ai/jharwinbarrozo/nodemcu-12e-esp8266~5t.md) - Role: Controller - Datasheet URL: https://components101.com/development-boards/nodemcu-esp8266-pinout-features-and-datasheet - Role Details: NodeMCU WiFi per controllo termostato, web server e logica relè - Package: Module - Part Type: Microcontroller - 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~7kh.md) - Role Details: Sensore digitale ambiente per misura temperatura 5-30 C - Package: TO-92 - LCSC Part Number: C376006 - Part Type: Temperature Sensors - Role: Temperature Sensor - JLCPCB Part Class: Extended Part - Package or Case Code: TO-92-3_L4.9-W3.7-P1.27-L - Manufacturer Name: UMW(友台半导体) - Manufacturer Part Number: DS18B20 **Pins:** - DQ [pin 2] - GND [pin 1] - VDD [pin 3] ### U3 — [AP2112K-3.3TRG1](https://www.flux.ai/adrian95/ap2112k-33trg1~zlq.md) - Manufacturer Name: https://www.diodes.com/assets/Datasheets/AP2112.pdf - Part Type: Integrated Circuit - Role: Regulator - License: https://creativecommons.org/licenses/by/4.0/ - Manufacturer Part Number: AP2112K-3.3TRG1 - Datasheet URL: Diodes Incorporated - Package: SOT-25 - Role Details: LDO 5 V a 3.3 V per logica e sensore **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~0c.md) - Manufacturer Part Number: PC817 - Role: Optocoupler - Package: DIP-4 - Role Details: Isolamento galvanico tra NodeMCU e stadio pilotaggio relè - Package or Case Code: DIP-4_W7.62mm - Datasheet URL: http://www.soselectronic.cz/a_info/resource/d/pc817.pdf **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~s5](https://www.flux.ai/pierpa86/termostato-wifi-da-incasso-230vac-nodemcu~s5).* --- *Generated from [https://www.flux.ai/pierpa86/termostato-wifi-da-incasso-230vac-nodemcu~s5](https://www.flux.ai/pierpa86/termostato-wifi-da-incasso-230vac-nodemcu~s5)*