ESP8266 as Window Sensor with years of battery life

Published at : 22 Dec 2025

Buy me a coffee:
https://buymeacoffee.com/makermeik
https://paypal.me/MeikDangmann
https://www.patreon.com/KnowledgeDoubles

Meanwhile the viewer "gadjet" has optimized and minimized the PCB.
Check out his great website and project on Github:
https://gadjetsblog.blogspot.com/2022/03/the-many-versions-of-wireles-door.html
https://github.com/gadjet/Window-Door-sensor-Version-5



Project-Idea by Michael Dworkin:
https://esp8266-server.de/Reedkontakt.html


Links:



Code, Battery-Spreadsheet, KiCAD- and CircuitJS-Files:
https://github.com/MakerMeik/Window-Sensor


3D-Model of the Case on Thingiverse:
https://www.thingiverse.com/thing:5019573

KiCAD:
https://www.kicad.org/
https://www.thingiverse.com/thing:5019573

CircuitJS:
http://www.falstad.com/circuit/

Andreas Spiess: How to install the IOT-Stack on a Raspberry Pi:
https://www.youtube.com/watch?v=a6mjt8tWUws

Required Components:

1x ESP-12F
1x 1000 uF Electrolytic Capacitor
2x 100 nF Capacitor
4x 10k Resistor (SMD 0805)
1x 1M Resistor (SMD 0805)
2x Switch Buttons (SMD 0805)
1x HT7333 (SMD)
1x Pin Header
1x Reed Switch NO (normally open)
1x 74HC86 (THT)
1x TP4056
1x Li-Ion 18650
1x Magnet

0:00 Intro
1:07 Requirements

1:27 The idea
3:06 ESP8266 basics
3:57 Simulation in CircuitJS
6:32 Circuit design in KiCAD
9:04 SMD-Components
9:58 PCB-Design in KiCAD
11:34 Assembly and SMD-soldering
13:07 Programming and software
13:39 Test run and current consumption
14:59 Housing and installation
16:38 Improvement ideas




Songs:
"8-bit-Laserstrahl" by betatronik (CC BY-NC-SA)
"Auf Dem Wind (calm)" by betatronik (CC BY-NC-SA)
"Old River Boat" by Lobo Loco (CC BY-NC-SA)
"Long Story" by Sergey Cheremisinov (CC BY-NC)
"Make-New" by Ketsa (CC BY-NC-ND)
"Salt Lake Swerve - Chillout Remix" by Maarten Schellekens (CC BY-NC)
"Salt Lake Swerve - Chillout Remix" by Maarten Schellekens (CC BY-NC)
"Hachimantai Snow" by Maarten Schellekens (CC BY-NC)
"Just Wondering" by Maarten Schellekens (CC BY-NC)
"Poor Boy" by Pedro Santiago (CC BY-NC-SA)
"Tuesday Night - Radio Edit" by Maarten Schellekens (CC BY-NC)
"Deep" by Bio Unit (CC BY-NC-SA)
"D2" by Maarten Schellekens (CC BY-NC)

Photos/Videoclips:
Alexas_Fotos (Pixabay License)
Grieslightnin (Pixabay License)
Vincente.niclos (CC BY-SA)
FindingFootage (pixabay license)