A Matlab class for communicating with the Davis Vantage Pro2 (cabled)
The class uses the serial port (USB) to communicate with the weather station, it can read indoor as well as outdoor sensors.
The calculations and serial protocols are as mentioned in This Datasheet
To set up the console, see Console Manual
- If the weather station is connected to the EnviroMonitor Gateway (separate big white solar panel box), disconnect it. Connect the outside sensors to the console. The EnviroMonitor is unnecessary.
- The console requires 2 USB connections; one for data transmission, and the other for power.
- To initiate the connection, use:
W = inst.DavisWeather
- This will automatically call the "connect" function, that searches the serial ports and tries to find the weather station.
- Make sure no other serial ports are open or being used by Matlab, as they may interfere and cause errors.
- The weather data is stored in the class properties. They will update each time the class is called ('W') no more than once a minute, and they will display all the relevant data.
- To force an update, use:
W.getData
What weather data does the class display?
InsideTemperature % Temperature of the console in C
InsideHumidity % Humidity of the console in %
Barometer % Barometric pressure in Bar
OutsideTemperature % Outside temperature in C
OutsideHumidity % Outside humidity in %
WindSpeed % Current wind speed in km/h
WindDirection % Wind direction in angles, 360 is north
Rain % Rain rate in mm
SolarRadiation % Solar radiation in watt per meter squared
- Note that this is only a portion of all the data that the weather station gives, and more data could be implemented if needed.
Start data logging:
W.logData
- This function will read the weather station sensor data every
W.Period
seconds, and write it to a .csv table inW.Datapath
- CRC not implemented (Altough the console checks for it)
- The outdoor humidity and temperature sensors do not agree with the indoor ones! Sensors should be calibrated