Examples of Datalogging Using Microcontrollers
tigoe.github.io
WiFi Datalogging
Node.js Datalogging Server
Google Sheets Datalogging Server
Tracking Time
MKR Series Datalogging
Home
This project is maintained by tigoe
In this workshop you’ll be working with the Adafruit Feather M0 Adalogger microcontroller board. This board uses a Cortex ARM M0+, which is the same processor as the Arduino Zero. That means it’s Arduino-compatible, and a very capable processor for datalogging. The Adafruit Guide to the Feather M0 Adalogger is a thorough introduction. This page is a quick-reference only.
The Feather M0 Adalogger can read various sensors using its digital and analog inputs and its asynchronous serial and I2C communications pins. It can also read and write from an attached SD card. It can communicate with a personal computer via USB as well. It has a Lithium-Poly (LiPo) battery charger built-in so you can charge a battery while you’re programming, then unplug and run off the battery independently. There’s also a built-in real-time clock that can keep accurate time and two built-in LEDs that you can use to indicate what’s going on.
Below is the pin diagram for the board. Many of the pins have multiple functions. For the purposes of this workshop, the important pins are as follows:
Adalogger M0 pin diagram. Click here for a more detailed version. For more on the pin functions, see this link.
To test your board, click the Tools Menu –> Boards option, and choose “Adafruit Feather M0 (Native USB Port)”. Then click the Tools menu –> Port option, and choose the port with “(Adafruit Feather M0)” at the end of it. THen click the File Menu –> Examples option –> Basics –> Blink to open a sketch that will blink the red LED on the board. Click the Upload button from the toolbar and you should see the sketch upload and the red LED will begin to blink.
(The Arduino IDE toolbar)
Each of the examples in this repository uses a different sensor with the Feather, and you’ll need to wire the sensor to the board before uploading the code that reads it. Disconnect your board from power before wiring your sensors. Below are the wiring diagrams for each sensor.
(Pushbutton connected to a Feather. Button output pin is attached to digital pin 5 of the microcontroller.)
(Potentiometer connected to a Feather. Potentiometer output pin is attached to analog pin 0 of the microcontroller.)
(DHT11 Temp/Humidity sensor connected to a Feather. Sensor output pin is attached to digital pin 5 of the microcontroller.)
Code example - Temp/Humidity Datalogger
(Max4466 Microphone connected to a Feather. Microphone output pin is attached to analog pin 0 of the microcontroller.)
Code example - Frequency Meter
(GA1A12S202 Log-scale light sensor connected to a Feather. Sensor output pin is attached to analog pin 0 of the microcontroller.)
(LIS3DH accelerometer connected to a Feather. Sensor SDA and SCL pins are attached to SDA and SCL pins of the microcontroller.)
(Maxbotix LV-EZ0 Ultrasonic Distance Ranger connected to a Feather. Sensor output pin is attached to analog pin 0 of the microcontroller.)
(PIR motion sensor connected to a Feather. Sensor output pin is attached to digital pin 5 of the microcontroller.)
There are additional code examples for the se sensors, and for the SD card and real-time clock at this link.