====== Weatherbox Data Specification ====== This page contains the data specification versions for the weatherbox. ====== 296 Basic Schema ====== This is a simplified schema that is to be used by EE 296 teams for Spring 2016. In the interests of time, you should consider getting your weatherbox to work with this schema first and then update your firmware later to tackle the full schema. typedef struct { uint16_t schema; // Schema Identification Number uint16_t address; // Address of the particular node uint32_t uptime_ms; // Time since start of program uint16_t batt_mv; // Battery Voltage (in milli volts) uint16_t panel_mv; // Panel Voltage (in milli volts) uint32_t bmp185_press_pa; // Pressure Value (in pascals) int16_t bmp185_temp_decic; // Temperature Value (in celsius) uint16_t humidity_centi_pct; uint16_t solar_irr_w_m2; } schema_296; ^ Name ^ Size (Bytes) ^ Description ^ | schema | 16 | Packet schema version. You should set this in software before you send the packet - this field is used by the server to identify your packet number. For the 296 weatherbox, set this to 296. | | address | 16 | The address of your particular node. This address is assigned by the lab and is unique to every weatherbox. | | uptime_ms | 32 | The uptime in ms. This shows how long the microcontroller has been on for. | | batt_mv | 16 | Battery voltage in millivolts. This is used for diagnostic purposes. | | panel_mv | 16 | Panel voltage in miliivolts. This allows us to monitor the voltage of the solar panel. | | press_pa | 32 | Pressure in pascals - uses the (bmp085). | | temp_decic | 16 | Temperature in deci-celsius - uses the (bmp185). | | humid_centi_pct | 16 | Humidity in centi percents. | | solar_irr_w_m2 | 16 | Solar Irradiance. Taken from the apogee reading.. | This packet is simplified from the original weatherbox specification. In this specification there are no varying sample rates for each data type - one packet gives you one sample point for each data type. ===== Converting from volts to w_m2 ===== Make sure you convert your voltage reading from the apogee sensor to watts per meter squared ($w/m^2$). We're measuring solar irradiance: https://en.wikipedia.org/wiki/Irradiance You can find the conversion factor on the apogee website for your specific sensor, but here is what it should be: $Conversion Factor = (4.0mV) / (1 W/m^2)$ Therefore this is the formula you can use to convert units of $V$ to units of $w/m^2$. $X_{sensor} (W/m^2) = V_{sensor} / (0.004V)$ ====== EE 296 Full Schema ====== This schema is the same as the EE 296 Basic Schema but contains more samples for the irradiance sensor as well as the battery voltage and panel voltage. typedef struct { uint16_t schema; // Schema Identification Number uint16_t address; // Address of the particular node uint32_t uptime_ms; // Time since start of program uint16_t batt_mv[6]; // Battery Voltage (in milli volts) uint16_t panel_mv[6]; // Panel Voltage (in milli volts) uint32_t bmp185_press_pa; // Pressure Value (in pascals) int16_t bmp185_temp_decic; // Temperature Value (in celsius) uint16_t humidity_centi_pct; uint16_t solar_irr_w_m2[20]; } schema_296_full; Additional Comments: * These numbers are all in reference to a minute - since batt_mv has 15 entries, there will be 15 samples per minute. These datapoints should be spread evenly through the minute. For example, batt_mv will be sampled every 60/15 or every 4 seconds. * Single data types are allowed to be sampled at any point during the minute, so long as it is consistent across all data points. * Your sampling pattern should be consistent for every minute. * For this schema, you should set the schema number in your packet to 297 instead of 296. ====== Schema v1 ====== This the initial data format for the weatherbox. You can see the data packet represented as a struct in the C programming language. typedef struct { uint16_t schema; uint16_t address; // Address of Arduino uint32_t uptime_ms; // Time since start of program uint8_t n; // number of data points in packet 0..30 uint16_t batt_mv[6]; // Battery Voltage (in milli volts) uint16_t panel_mv[6]; // Panel Voltage (in milli volts) uint32_t bmp085_press_pa; // Pressure Value (in pascals) int16_t bmp085_temp_decic; // Temperature Value (in celsius) uint16_t humidity_centi_pct; uint16_t apogee_w_m2[20]; } schema_1; ^ Name ^ Size (Bytes) ^ Description ^ | Schema | 16 | Schema version | | Address | 16 | Address number of the node | | Uptime | 32 | Uptime in milliseconds | | Data Points | 8 | Number of data points | | Battery Voltage | 16 | Battery voltage in millivolts | | Panel Voltage | 16 | Panel voltage in miliivolts | | Pressure | 32 | Pressure in pascals | | Temperature | 16 | Temperature in celsius | | Humidity | 16 | Humidity | | Solar Irridance | 16 | | ====== Schema v3 ====== This is the packet used for apple. typedef struct { uint16_t schema; uint16_t address; // Address of Arduino uint8_t overflow_num; // Number of times millis overflowed // (happens ~every 49 days) uint32_t uptime_ms; // Time since start of program uint8_t n; // number of data points in packet 0..30 uint16_t batt_mv[6]; // Battery Voltage (in milli volts) uint16_t panel_mv[6]; // Panel Voltage (in milli volts) uint32_t bmp085_press_pa; // Pressure Value (in pascals) int16_t bmp085_temp_decic; // Temperature Value (in celsius) uint16_t humidity_centi_pct; uint16_t apogee_w_m2[20]; } schema_3; ====== Unified Packet Schema ====== // Schema Number 5 // Fields that are unimplemented should be set to 0 This schema is currently in draft. typedef struct { uint16_t schema; // Schema Identification Number uint16_t address; // Address of the particular node uint32_t uptime_ms; // Time since start of program float batt_mv; // Battery Voltage (in milli volts) float panel_mv; // Panel Voltage (in milli volts) float bmp185_press_pa; // Pressure Value (in pascals) float bmp185_temp_decic; // Temperature Value (in celsius) float humidity_centi_pct; float solar_irr_w_m2; } schema_unified; // Total bytes to aim for under: 84