Course Overview

This 8-part series covers the following modules:


Module 1: Understand the Hardware Design Stack
In Module 1, we take you through the design flow we use when we design devices. This gives a broad overview of what the requirements are, how we prototype, iterate, test, pilot and deploy them. We also discuss the basic hardware and software blocks that are common to most devices, their terminology, and what they do.


Module 2: Setting up the Arduino IDE

In Module 2, we first describe what we mean by ‘data logger’. Then we go into detail on setting up the Arduino environment for this course. We discuss installing the WildLogger board files, and setting up drivers so we can communicate with the board. Once that’s done, we introduce the Arduino program structure, then write and upload our first program, “Hello world”.


Module 3: Proof of Concept: Programming the Basic Functionality 

In Module 3, we break down the basic functionality of our data logger into submodules. In each submodule, we explain the principles behind what we’re doing, and then write the code to interface with each functional block.


Module 3.1: Setting Up the Arduino Command Line

In Module 3.1, we discuss why we’re using the command line, and install the Arduino Command Line library written by us at Freaklabs. Once that’s installed, we go through our hands-on labs where we write code to implement the command line directly on the Wildlogger board. We also implement a table of custom commands which allows us to control the WildLogger in real time, in this case, changing the speed of a blinking LED.


Module 3.2: Temperature and Humidity Settings

In Module 3.2, we get an overview of the temperature and humidity sensor we’ll be using for this course. We learn the basics of temperature and humidity measurement, how the sensor works, and how to install the Arduino library to access and control the sensor. After that, we do hands-on labs where we read the temperature and humidity, control the sensor from our command line, and then use the temperature and humidity data to control another device.


Module 3.3: Measuring Battery Status

In Module 3.3, we learn about how analog to digital conversion (ADC) works and what the terminology actually means. We learn about ADC resolution and bit-depth, sampling rates, and things that can increase or decrease the accuracy of our ADC. Finally we use the internal ADC on the Wildlogger board to measure our battery voltage which will eventually allow us to track our battery levels on the datalogger. By the end of this submodule, you’ll know the difference between a 10-bit ADC and a 16-bit ADC, how to interface sensors to them, and how to write software to read and process their data.


Module 3.4: Real Time Clock

In Module 3.4, we learn about how real time clocks (RTCs) are used in instrumentation. Timekeeping plays a central role in scientific field instrumentation. It’s used to timestamp data, synchronize multiple standalone devices, and also controls power management. We discuss how RTCs work, how outdoor conditions affect clock accuracy, and the different types of clocks and their accuracy. We also learn how to access and control the real time clock on the WildLogger board, set the date and time, and read it in different formats.


Module 3.5: SD Cards and the FAT File System

In Module 3.5, we begin with the basics of SD cards in all their wonderful form factors and flavors. We discuss the technology that makes SD cards possible, the types of memory cards, the form factors, their reliability, and power consumption. We also discuss what all those little numbers you normally ignore on your SD card mean, like read speed, card type, speed class, UHS speed class, and bus speed.

Once that’s done, we talk about file systems and why they’re needed. We go into how a file system fits on top of SD cards, how it organizes the bulk storage on an SD card, and the different types of file systems including FAT32 and exFAT.

In the lab portion, we’ll learn how we access the SD card on the WildLogger, installing the Arduino library to control our SD cards, and how easy it is to implement a system that can access multiple SD cards. We learn how to create and open files for reading, writing, or appending, how to read and write to a file, and things to watch out for to prevent file corruption. We implement a mini DOS system (Wild-DOS?) with commands to list files in a directory, and read, write, and delete files. Finally we finish off by implementing a command to write timestamped sensor data and files to our SD card.


Module 3.6: Interrupts 

In this final submodule for Module 3, we’ll be discussing the voodoo topic of interrupts. Interrupts are a bit of an intermediate/advanced topic in device design but they’ll also play an important role in our data logger, and many other field devices.

We start by discussing interrupts, how they fit into our power management strategy, and how they can be extended to implement things like operating systems. We then get introduced to actual interrupt implementation using the on-board pushbutton on the WildLogger. We learn things that can go wrong with push buttons, how to work around those limitations, and how to write interrupt handlers to manage push button events.

We then learn about PIR motion sensors, how they work, their limitations, and what PIR stands for. We learn how temperature affects range and also how to compensate to reduce false positives at low temperatures and missed opportunities at high temperatures. We learn how to interface a PIR motion sensor, how to write an interrupt handler for them, and programmatic limitations like their warm-up times and reset times.

Finally we learn how to set timers and alarms on our real-time clock. This fits into the main power management strategy for WildLogger and will allow us to sleep most of the time and just wake up to collect data on a minute, hourly, daily, weekly, or even monthly basis.

Now that we have an understanding of the basic functionality of our data logger, and working code that’s been tested, we’ll be ready to tie everything together in Module 4 where we create our functional data logger application.


Module 4: Tying it all Together

In this module, we tie together everything we’ve learned so far into a functional data logger application. We’ll be implementing the temperature and humidity sensor, realtime clock, analog digital converter, SD cards,PIR motion sensor, and command line interface to implement a test version of our datalogger. We’ll then test it for functionality and check that we have things in the format we want it in.

In the second part of this module, preparing for failure, we learn that everything fails and it’s important to prepare for this. We’ll add additional safety checks to prevent what we can, diagnostic logs for documenting errors after the fact, and error codes which will be important for both field work and forensic studies when a device fails in the field.

This module will be code heavy since we’re not introducing any new concepts, but integrating a lot of things together.