Arduino weather station

Quick info

Engine: Arduino
Programming language: C++,
Platform: Arduino
Role: Developer,
Team size: 1,
Date: Q3 2019 – duration 4 months, 4 hours per week

About

This project is made for a school assignment where our assignment was where we need to make something where we want to learn more from. That’s why I’ve chosen arduiono’s.

This weather station has 2 parts. A side station, and a main station.
The goal of the side station is to collect data and send it via a transceiver to the main station. The main station can also collect data, however it also is the receiver of the side station(s). The main station uploads the data to my PC via USB. The PC sends a JSON with the data to a PHP file hosted on a local web server and there it gets uploaded to MySQ.

I’m not sure if the data collected is 100 accurate or even true. I had no access to real weather measure equipment.

Unity app

I’ve made a prototype unity app that’s downloads the data and made it to graphs(open source API) so the user can scroll through the timeline and see more detailed graphs.

Prototype app
Prototype weather app

Code snippet:

Those code receives the data from station one and from its own.

void ReadStationOne {
  //read transceiver 1
  if(HC12_stationOne.available()){    
      String _output =  HC12_stationOne.readString();   
      
      if(_output.length() >0){
        AddData(1,_output);
      }
  } 
}

void ReadSensors() {
  sensors_event_t event;
  
  //read co2
  m_co2Value = analogRead(m_aReadmq150Pin);
  // read humidity
  dht.humidity().getEvent(&event);
  String _hum  = (String)event.relative_humidity;

  //read temps
  dht.temperature().getEvent(&event);
  String _temp =(String)event.temperature;

  //debug print
  String _data = "0, " + (String)m_co2Value + ", " + _hum + ", " + _temp;
  Serial.println("WEERSTATION:" + _data);
}