Skip to content

Latest commit

 

History

History
92 lines (78 loc) · 3.71 KB

README.md

File metadata and controls

92 lines (78 loc) · 3.71 KB

arduino-weather-station

About

This sketch measures temperatures and pressure. Measured results are printed on LCD screen and can be sent to remote HTTP server.

Setup

Board

Classic Arduino UNO board with Grove Base Shield for Grove extensions.
arduino uno
Image source: https://store.arduino.cc

Display

16x2 LCD. In this project it is used to displays outside / inside temperatures and pressure hPa.
LCD RGB
Library
LCD
Image source: https://wiki.seeedstudio.com

Sensors

Temperature

Used to measure outside temperature. On analogue pin 0.
Grove-Temperature-Sensor
Library
temp sensor
Image source: https://wiki.seeedstudio.com

Barometer and temperature

Used to measure inside temperature and pressure.
Barometric-Pressure-Sensor-DPS310
Library
pressure sensor
Image source: https://wiki.seeedstudio.com

Time Clock

Used to store real time of measurements.
Grove-RTC
Library
time clock
Image source: https://wiki.seeedstudio.com

WiFi

Wireless network. RX on pin 2, TX on pin 3.
Grove-UART-WiFi-V2-ESP8285
Library
wifi
Image source: https://wiki.seeedstudio.com

End result

Code

Configuration

This code requires src/weatherStation/secrets.h file to be created with following content.

#define SECRET_SSID "your wifi ssid"
#define SECRET_PASS "your wifi password"

#define SRV_CONNECT_HOST "IP or DNS name of remote server"
#define SRV_CONNECT_PORT (int) 80 // or other port that is used
#define SRV_REQ_HOST "IP or DNS name of remote server"
#define SRV_URI "URI path on which POST request with weather report is sent"

Example

#define SECRET_SSID "mynet"
#define SECRET_PASS "verysecret"

#define SRV_CONNECT_HOST "myapp.azurewebsites.net"
#define SRV_CONNECT_PORT (int) 80
#define SRV_REQ_HOST "myapp.azurewebsites.net"
#define SRV_URI "/api/post-endpoint?code=lfddfnoren34vc"

HTTP server implementation

Server collecting the reports, should expose POST endpoint accepting following request format.

Post request body

Format

date time UTC,outside temp,inside temp,pressure

Example

20230421 203635,12.38,21.95,987.82

Future development

Light

Measure light sensitivity
Light-Sensor