📜 ⬆️ ⬇️

Weather Station on Arduino

The weather station is designed primarily for monitoring the weather, viewing the current temperature, humidity and atmospheric pressure. The thing is very convenient for fishermen. I decided to make my weather station based on the Arduino, but with the data displayed on the mobile phone.

image

The principle of the application - we run on the phone with the android OS, connect to the arduino board via bluetooth and, clicking on the icons, we get the display of various data.

The principle of the weather station is simple. When receiving from the phone 1, we poll the DS18B20 temperature sensor, which is located on the street and send data to the phone, upon receipt 2, we poll the DS18B20 temperature sensor, which is located in the room and send the data to the phone. When receiving 3, we poll the BMP085 sensor, and when receiving 4 - we poll the humidity sensor and also send data.
')


Immediately answer the question "why the display of data on a mobile phone?". It's more convenient for me, especially since I save on the purchase of the display, on the purchase of buttons and the internal memory of the microcontroller. Laziness is still the engine of progress.

Screenshots from the mobile phone screen
image

Temperature measurement outside in degrees Celsius:

image

Measurement of room temperature in degrees Celsius:

image

Measurement of atmospheric pressure in the street in mm. Hg Art .:

image

Measurement of air humidity in%


And now, after a short review of the work, let us turn to the technical part of the project.

Sensor wiring diagrams
Connection diagram of temperature sensors DS18B20

imageimage

Temperature sensors must be connected in parallel.

BMP085 sensor wiring diagram:

image

DHT11 Sensor Connection Diagram:

image

Connection diagram of the bluetooth module HC-05:

image


After successful connection of all sensors we load the sketch,

Sketch
#include <OneWire.h> #include <DallasTemperature.h> #include <Wire.h> #include <BMP085.h> #include <DHT.h> #include <DS1307.h> #include <EEPROM.h> #define ONE_WIRE_BUS 4 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); DeviceAddress Thermometer1 = { 0x28, 0x00, 0x54, 0xB6, 0x04, 0x00, 0x00, 0x92 }; DeviceAddress Thermometer3 = { 0x28, 0x94, 0xAC, 0xDF, 0x02, 0x00, 0x00, 0xB5 }; BMP085 dps = BMP085(); long Temperature = 0, Pressure = 0, Altitude = 0; DHT dht(8, DHT11); char incomingByte; int x=0; void setup() { sensors.begin(); sensors.setResolution(Thermometer1, 10); sensors.setResolution(Thermometer3, 10); Wire.begin(); dps.init(MODE_ULTRA_HIGHRES, 21000, true); dht.begin(); Serial.begin(9600); } void printTemperature(DeviceAddress deviceAddress) { float tempC = sensors.getTempC(deviceAddress); Serial.println(tempC,1); } void loop(){ sensors.requestTemperatures(); dps.getPressure(&Pressure); int h = dht.readHumidity(); float t = dht.readTemperature(); if (Serial.available() > 0) { incomingByte = Serial.read(); if(incomingByte == '1') { x=2; } if(incomingByte == '2') { x=1; } if(incomingByte == '3') { x=3; } if(incomingByte == '4') { x=4; } } delay(100); switch (x) { case 1: printTemperature(Thermometer1); break; case 2: printTemperature(Thermometer3); break; case 3: Serial.println(Pressure/133.3,1); break; case 4: Serial.println(h); break; } } 



WSAB phone application works on OS Android 2.3 and higher, download WSAB .

List of required components and links to sellers in China


Source of the program and article on the creation of programs for android phone

All comments and suggestions are waiting in the comments.

Source: https://habr.com/ru/post/254465/


All Articles