Project 101: Weather Station


This the learning center page for project 101, a weather station.


The weather station project exposes students to digital electronics and programming using a Raspberry Pi single board computer. In this project, we will build a device to monitor, display, and graph a record the temperature and humidity over time. We will design and print an ergonomic plastic enclosure, and fit it with a character display to readout relevant weather data. We'll also use the same Pi to serve a custom written weather station website, where we can chart the weather history. Finally, all the resources related to this project will be hosted on a github repository.

The enclosure for this project will be designed by us in CAD and 3D printed. The front face of the case will have a backlit character display, and have holes to align with the Raspberry Pi connections. A sensor, sectioned off within the enclosure, will contain a temperature and humidity sensor that we will probe by referencing a datasheet and and writing custom software.

Purpose

The purpose of the weather station project is to introduce students to digital electronics, expose them to design and printing of three dimensional models, and learn more about programming, specifically reading and understanding how to convert electronic component datasheets into programming code.

The final product will display weather information and time on an liquid crystal character display, including current temperature and humidity, as well as highs and lows over a given period of time. In addition to displaying weather data, we will be building a custom weather station website hosted by the Pi. This website will graph the history of data collected by the weather station, and potentially perform some weather analysis.

Gallery

As we progress through this project we'll be keeping a log of our work. The picture gallery below serves as a record of the steps we've completed thus far.

List of Materials

The following materials are required to build this project:
  • Raspberry Pi single board computer with a memory card.
  • 5V 3A power supply with micro USB cable.
  • 20x4 Hitachi HD44780 LCD character display with back light. Amazon link
  • 3.3V Aosong DHT11 humidity and temperature sensor. Amazon link
The student will need access to these tools:
  • Soldering iron and solder.
  • A package of electronic wires.
  • Wire stripping tool.
  • Metric caliper measuring tool.
The student will be provided with these items:
  • A 3D printed case based on our collaborative teaching sessions.

Software Environment

A computer with the Linux operating system will be used to create and design software and related resources for this project. We will use OpenSCAD to design the case, and Mono Develop with Mono Framework version 4.8 to communicate with the sensor, character display, and serve the weather station website.

Mono Framework

In order to support as a wide variety of Raspberry Pi devices, we have selected the Mono Framework 4.8 as the primary software toolkit used to ing this project. The Mono project and its accompanying framework are an open source implementation of Microsoft's .NET Framework. Although Microsoft has a god record and of improving their .NET Framework, their newer Dotnet Core platform it leaves behind a significant class of devices. By choosing to use the Mono Framework in place of Dotnet Core, we can create software that runs on all Pi hardware.

To aide in software development, and get off to a quick started we've created an IoT Raspberry Pi library for the Mono Framework. It contains all the instructions and code the students need to get started with programming IoT style applications on a Pi computer. Read more about our IoT library at its official github repository.

Mono Develop

When authorizing and building projects using the Mono Framework we will be using the Mono Develop integrated development environment (IDE). Mono Develop is free open source software, and provides more than enough functionality to meet our needs. Additionally, the project and solution files used by Mono Develop are 100% compatible with Visual Studio and Visual Studio Code, so it will be possible to migrate our project to these other development environments should the need arise in the future.

We've also enhanced Mono Develop with custom tooling to allow for code to be compiled on a desktop PC then transferred and run on a Raspberry Pi with a single click. This makes for an greatly improved programming process, with minimal steps are required to go from writing code to testing our programs. This tooling will be assist us in an an iterative processes as write and test our programming code and add the best parts it to our project.

Git Repository

The full content of our software and other file assets are hosted at this git repository. It contains the source code to run the weather station, as well as technical diagrams, models, and photographs of the components we will be designing as we progress through this project.

Design and Modeling

We will design a plastic enclosure for the project to house a Raspberry Pi single board computer, an LCD character screen, and a temperature and humidity sensor. A model of this enclosure will be created using a vector CAD tool, and extruded into a solid parts using the open source tool OpenSCAD. The bottom section of the enclosure will hold the Pi and include through holes wiring connection to our digital components. The top section will hold the LCD screen and will be detachable from bottom. An area of the enclosure will be separated from the other components and allow only the atmosphere outside enclosure to be sensed and measured.

The current iterative state of our enclosure is shown below.

Electronics and Wiring

In this project we will be exploring the the fundamentals of electronics, learn about common electronic components, and wiring circuits using a breadboard. We will be drawing wiring diagrams using the template provided below (click the image to download the template). With it we'll be able to design circuits between electronic components and the Raspberry Pi.


Datasheets

The electronic components we will be using include a HD44780 LCD character display, a DHT11 temperature and humidity sensor, and two potentiometers. These former two have well known standards adopted by the electronics community, and are commonly associated with technical operation datasheets published by their original manufactures.

The operation of the HD44780 character display is described in this datasheet by Hitachi.

The operation of the DHT11 sensor is described in this datasheet by Aosong.

Soldering Wires

Below is a guide to soldering 24 AWG wires into circuit board through holes. In this project we'll be soldering wires to an LCD character display and two potentiometers. For the LCD we will use solder joints like those described below to the first 6 and last 6 pins. The solder joints will be domed on the LCD face side with our wires exiting out of the back side of the display.


Display Pinouts

The LCD character display uses the following pinouts. The first and last pins are 5V DC and ground. A contrast pin supplies a voltage to control the contrast of display characters. The register select and enable pins are used to control the data mode and submitting data. The four data pins D4-D7 are used to send either commands or character text based on the register select setting.

See Also