Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrejicd/thingspeak-weather-station
ThingSpeak Weather Station with LCD Display
https://github.com/andrejicd/thingspeak-weather-station
arduino-ide bme280 esp32 esp8266 esp8266-projects iot-dashboards klimerko lcd16x2 pms7003 thingspeak weather-station
Last synced: 9 days ago
JSON representation
ThingSpeak Weather Station with LCD Display
- Host: GitHub
- URL: https://github.com/andrejicd/thingspeak-weather-station
- Owner: andrejicd
- Created: 2024-12-24T08:06:38.000Z (17 days ago)
- Default Branch: main
- Last Pushed: 2025-01-01T13:20:25.000Z (9 days ago)
- Last Synced: 2025-01-01T14:21:39.461Z (9 days ago)
- Topics: arduino-ide, bme280, esp32, esp8266, esp8266-projects, iot-dashboards, klimerko, lcd16x2, pms7003, thingspeak, weather-station
- Language: C++
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ThingSpeak Weather Station with LCD Display
This project implements a simple weather station that reads data from a ThingSpeak channel and displays it on an LCD screen. It uses an ESP8266/ESP32 microcontroller, a ThingSpeak account, and an I2C LCD display.
## Features
* Reads weather data (temperature, humidity, etc.) from a ThingSpeak channel.
* Displays the data on an I2C LCD screen.
* Controls LCD backlight based on time of day.
* **LCD blinking based on PM2.5 value (field4).**
* Handles network connection and ThingSpeak communication errors.## Hardware Requirements
* ESP8266 or ESP32 microcontroller
* I2C LCD display (e.g., 16x2 or 20x4)
* Connecting wires
* (Optional) Breadboard## Software Requirements
* Arduino IDE
* Required Libraries (install via Arduino Library Manager):
* WiFi
* ThingSpeak
* LCDI2C\_Multilingual
* WiFiUdp
* NTPClient
* TimeLib## Setup
1. **ThingSpeak Setup:**
* Create a ThingSpeak account at [thingspeak.com](https://thingspeak.com).
* Create a new channel and add fields for the weather data you want to read (e.g., Temperature, Humidity, Wind Speed, **PM2.5**).
* Note down the Channel ID.2. **Arduino IDE Setup:**
* Install the required libraries as listed in the Software Requirements.3. **Code Configuration:**
* Create a file named `secrets.h` in the same directory as your `.ino` file.
* Add your Wi-Fi credentials and ThingSpeak Channel ID to `secrets.h`:```c++
#define SECRET_SSID "MySSID" // replace MySSID with your WiFi network name
#define SECRET_PASS "MyPassword" // replace MyPassword with your WiFi password#define SECRET_CH_ID_WEATHER_STATION 1234567 //MathWorks weather station
#define BACKLIGHT_ON_HOUR * // Enter the hours to start
#define BACKLIGHT_ON_MINUTE * // Enter minutes to start
#define BACKLIGHT_OFF_HOUR * // Enter the hours for the end
#define BACKLIGHT_OFF_MINUTE * // Enter the minutes to the end
#endif
```* Open the `.ino` file in the Arduino IDE.
* Adjust the LCD address (`0x27` in the code) if necessary. You can use an I2C scanner sketch to find the correct address.
* Upload the code to your ESP8266/ESP32 board.4. **Wiring:**
* Connect the LCD to the ESP8266/ESP32 using I2C (SDA, SCL, VCC, GND). Consult your LCD's datasheet for pinouts.## Usage
After uploading the code, the weather data from your ThingSpeak channel will be displayed on the LCD screen. The backlight will be automatically turned off during specified hours (currently 22:30 to 6:15).
**The LCD will blink based on the PM2.5 value (field4) retrieved from ThingSpeak:**
* **field4 > 150:** Very frequent blinking (severe air quality).
* **field4 > 100:** Moderate blinking (unhealthy air quality).
* **field4 > 50:** Less frequent blinking (moderate air quality).
* **field4 <= 50:** No blinking (good air quality).## Troubleshooting
* **LCD not displaying anything:** Check the wiring and the I2C address.
* **Not connecting to Wi-Fi:** Double-check your Wi-Fi credentials in `secrets.h`.
* **Error reading ThingSpeak channel:** Verify the Channel ID in `secrets.h` and ensure the channel is public or you are using the correct Read API Key (if needed).## Credits
This project is based on examples and libraries available online.