Language:
English (current) | ะ ัััะบะธะน (Russian)
This project is an autonomous outdoor weather station built around the ESP8266 (ESP-12E) microcontroller. It measures temperature, humidity, illuminance (lux), dew point, and heat index, then sends the data to ThingSpeak every 15 minutes.

โก๏ธ Key Highlights
- Solar-powered (using TP4057 and a LiPo 2000 mAh battery)
- Deep Sleep for energy efficiency (15 minutes)
- Sensors:
- HTU21D for temperature and humidity
- TSL2561 for illuminance
- Calculates dew point and heat index
- Uses AMS1117 (3.3 V) as a linear regulator (simple but not very power-efficient)
- ๐ Live data: ThingSpeak link
- ๐ We use a 3D-printed case to protect the device:
Thingiverse Model
- ESP8266 (ESP-12E) โ Wi-Fi connectivity and data transmission
- HTU21D โ temperature & humidity measurements
- TSL2561 โ illuminance measurement (lux)
- Dew Point & Heat Index โ computed from sensor data
- Data Upload to ThingSpeak โ via simple HTTP GET requests
- Solar Power โ recharges a LiPo battery through TP4057
- Deep Sleep (15 min) โ minimizes power consumption
- AMS1117 โ used between the LiPo and the ESP8266 (simple, but draws ~5โ10 mA quiescent current)
Component | Purpose |
---|---|
ESP-12E (ESP8266) | Main microcontroller with Wi-Fi |
HTU21D | Temperature & humidity sensor |
TSL2561 | Illuminance (lux) sensor |
TP4057 | LiPo charging module |
LiPo 2000 mAh | Rechargeable battery |
AMS1117 (3.3 V) | Linear regulator (simple but not the most efficient) |
5V Solar Panel | Charges the battery via TP4057 |
3D-printed enclosure | Protects the device from weather (Thingiverse design) |
Note on AMS1117: It is easy to use but has a relatively high quiescent current (5โ10 mA), which reduces battery life. For better efficiency, consider a low-dropout regulator (e.g., MCP1700) or a DC-DC converter.
HTU21D โ ESP8266
VCC -> 3.3V
GND -> GND
SDA -> GPIO4 (D2)
SCL -> GPIO5 (D1)
TSL2561 โ ESP8266
VCC -> 3.3V
GND -> GND
SDA -> GPIO4 (D2) [shared with HTU21D]
SCL -> GPIO5 (D1) [shared with HTU21D]
- Solar Panel (5V) โ TP4057 IN
- TP4057 OUT โ LiPo battery (3.7 V nominal)
- LiPo โ AMS1117 VIN
- AMS1117 VOUT โ 3.3 V to power the ESP8266
Pin | Connection |
---|---|
VCC | 3.3V (from AMS1117) |
GND | GND |
EN | 3.3V via 10kฮฉ resistor (CH_PD) |
GPIO16 | Connect to RST (for Deep Sleep) |
GPIO0 | GND during flashing, then 3.3V (via 10kฮฉ) |
GPIO2,15 | Standard ESP8266 boot configuration |
- Install Arduino IDE from the official website.
- In Arduino IDE, go to:
and add:
File > Preferences > Additional Boards Manager URLs
https://arduino.esp8266.com/stable/package_esp8266com_index.json
- Open Boards Manager (
Tools > Board > Boards Manager
), search for esp8266, and install "ESP8266 by ESP8266 Community". - Choose Generic ESP8266 Module (or NodeMCU 1.0) in the Tools > Board menu.
- ESP8266WiFi (bundled with ESP8266 platform)
- Wire (standard IยฒC library)
- Adafruit HTU21DF
- Adafruit Unified Sensor
- Adafruit TSL2561
- ESP8266HTTPClient (bundled with ESP8266 platform)
Install them via Sketch > Include Library > Manage Libraries in Arduino IDE.
- Connect ESP8266 to your PC via a USB-UART adapter (e.g., CH340, FTDI).
- Enter flashing mode:
- GPIO0 โ GND
- RESET (toggle) or power-cycle
- Now the ESP8266 is ready for programming
- Select the correct board (e.g., Generic ESP8266) and serial port in Arduino IDE.
- Upload the sketch.
- After successful flashing, disconnect GPIO0 from GND (pull it up to 3.3V), then reset the module.
The code uses Deep Sleep for power saving. The default sleep time is 15 minutes, set in microseconds:
#define SLEEP_TIME 900e6 // 15 minutes (900,000,000 ยตs)
- 1 second =
1e6
ยตs - 1 minute =
60 * 1e6
ยตs - Example: 5 minutes =
300e6
, 30 minutes =1800e6
Important: Connect GPIO16 to RST so the ESP8266 can wake from Deep Sleep.
Field | Description | Unit |
---|---|---|
Field1 | Temperature | ยฐC |
Field2 | Humidity | % |
Field3 | Illuminance | lux |
Field4 | Dew Point | ยฐC |
Field5 | Heat Index | ยฐC |
Set your Wi-Fi credentials and ThingSpeak API key in the sketch:
// Wi-Fi settings
#define STASSID "your_wifi_ssid"
#define STAPSK "your_wifi_password"
// ThingSpeak API
const char* apiKey = "your_thingspeak_api_key";
const char* server = "api.thingspeak.com";
- Using AMS1117 is straightforward, but it has a relatively high quiescent current (5โ10 mA).
- This can limit battery life in long-term operation.
- For better efficiency, use a low-quiescent-current LDO (e.g., MCP1700, HT7333) or a DC-DC converter.
- Add a UV sensor (e.g., VEML6075)
- Integrate MQTT for Home Assistant or Node-RED
- Create a local web interface for real-time data visualization
This project is released under the MIT License. Feel free to use, modify, and distribute!
If you have any questions or suggestions, open an Issue.