Components and supplies
Arduino Nano Every
WS2812 Addressable LED Strip
SparkFun Atmospheric Sensor Breakout - BME280
DS3231MPMB1 Peripheral Module
Tools and machines
3D Printer (generic)
Project description
Code
Gnome Weather Forecaster
arduino
Open this sketch in your Arduino IDE and make sure you have downloaded all the libraries needed.
1#include <Wire.h> 2#include <Adafruit_Sensor.h> 3#include <Adafruit_BME280.h> 4#include 5 <Adafruit_NeoPixel.h> 6#include "RTClib.h" 7 8#define SEALEVELPRESSURE_HPA 9 (1013.25) 10#define LED_PIN 7 11#define NumLEDs 8 12 13RTC_DS3231 rtc; // 14 initialise the RTC DS3231 15Adafruit_BME280 bme; // initialise the BME280 sensor 16Adafruit_NeoPixel 17 strip(NumLEDs, LED_PIN, NEO_GRB + NEO_KHZ800); 18 19unsigned long delayTime; // 20 refresh rate for the readings 21int t_hour = 0; 22int t_minute = 0; 23int oldpos 24 = 0; //Variables to scroll the LED bar 25int newpos = 0; 26 27 28int pressureArray[10] 29 = {0}; // here we store the pressure readings 30byte counter = 0; 31byte delta_time 32 = 0; 33int Z = 0; 34 35char tStr[21]; 36char pStr[22]; 37char hStr[20]; 38char 39 pseaStr[26]; 40char timeStr[6]; 41char dateStr[12]; 42char zambretti[10] = "N/A"; 43char 44 pressureHistory[57]; 45char pressureHistory2[57]; 46 47int temperature; 48int 49 humidity; 50int pressure; 51int altitude = 355; // Here you should put the REAL 52 altitude of the iGnome 53 54 55void setup() { 56 bool status; 57 Serial.begin(57600); 58 // default settings 59 Serial.println("Starting measurements"); 60 if (! 61 rtc.begin()) { 62 Serial.println("Couldn't find RTC"); 63 while (1); 64 65 } 66 67 if (rtc.lostPower()) { 68 Serial.println("RTC lost power, lets 69 set the time!"); 70 // following line sets the RTC to the date & time this 71 sketch was compiled 72 rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); 73 74 75 } 76 status = bme.begin(); 77 if (!status) { 78 while (1); 79 } 80 81 delayTime = 20000; 82 83 strip.begin(); // INITIALISE the LED strip 84 object 85 strip.show(); // Turn OFF all pixels after init 86 strip.setBrightness(100); 87 // Set BRIGHTNESS to about 2/5 (max = 255) 88} 89 90 91void loop() { 92 93 94 temperature = (int)bme.readTemperature(); 95 humidity = (int)bme.readHumidity(); 96 97 pressure = (int)(bme.readPressure() / 100.0F); 98 99 // Let's see the reading 100 that will determine the forecast 101 102 Serial.print("Measured altitude "); 103 104 Serial.println((int)bme.readAltitude(SEALEVELPRESSURE_HPA)); 105 106 int seapressure 107 = station2sealevel(pressure, altitude, temperature); 108 109 DateTime now = rtc.now(); 110 111 int t_hour2 = now.hour(); 112 int t_minute2 = now.minute(); 113 114 115 if (t_hour2 116 != t_hour or t_minute2 != t_minute) { 117 delta_time++; 118 if (delta_time 119 > 10) { // every minute we increment delta_time, then every 10 minutes 120 delta_time 121 = 0; // we store the value in the array 122 123 if (counter == 10) 124 // if we read 10 values and filled up the array, we shift the array content 125 126 { 127 for (int i = 0; i < 9; i++) { // we shift the array one position 128 to the left 129 pressureArray[i] = pressureArray[i + 1]; 130 } 131 132 pressureArray[counter - 1] = seapressure; 133 } 134 else { // 135 this code fills up the pressure array value by value until is filled up 136 pressureArray[counter] 137 = seapressure; 138 counter++; 139 } 140 } 141 142 Z = calc_zambretti((pressureArray[9] 143 + pressureArray[8] + pressureArray[7]) / 3, (pressureArray[0] + pressureArray[1] 144 + pressureArray[2]) / 3, now.month()); 145 146// From here is just for debug purposes 147 on the serial monitor 148 149 sprintf(zambretti, "Z=%d", Z); 150 sprintf(tStr, 151 "%d C", temperature); 152 sprintf(hStr, "%d %%", humidity); 153 sprintf(pStr, 154 "%d hPa", pressure); 155 sprintf(pseaStr, "%d hPa", seapressure); 156 sprintf(dateStr, 157 "%02d.%02d.%d", now.day(), now.month(), now.year()); 158 sprintf(timeStr, "%02d:%02d", 159 now.hour(), now.minute()); 160 sprintf(pressureHistory, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,", 161 pressureArray[0], pressureArray[1], pressureArray[2], 162 pressureArray[3], 163 pressureArray[4], pressureArray[5], pressureArray[6], pressureArray[7], pressureArray[8], 164 pressureArray[9]); 165 166 Serial.println(zambretti); 167 Serial.println(tStr); 168 169 Serial.println(hStr); 170 Serial.println(pStr); 171 Serial.println(pseaStr); 172 173 Serial.println(dateStr); 174 Serial.println(timeStr); 175 Serial.println(pressureHistory); 176 177 Serial.println(pressureHistory2); 178 179// END of testing purposes 180 181 182 StripScroll(); // advance the LED colors in the strip preparing for the new 183 entry 184 185 if (pressureArray[9] > 0 and pressureArray[0] > 0) { 186 if 187 (pressureArray[9] + pressureArray[8] + pressureArray[7] - pressureArray[0] - pressureArray[1] 188 - pressureArray[2] >= 3) { 189 //RAISING 190 Serial.println("Raising"); 191 192 if (Z < 3) { 193 Serial.println("Sunny"); 194 strip.setPixelColor(0, 195 255, 127, 0); 196 } 197 else if (Z >= 3 and Z <= 9) { 198 Serial.println("Sunny 199 Cloudy"); 200 strip.setPixelColor(0, 0, 255, 255); 201 } 202 else 203 if (Z > 9 and Z <= 17) { 204 Serial.println("Cloudy"); 205 strip.setPixelColor(0, 206 127, 0, 255); 207 } 208 else if (Z > 17) { 209 Serial.println("Rainy"); 210 211 strip.setPixelColor(0, 255, 0, 127); 212 } 213 } 214 215 else 216 if (pressureArray[0] + pressureArray[1] + pressureArray[2] - pressureArray[9] - 217 pressureArray[8] - pressureArray[7] >= 3) { 218 //FALLING 219 Serial.println("Falling"); 220 221 if (Z < 4) { 222 Serial.println("Sunny"); 223 strip.setPixelColor(0, 224 255, 127, 0); 225 } 226 else if (Z >= 4 and Z < 14) { 227 Serial.println("Sunny 228 Cloudy"); 229 strip.setPixelColor(0, 0, 255, 255); 230 } 231 else 232 if (Z >= 14 and Z < 19) { 233 Serial.println("Worsening"); 234 strip.setPixelColor(0, 235 192, 0, 255); 236 } 237 else if (Z >= 19 and Z < 21) { 238 Serial.println("Cloudy"); 239 240 strip.setPixelColor(0, 127, 0, 255); 241 } 242 else if (Z 243 >= 21) { 244 Serial.println("Rainy"); 245 strip.setPixelColor(0, 246 255, 0, 127); 247 } 248 } 249 else { 250 //STEADY 251 Serial.println("Steady"); 252 253 if (Z < 5) { 254 Serial.println("Sunny"); 255 strip.setPixelColor(0, 256 255, 127, 0); 257 } 258 else if (Z >= 5 and Z <= 11) { 259 Serial.println("Sunny 260 Cloudy"); 261 strip.setPixelColor(0, 0, 255, 255); 262 } 263 else 264 if (Z > 11 and Z < 14) { 265 Serial.println("Cloudy"); 266 strip.setPixelColor(0, 267 127, 0, 255); 268 } 269 else if (Z >= 14 and Z < 19) { 270 Serial.println("Worsening"); 271 272 strip.setPixelColor(0, 192, 0, 255); 273 } 274 else if (Z 275 >= 19) { 276 Serial.println("Rainy"); 277 strip.setPixelColor(0, 278 255, 0, 127); 279 } 280 } 281 } 282 else { 283 if (seapressure 284 < 1005) { 285 Serial.println("Rainy"); 286 strip.setPixelColor(0, 287 255, 0, 127); 288 } 289 else if (seapressure >= 1005 and seapressure <= 290 1015) { 291 Serial.println("Cloudy"); 292 strip.setPixelColor(0, 293 127, 0, 255); 294 } 295 else if (seapressure > 1015 and seapressure < 296 1025) { 297 Serial.println("Sunny Cloudy"); 298 strip.setPixelColor(0, 299 0, 255, 255); 300 } 301 else { 302 Serial.println("Rainy"); 303 304 strip.setPixelColor(0, 255, 0, 127); 305 } 306 } 307 308 t_hour 309 = t_hour2; 310 t_minute = t_minute2; 311 312 } 313 strip.show(); 314 delay(delayTime); 315 316} 317 318 319int 320 calc_zambretti(int curr_pressure, int prev_pressure, int mon) { 321 if (curr_pressure 322 < prev_pressure) { 323 //FALLING 324 if (mon >= 4 and mon <= 9) 325 //summer 326 327 { 328 if (curr_pressure >= 1030) 329 return 2; 330 else if 331 (curr_pressure >= 1020 and curr_pressure < 1030) 332 return 8; 333 else 334 if (curr_pressure >= 1010 and curr_pressure < 1020) 335 return 18; 336 else 337 if (curr_pressure >= 1000 and curr_pressure < 1010) 338 return 21; 339 else 340 if (curr_pressure >= 990 and curr_pressure < 1000) 341 return 24; 342 else 343 if (curr_pressure >= 980 and curr_pressure < 990) 344 return 24; 345 else 346 if (curr_pressure >= 970 and curr_pressure < 980) 347 return 26; 348 else 349 if (curr_pressure < 970) 350 return 26; 351 } 352 else { 353 //winter 354 355 if (curr_pressure >= 1030) 356 return 2; 357 else if (curr_pressure 358 >= 1020 and curr_pressure < 1030) 359 return 8; 360 else if (curr_pressure 361 >= 1010 and curr_pressure < 1020) 362 return 15; 363 else if (curr_pressure 364 >= 1000 and curr_pressure < 1010) 365 return 21; 366 else if (curr_pressure 367 >= 990 and curr_pressure < 1000) 368 return 22; 369 else if (curr_pressure 370 >= 980 and curr_pressure < 990) 371 return 24; 372 else if (curr_pressure 373 >= 970 and curr_pressure < 980) 374 return 26; 375 else if (curr_pressure 376 < 970) 377 return 26; 378 } 379 } 380 else if (curr_pressure > prev_pressure) 381 { 382 //RAISING 383 if (mon >= 4 and mon <= 9) { 384 //summer 385 if 386 (curr_pressure >= 1030) 387 return 1; 388 else if (curr_pressure >= 389 1020 and curr_pressure < 1030) 390 return 2; 391 else if (curr_pressure 392 >= 1010 and curr_pressure < 1020) 393 return 3; 394 else if (curr_pressure 395 >= 1000 and curr_pressure < 1010) 396 return 7; 397 else if (curr_pressure 398 >= 990 and curr_pressure < 1000) 399 return 9; 400 else if (curr_pressure 401 >= 980 and curr_pressure < 990) 402 return 12; 403 else if (curr_pressure 404 >= 970 and curr_pressure < 980) 405 return 17; 406 else if (curr_pressure 407 < 970) 408 return 17; 409 } 410 else 411 //winter 412 { 413 414 if (curr_pressure >= 1030) 415 return 1; 416 else if (curr_pressure 417 >= 1020 and curr_pressure < 1030) 418 return 2; 419 else if (curr_pressure 420 >= 1010 and curr_pressure < 1020) 421 return 6; 422 else if (curr_pressure 423 >= 1000 and curr_pressure < 1010) 424 return 7; 425 else if (curr_pressure 426 >= 990 and curr_pressure < 1000) 427 return 10; 428 else if (curr_pressure 429 >= 980 and curr_pressure < 990) 430 return 13; 431 else if (curr_pressure 432 >= 970 and curr_pressure < 980) 433 return 17; 434 else if (curr_pressure 435 < 970) 436 return 17; 437 } 438 } 439 else { 440 if (curr_pressure 441 >= 1030) 442 return 1; 443 else if (curr_pressure >= 1020 and curr_pressure 444 < 1030) 445 return 2; 446 else if (curr_pressure >= 1010 and curr_pressure 447 < 1020) 448 return 11; 449 else if (curr_pressure >= 1000 and curr_pressure 450 < 1010) 451 return 14; 452 else if (curr_pressure >= 990 and curr_pressure 453 < 1000) 454 return 19; 455 else if (curr_pressure >= 980 and curr_pressure 456 < 990) 457 return 23; 458 else if (curr_pressure >= 970 and curr_pressure 459 < 980) 460 return 24; 461 else if (curr_pressure < 970) 462 return 463 26; 464 465 } 466} 467 468int station2sealevel(int p, int height, int t) { // 469 from pressure at our height to sea level 470 return (double) p * pow(1 - 0.0065 471 * (double)height / (t + 0.0065 * (double)height + 273.15), -5.275); 472} 473 474void 475 StripScroll() { // scroll up all the LED strip by 1 476 for (int led = 0; led 477 <= (NumLEDs); led++) 478 { 479 oldpos = NumLEDs - led - 2; 480 newpos = 481 oldpos + 1; 482 strip.setPixelColor(newpos, strip.getPixelColor(oldpos)); 483 484 } 485}
Gnome Weather Forecaster
arduino
Open this sketch in your Arduino IDE and make sure you have downloaded all the libraries needed.
1#include <Wire.h> 2#include <Adafruit_Sensor.h> 3#include <Adafruit_BME280.h> 4#include <Adafruit_NeoPixel.h> 5#include "RTClib.h" 6 7#define SEALEVELPRESSURE_HPA (1013.25) 8#define LED_PIN 7 9#define NumLEDs 8 10 11RTC_DS3231 rtc; // initialise the RTC DS3231 12Adafruit_BME280 bme; // initialise the BME280 sensor 13Adafruit_NeoPixel strip(NumLEDs, LED_PIN, NEO_GRB + NEO_KHZ800); 14 15unsigned long delayTime; // refresh rate for the readings 16int t_hour = 0; 17int t_minute = 0; 18int oldpos = 0; //Variables to scroll the LED bar 19int newpos = 0; 20 21 22int pressureArray[10] = {0}; // here we store the pressure readings 23byte counter = 0; 24byte delta_time = 0; 25int Z = 0; 26 27char tStr[21]; 28char pStr[22]; 29char hStr[20]; 30char pseaStr[26]; 31char timeStr[6]; 32char dateStr[12]; 33char zambretti[10] = "N/A"; 34char pressureHistory[57]; 35char pressureHistory2[57]; 36 37int temperature; 38int humidity; 39int pressure; 40int altitude = 355; // Here you should put the REAL altitude of the iGnome 41 42 43void setup() { 44 bool status; 45 Serial.begin(57600); // default settings 46 Serial.println("Starting measurements"); 47 if (! rtc.begin()) { 48 Serial.println("Couldn't find RTC"); 49 while (1); 50 } 51 52 if (rtc.lostPower()) { 53 Serial.println("RTC lost power, lets set the time!"); 54 // following line sets the RTC to the date & time this sketch was compiled 55 rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); 56 57 } 58 status = bme.begin(); 59 if (!status) { 60 while (1); 61 } 62 delayTime = 20000; 63 64 strip.begin(); // INITIALISE the LED strip object 65 strip.show(); // Turn OFF all pixels after init 66 strip.setBrightness(100); // Set BRIGHTNESS to about 2/5 (max = 255) 67} 68 69 70void loop() { 71 72 temperature = (int)bme.readTemperature(); 73 humidity = (int)bme.readHumidity(); 74 pressure = (int)(bme.readPressure() / 100.0F); 75 76 // Let's see the reading that will determine the forecast 77 78 Serial.print("Measured altitude "); 79 Serial.println((int)bme.readAltitude(SEALEVELPRESSURE_HPA)); 80 81 int seapressure = station2sealevel(pressure, altitude, temperature); 82 83 DateTime now = rtc.now(); 84 int t_hour2 = now.hour(); 85 int t_minute2 = now.minute(); 86 87 88 if (t_hour2 != t_hour or t_minute2 != t_minute) { 89 delta_time++; 90 if (delta_time > 10) { // every minute we increment delta_time, then every 10 minutes 91 delta_time = 0; // we store the value in the array 92 93 if (counter == 10) // if we read 10 values and filled up the array, we shift the array content 94 { 95 for (int i = 0; i < 9; i++) { // we shift the array one position to the left 96 pressureArray[i] = pressureArray[i + 1]; 97 } 98 pressureArray[counter - 1] = seapressure; 99 } 100 else { // this code fills up the pressure array value by value until is filled up 101 pressureArray[counter] = seapressure; 102 counter++; 103 } 104 } 105 106 Z = calc_zambretti((pressureArray[9] + pressureArray[8] + pressureArray[7]) / 3, (pressureArray[0] + pressureArray[1] + pressureArray[2]) / 3, now.month()); 107 108// From here is just for debug purposes on the serial monitor 109 110 sprintf(zambretti, "Z=%d", Z); 111 sprintf(tStr, "%d C", temperature); 112 sprintf(hStr, "%d %%", humidity); 113 sprintf(pStr, "%d hPa", pressure); 114 sprintf(pseaStr, "%d hPa", seapressure); 115 sprintf(dateStr, "%02d.%02d.%d", now.day(), now.month(), now.year()); 116 sprintf(timeStr, "%02d:%02d", now.hour(), now.minute()); 117 sprintf(pressureHistory, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,", pressureArray[0], pressureArray[1], pressureArray[2], 118 pressureArray[3], pressureArray[4], pressureArray[5], pressureArray[6], pressureArray[7], pressureArray[8], pressureArray[9]); 119 120 Serial.println(zambretti); 121 Serial.println(tStr); 122 Serial.println(hStr); 123 Serial.println(pStr); 124 Serial.println(pseaStr); 125 Serial.println(dateStr); 126 Serial.println(timeStr); 127 Serial.println(pressureHistory); 128 Serial.println(pressureHistory2); 129 130// END of testing purposes 131 132 StripScroll(); // advance the LED colors in the strip preparing for the new entry 133 134 if (pressureArray[9] > 0 and pressureArray[0] > 0) { 135 if (pressureArray[9] + pressureArray[8] + pressureArray[7] - pressureArray[0] - pressureArray[1] - pressureArray[2] >= 3) { 136 //RAISING 137 Serial.println("Raising"); 138 if (Z < 3) { 139 Serial.println("Sunny"); 140 strip.setPixelColor(0, 255, 127, 0); 141 } 142 else if (Z >= 3 and Z <= 9) { 143 Serial.println("Sunny Cloudy"); 144 strip.setPixelColor(0, 0, 255, 255); 145 } 146 else if (Z > 9 and Z <= 17) { 147 Serial.println("Cloudy"); 148 strip.setPixelColor(0, 127, 0, 255); 149 } 150 else if (Z > 17) { 151 Serial.println("Rainy"); 152 strip.setPixelColor(0, 255, 0, 127); 153 } 154 } 155 156 else if (pressureArray[0] + pressureArray[1] + pressureArray[2] - pressureArray[9] - pressureArray[8] - pressureArray[7] >= 3) { 157 //FALLING 158 Serial.println("Falling"); 159 if (Z < 4) { 160 Serial.println("Sunny"); 161 strip.setPixelColor(0, 255, 127, 0); 162 } 163 else if (Z >= 4 and Z < 14) { 164 Serial.println("Sunny Cloudy"); 165 strip.setPixelColor(0, 0, 255, 255); 166 } 167 else if (Z >= 14 and Z < 19) { 168 Serial.println("Worsening"); 169 strip.setPixelColor(0, 192, 0, 255); 170 } 171 else if (Z >= 19 and Z < 21) { 172 Serial.println("Cloudy"); 173 strip.setPixelColor(0, 127, 0, 255); 174 } 175 else if (Z >= 21) { 176 Serial.println("Rainy"); 177 strip.setPixelColor(0, 255, 0, 127); 178 } 179 } 180 else { 181 //STEADY 182 Serial.println("Steady"); 183 if (Z < 5) { 184 Serial.println("Sunny"); 185 strip.setPixelColor(0, 255, 127, 0); 186 } 187 else if (Z >= 5 and Z <= 11) { 188 Serial.println("Sunny Cloudy"); 189 strip.setPixelColor(0, 0, 255, 255); 190 } 191 else if (Z > 11 and Z < 14) { 192 Serial.println("Cloudy"); 193 strip.setPixelColor(0, 127, 0, 255); 194 } 195 else if (Z >= 14 and Z < 19) { 196 Serial.println("Worsening"); 197 strip.setPixelColor(0, 192, 0, 255); 198 } 199 else if (Z >= 19) { 200 Serial.println("Rainy"); 201 strip.setPixelColor(0, 255, 0, 127); 202 } 203 } 204 } 205 else { 206 if (seapressure < 1005) { 207 Serial.println("Rainy"); 208 strip.setPixelColor(0, 255, 0, 127); 209 } 210 else if (seapressure >= 1005 and seapressure <= 1015) { 211 Serial.println("Cloudy"); 212 strip.setPixelColor(0, 127, 0, 255); 213 } 214 else if (seapressure > 1015 and seapressure < 1025) { 215 Serial.println("Sunny Cloudy"); 216 strip.setPixelColor(0, 0, 255, 255); 217 } 218 else { 219 Serial.println("Rainy"); 220 strip.setPixelColor(0, 255, 0, 127); 221 } 222 } 223 224 t_hour = t_hour2; 225 t_minute = t_minute2; 226 227 } 228 strip.show(); 229 delay(delayTime); 230 231} 232 233 234int calc_zambretti(int curr_pressure, int prev_pressure, int mon) { 235 if (curr_pressure < prev_pressure) { 236 //FALLING 237 if (mon >= 4 and mon <= 9) 238 //summer 239 { 240 if (curr_pressure >= 1030) 241 return 2; 242 else if (curr_pressure >= 1020 and curr_pressure < 1030) 243 return 8; 244 else if (curr_pressure >= 1010 and curr_pressure < 1020) 245 return 18; 246 else if (curr_pressure >= 1000 and curr_pressure < 1010) 247 return 21; 248 else if (curr_pressure >= 990 and curr_pressure < 1000) 249 return 24; 250 else if (curr_pressure >= 980 and curr_pressure < 990) 251 return 24; 252 else if (curr_pressure >= 970 and curr_pressure < 980) 253 return 26; 254 else if (curr_pressure < 970) 255 return 26; 256 } 257 else { 258 //winter 259 if (curr_pressure >= 1030) 260 return 2; 261 else if (curr_pressure >= 1020 and curr_pressure < 1030) 262 return 8; 263 else if (curr_pressure >= 1010 and curr_pressure < 1020) 264 return 15; 265 else if (curr_pressure >= 1000 and curr_pressure < 1010) 266 return 21; 267 else if (curr_pressure >= 990 and curr_pressure < 1000) 268 return 22; 269 else if (curr_pressure >= 980 and curr_pressure < 990) 270 return 24; 271 else if (curr_pressure >= 970 and curr_pressure < 980) 272 return 26; 273 else if (curr_pressure < 970) 274 return 26; 275 } 276 } 277 else if (curr_pressure > prev_pressure) { 278 //RAISING 279 if (mon >= 4 and mon <= 9) { 280 //summer 281 if (curr_pressure >= 1030) 282 return 1; 283 else if (curr_pressure >= 1020 and curr_pressure < 1030) 284 return 2; 285 else if (curr_pressure >= 1010 and curr_pressure < 1020) 286 return 3; 287 else if (curr_pressure >= 1000 and curr_pressure < 1010) 288 return 7; 289 else if (curr_pressure >= 990 and curr_pressure < 1000) 290 return 9; 291 else if (curr_pressure >= 980 and curr_pressure < 990) 292 return 12; 293 else if (curr_pressure >= 970 and curr_pressure < 980) 294 return 17; 295 else if (curr_pressure < 970) 296 return 17; 297 } 298 else 299 //winter 300 { 301 if (curr_pressure >= 1030) 302 return 1; 303 else if (curr_pressure >= 1020 and curr_pressure < 1030) 304 return 2; 305 else if (curr_pressure >= 1010 and curr_pressure < 1020) 306 return 6; 307 else if (curr_pressure >= 1000 and curr_pressure < 1010) 308 return 7; 309 else if (curr_pressure >= 990 and curr_pressure < 1000) 310 return 10; 311 else if (curr_pressure >= 980 and curr_pressure < 990) 312 return 13; 313 else if (curr_pressure >= 970 and curr_pressure < 980) 314 return 17; 315 else if (curr_pressure < 970) 316 return 17; 317 } 318 } 319 else { 320 if (curr_pressure >= 1030) 321 return 1; 322 else if (curr_pressure >= 1020 and curr_pressure < 1030) 323 return 2; 324 else if (curr_pressure >= 1010 and curr_pressure < 1020) 325 return 11; 326 else if (curr_pressure >= 1000 and curr_pressure < 1010) 327 return 14; 328 else if (curr_pressure >= 990 and curr_pressure < 1000) 329 return 19; 330 else if (curr_pressure >= 980 and curr_pressure < 990) 331 return 23; 332 else if (curr_pressure >= 970 and curr_pressure < 980) 333 return 24; 334 else if (curr_pressure < 970) 335 return 26; 336 337 } 338} 339 340int station2sealevel(int p, int height, int t) { // from pressure at our height to sea level 341 return (double) p * pow(1 - 0.0065 * (double)height / (t + 0.0065 * (double)height + 273.15), -5.275); 342} 343 344void StripScroll() { // scroll up all the LED strip by 1 345 for (int led = 0; led <= (NumLEDs); led++) 346 { 347 oldpos = NumLEDs - led - 2; 348 newpos = oldpos + 1; 349 strip.setPixelColor(newpos, strip.getPixelColor(oldpos)); 350 } 351}
Downloadable files
Complete circuit
Complete circuit
Documentation
Gnome upper part
Gnome upper part
Gnome lower part
Gnome lower part
Gnome upper part
Gnome upper part
Gnome lower part
Gnome lower part
Comments
Only logged in users can leave comments
Anonymous user
2 years ago
Sounds like a cool little project, thanks! I have several Arduino experimenter kits, I may have all the parts I need already to do this with my teenage kits!
abeltje24
2 years ago
Thank for this project. But i got a problem whit the code. libraries RTClib-master op versie 1.1.0 in map: C:\\Users\\petersven\\Documents\\Arduino\\libraries\\RTClib-master used. 'class RTC_DS3231' has no member named 'lostPower' What do i do wrong? Thank you
Anonymous user
2 years ago
WOW !!! I found this great little project. I uploaded on my NANO and works perfectly. I have a question for you Sir ? Is it possible print data/results on an OLED screen? How can I do it ? Can you help me ? TIA Franky