In my previous IoT project on the Orange Pi I showed how to read a DHT22 or a DHT11 temperature and humidity sensor. That project involved connecting the sensor to the GPIO pins and writing C code to read the sensor. In this example I will show you how do the same, but using Python code instead.
Store sensor data with SQLite
Very often as part of an Orange Pi or Raspberry Pi project involving sensors, it is useful to store the sensor data in some kind of way or another. A good way to store the data is in a database that you can manage and query. SQLite is a popular embedded database management system. SQLite comes in the form of a C library. Due to it’s low footprint on resources, it fits well with a device such as a Raspberry Pi or the Orange Pi.
Create a Flask web page
In this tutorial I will show you how to build a simple web app using Flask for the server side scripting and D3.js for the data visualization.