This is the first generation of my Arduino based mini-weather station with Wi-Fi connection, which is able to post data publicly online using the ThingSpeak platform.
The weather station collects the following data related to the weather and environment using different sensors:
- Atmospheric pressure
- Light intensity
- UV index
- Dust concentration
The aim is to make a small and simple weather station, using open hardware.
Let's get started and have fun!Electronic components
You won't need specific tools for the assembly of this project. All the components can be found online on your favourite e-commerce store.
The circuit is powered by the USB port (connected to a computer or a ordinary phone charger), but you may also add an external DC power supply or a battery connected to the Arduino power jack.
A case for the weather station circuit is out of the scope of this project.Connecting the Parts
Connect all the components according to the schematic. You'll need some jumper wires to connect each sensor to the breadboard. You might use a protoshield (for a more compact circuit), an ordinary breadboard, or design you own Arduino shield.
Plug the USB cable to the Arduino Uno board and proceed to the next step.Code
Assuming you have already installed the latest Arduino IDE, download and install the following libraries:
For instructions on how to add the libraries to Arduino IDE, check the following Arduino guide.
Download Arduino code (
weatherBox.ino) included in the code section. Replace
XXXXX by your WiFi router SSID,
YYYYY by router password, and
ZZZZZ by your ThingSpeak channel write API key (see how to obtain it on next step).
Connect the Arduino board to your computer USB port and upload the code.ThingSpeak configuration
- Create a ThingSpeak account
- Create a new Channel
Specify the name and description of your weather station. Assign the following channels and save the channel:
- channel 1 = light
- channel 2 = humidity
- channel 3 = temperature (from DHT22)
- channel 4 = UV index
- channel 5 = dust concentration
- channel 6 = pressure
- channel 7 = temperature (from BMP085)
Copy API write key. It is used in the previous step in Arduino code. When the station is turned on, sensor values will be uploaded to the channel periodically. You may configure public and private visualizations of each variable.
Example of a public channel: https://thingspeak.com/channels/35540Using Android App
You'll be able to visualize weather station data in any browser. But you might also check it on you Android based smart phone and visualize it whenever you want.
- Download and install ThingsView app from Google Play store on your Android device
- On the app, insert your channel ID number and click add. You'll find the ID on your ThingSpeak channel configuration
- The current values of each variable will be displayed in a graph