Skip to content

gdmn/esp8266door

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esp8266door

pic1

pic2

Needed boards and libraries

How it works

Project uses ATTiny45 (although it should fit into 25). ATTiny monitors one pin for the change. It is important to pull that pin HIGH or LOW depending on the used sensor. ATTiny can detect any change (raising and falling) using pin change interrupt.

When the change is detected, pin "client power" goes HIGH. The client (ESP8266 in this case) runs its code. ATTiny waits for the client blinking every second (if LED is connected to "status led" pin). When processing is finished, ESP8266 sends LOW state to the "client callback" pin on the ATTiny. ATTiny changes "client power" pin to LOW, effectively powering down ESP8266.

Pin names are in sketches.

Remember about pull-up and pull-down resistors. I used 10K.

Configuration

If there is no configuration yet, ESP8266 turns itself in Access Point mode. The pin "configuration portal" can be pulled down to force Access Point mode.

The project uses WiFiSettings by Juerd:

WiFiSettings example

Additional configuration options (not present in the screenshot):

  • alarm_text - the text to be sent when pin changes state. Default: "⚠️ Alarm! ⚡ ${VCC} volts. 📶 ${RSSI} ${SSID}, ${IP}, ${MAC}.",
  • telegram_bot_token - token of your telegram bot,
  • telegram_user_id - your telegram user id.

alarm_text configuration

Following parts of the text will be replaced before the message is sent:

  • ${VCC} - internal voltage, when a regulator is used, will be 3V most of the time,
  • ${RSSI} - network signal strength, 100 % is the strongest signal, 0 % - the weakest,
  • ${MAC} - mac address,
  • ${SSID} - network name,
  • ${IP} - local IP address.

How to add your own telegram bot and get the token

  1. Install Telegram on local PC or your phone: from Play Store or from F-Droid.
  2. Talk to @BotFather to create your bot. Telegram bot manual can be found here.
  3. Note the token to access the HTTP API.
  4. Do not forget to start conversation with your newly created bot!

How to find telegram user id

  1. Talk to @userinfobot.
  2. The bot will give you your user id.

Battery usage

One 18650 battery lasted for 186 days. During that time 1130 messages have been sent. There were 4 warnings about low voltage before battery was removed. Voltage at the end of test was 3.41, charger reported 2366mAh to 4.2V.

Average use: 2366/186 = 12.72mA daily; 2366/1130 = 2.1mA per message.

Releases

No releases published

Packages

No packages published

Languages