meichthys / window_sensors

Insanely Cheap Wireless Window/Door Sensors
MIT License
75 stars 2 forks source link

Theoretical v2 with Integrated Charging Circuit (TP4056) #6

Open dskvr opened 11 months ago

dskvr commented 11 months ago

Built a window sensor, everything worked well, started thinking about a v2. Here is what I came up with, take it or leave it.

Changes

  1. Adds a TP4056 (USB-C here, could also be Micro USB) for charging (~$0.27)
  2. Adds a AMS1117-3.3 3.3v voltage regulator between the battery and the ESP8266MOD (~$0.04)

Notes

(v2.a) ASCII Schematic

+5V
 |
[USB1]
 |
 |
[U1] TP4056
 |   |
 |   +-----> [BATT1] 3.7V Li-ion
 |         |
 |         |
[U2] AMS1117-3.3
 |   |   |
 |   |   +----||---- GND   (C1: 10uF)
 |   |   |
 |   |   +----||---- GND   (C2: 0.1uF)
 |   |
 |   |
[U3] ESP8266MOD
 |   |   |
 |   |   +----/ /---- GND   (SW1: Reed Switch)
 |   |
 |   +---------||--------- (W1: Copper Wire/Antenna)
 |
 GND

Legend:

[USB1]: USB-C for charging [U1]: TP4056 Charger Module [BATT1]: 3.7Vli-ion Battery [U2]: AMS1117-3.3 Voltage Regulator

||: Capacitor / /: Reed Switch

(v2.a) Weblist

* Integrated Window Sensor and TP4056 (USB-C) Charger Circuit with ESP8266MOD powered by a 3.7V Li-ion Battery

* USB-C for charging
USB1 5V GND USB_TYPE

* TP4056 Charger Module
U1 VIN GND BAT BAT TP4056

* Connect USB 5V to TP4056 VIN
R_USB 5V U1:VIN 0

* 3.7V Li-ion Battery
BATT1 U1:BAT GND BATTERY_TYPE

* AMS1117-3.3 Voltage Regulator
U2 IN OUT GND AMS1117-3.3

* Connect Battery to AMS1117 Input
R_BATT BATT1 U2:IN 0

* Decoupling capacitors for AMS1117
C1 U2:OUT GND 10uF
C2 U2:OUT GND 0.1uF

* ESP8266MOD
U3 VCC GND EN IO15 ESP8266MOD

* Connect AMS1117 Output to ESP8266 VCC
R_VCC U2:OUT U3:VCC 0

* Connect ESP8266 EN to VCC
R_EN U3:EN U3:VCC 0

* Connect ESP8266 IO15 to GND
R_IO15 U3:IO15 GND 0

* Reed Switch
SW1 U3:GND REED_NODE REED_SWITCH

* Copper wire (antenna)
W1 U3:VCC ANTENNA_NODE WIRE

* Model Definitions (Placeholder)
.model USB_TYPE USB
.model TP4056 TP4056_TYPE
.model BATTERY_TYPE BATTERY
.model AMS1117-3.3 AMS1117_TYPE
.model ESP8266MOD ESP_TYPE
.model REED_SWITCH SWITCH
.model WIRE WIRE_TYPE

.end
meichthys commented 11 months ago

Hey, glad to year you were able to build one! Thanks for your input on a v2 as well. Charging has been on my mind too - currently i just remove the batteries and just connect them via alligator clips to a rc car battery charger, but a better defined process would indeed be preferred.

My preference would be to keep the design of the box the same. I designed the battery to be easily accessible - so the workflow would be: