Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a Weather Station with the RaspberryPi

Lukas
September 01, 2017

Building a Weather Station with the RaspberryPi

Lukas

September 01, 2017
Tweet

More Decks by Lukas

Other Decks in Technology

Transcript

  1. About Me - Lukas Prasuhn - From Germany, near Hameln

    - In Japan for already ~12 years - Github: lukasjapan - RaspberryPi Bluetooth Speaker (without PulseAudio) - Favourite Languages - Kotlin - Ruby - C++ around here
  2. (little long) Introduction (1) - Why building a Weather Station?

    - Ok, this is going to take some time to explain - I made the R2D2 Speaker! - ...and said that I wanted to build a bigger one… - ...so I did!
  3. (little long) Introduction (5) - How does this connect to

    a weather station? - We will get to it… - I wanted to try to add one more feature...
  4. (little long) Introduction (6) - A beer cooling compartment! -

    Peltier element - Hot side, cold side - Uses lots of energy and not so powerful - but small - Used in digital cameras/surgery tools, etc - Powered by Solarpanel (or battery)
  5. (little long) Introduction (7) - Finished! - Now I want

    to measure the efficiency of the cooling compartment - How?
  6. (little long) Introduction (8) - Option A) Buy a temperature

    logger - easy - fast - 2.000-3.000 Yen - Option B) Buy a sensor for the Raspberry Pi and work with that - takes lots of work - takes lots of time - but it is fun
  7. (little long) Introduction (9) - Yes! Option B! - Bosch

    BME280 - Temperature - Humidity - Air Pressure - Build a Weather Station - Constant logging - Visualizing - Accessing by Web
  8. Reading the sensor data from the BME280 - SWITCHSCIENCE/BME280/blob/master/Python27/bme280_sample.py -

    Ruby Gem - lukasjapan/i2c-bme280 - built by reading the Datasheet and above sample script - later I found a driver collection gem where the bme280 was included :(
  9. Data Logger - Ruby script -   - loop that

    inserts data - ActiveRecord - can be stopped by SIGINT and TERM signal
  10. Web Server - Used Libraries (1) - SPA Reactive Solution

    - Sinatra - index.html - latest data API (.json) - data by time range API (.json) - Vue.js - Reactive Frontend Framework - Fast to get results - rather slim - Made in China (by former Google employee)
  11. Web Server - Used Libraries (2) - Webpacker - JavaScript

    asset management pipeline - Builds ‘packs’ of JavaScript - Modular Architecture - Transpiling Plugins - Minifying Plugins - ... - ElementUI - GUI Elements for Vue.js - Chart.js - Chart Library for Frontend Application - HTML5 Canvas Element - very vertasile
  12. VPS Demo tethering DB Internet Web Server Logger Daemon Source

    code available at: lukasjapan/bme280-web
  13. (rather short) Closing - How about the Suitcase speakers cooling

    compartment? - Measuring before/after 30 minutes - just 4 degrees difference - back in less than 1 minute - possible causes - peltier element is too weak - I have to improve isolation (... a lot)