Datalogging Examples

Examples of Datalogging Using Microcontrollers

This project is maintained by tigoe

Introduction to Sensors for Journalism

In this workshop, you’ll learn how we measure events and conditions in the physical world using electronic systems. Although this won’t be comprehensize, you’ll get an introduction to the process that they know where to investigate further if they want to critique the process in an informed way.

Events in the physical world such as human movement, weather changes, or man-made environmental impacts like off-gassing from manufactured materials, generate changes in physical energy. Sensor-based data collection is grounded in the process of transduction: the conversion of other forms of physical energy into electrical energy.

The transduction process has limits: how sensitive our instruments are, how lossless our programming algorithms are, etc. Therefore, all electronic data about the events we’re sensing form models based on this collected data. Whether you’re gathering this data, analyzing it, or critiquing the process, you’ll understand better how these models are formed if you understand how sensor-based data collection works.

Workshop Schedule

Here’s the workshop schedule. We’ll modify this depending on everyone’s prior experience:

We’ll cover most of the technical material in the first day, so that on the second day you can deploy your datalogging project, gather some results, and present them at the end of the day.

To prepare for the workshop, please read through the Background material below and download the Arduino IDE software for your computer, shown in the Getting Started section below.

Background Material

This workshop is based on material from the introduction to physical computing course at ITP. The site for that course contains a large body of explanatory notes, videos, and example exercises that you will find useful as background for this workshop.

The examples for this workshop are programs written using the Arduino microcontroller programming environment. Arduino is designed to give users with no technical background an introduction to programming microcontrollers, the small, simple computers inside many of the electronic devices in everyday life. The application that you’ll download is known as an integrated development environment, or IDE.

Here are some of the technical concepts we’ll cover, with links for background reading or viewing:

These links will be useful for reference:

Getting Started

To get started, you’ll need to download and install the download the Arduino IDE version 1.6.7 or later. All of the microcontroller examples for this workshop can be programmed using the Arduino IDE. You’ll also need to install the board definition for the Feather Adalogger M0 board using the Boards Manager in the IDE. You’ll also need to install a library or two using the Library Manager as well. This section explains how to do that, for IDE version 1.6.7.

Here’s what it looks like:

Figure 1. Arduino IDE screenshot Figure 1. Arduino IDE Screenshot

The Boards Manager

There are more Arduino-compatible boards on the market than are listed in the IDE when you download it. To use a third-party board like the one used in this workshop, you’ll need to install it using the Boards Manager. To install new board definitions click on the Tools menu, and choose Board… –> Boards Manager. Use the search bar to search for your board. If it’s there, install it, then close the Boards Manager, and you should see your board show up in the Boards menu when you click on it next.

Figure 2. arduino boards manager Figure 2. The Boards Manager. You can find your board faster by filtering with its name, as shown here.

If your board is not listed in the boards manager, you’ll need to add the repository for it to the Preferences. Click on the Arduino menu, choose Preferences, and look for the field caled Additional Boards Manager URLs. Click the button to the right of it and add your board’s repository URL to the list. is the URL for the Feather Adalogger M0 board:

https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Figure 3. arduino preferences pane detail Figure 3. Detail of the Preferences pane Additional URLs field

Once you’ve added your URL, click OK to exit the Preferences menu and restart the IDE. Your board should show up in the Boards Manager now, and you can install it as explained above.

The Library Manager

You can find installed libraries under the Sketch menu, Include Libraries option. You can find examples for them in the File Menu, Examples option.

To install new libraries that don’t come standard with the IDE, click on the Sketch menu, and choose Include Library… –> Manage Libraries. Use the search bar to search for your library. If it’s there, install it, then close the Library Manager, and you should see your Library show up in the Sketch –> Include Library menu and the File –> Examples menu when you click on either of them next.

Figure 4. arduino library manager Figure 4. The Library manager. You can filter for particular libraries, like you can in the Boards Manager

If your library is not listed in the library manager, you can add it as a folder or .zip file using the Sketch –> Include library option as well. Just click Add .ZIP Library and follow the directions from there.

Some of the examples in this repository use the following libraries. You can filter for these in the Library manager:

Once you’ve got your board installed and the libraries it needs, you’re ready to use the examples in this repository. Circuit diagrams and the pin diagram of the feather can be found at this link.