All paths

Data logging: SD, EEPROM and flash

Keep data through resets and power cuts: the Uno's EEPROM and its wear, a 24LC256 on I2C, SD cards and FAT, CSV logs with DS3231 timestamps, safe writes, and a month-long weather balloon flight recorder.

Arduino Uno R3Free7 lessons6 h4 chapters2,024 XPEmbedded engineering · Intermediate+150 XP

0 of 7 done

What you will build

2 projects, built step by step

7 lessons in 4 chapters, about 6 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.

Chapter 1 project

A 24LC256 on the bus

32 KB of I2C EEPROM: page writes, the write cycle found by ACK polling, and the page wrap bug that a wrong page size causes.

Open it in the simulator
Chapter 2 project

Timestamps from an RTC

Rows stamped by a DS3231: why millis() is not a time, Unix time, a date that rolls over at midnight by itself, and an ISO 8601 timestamp.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

EEPROM

Small memories that survive the power going off.

  1. Open218 XP

    EEPROM and wear

    The Uno's own 1024 bytes of EEPROM: a boot counter that survives a reset, settings saved as a struct, and the sums for a cell rated at 100,000 writes.

    0 of 6 steps

  2. ProjectLocked436 XP

    A 24LC256 on the bus

    32 KB of I2C EEPROM: page writes, the write cycle found by ACK polling, and the page wrap bug that a wrong page size causes.

    0 of 6 steps

4 questions, graded as you go.
Chapter 2

Files on an SD card

FAT, CSV logs and real timestamps.

  1. Locked218 XP

    SD cards and FAT

    A microSD card on SPI: blocks, a FAT16 file system, listing the card, and why a file name has to fit in eight characters and three.

    0 of 6 steps

  2. Locked218 XP

    CSV logs

    A temperature every second appended to LOG.CSV: a header row, one record per line, a separator, and the file printed back on demand.

    0 of 6 steps

  3. ProjectLocked436 XP

    Timestamps from an RTC

    Rows stamped by a DS3231: why millis() is not a time, Unix time, a date that rolls over at midnight by itself, and an ISO 8601 timestamp.

    0 of 6 steps

4 questions, graded as you go.
Chapter 3

Surviving power loss

What reaches the card when the power goes.

  1. Locked218 XP

    Power-loss safe writes

    A file kept open for speed: what flush() really does, a power cut that loses the unflushed rows, and the trade between speed, wear and safety.

    0 of 6 steps

3 questions, graded as you go.
Chapter 4

Boss project

A weather balloon flight recorder built to log for a month.

  1. Locked280 XP

    Boss: a month-long flight recorder

    A weather balloon logger built for a month: a file per day named by the RTC, timestamp, temperature and altitude rows, the flight number in EEPROM, and a resume after a power cut.

    0 of 8 steps

3 questions, graded as you go.
Syllabus

Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

EEPROM

  1. EEPROM and wearThe Uno's own 1024 bytes of EEPROM: a boot counter that survives a reset, settings saved as a struct, and the sums for a cell rated at 100,000 writes.
  2. A 24LC256 on the bus32 KB of I2C EEPROM: page writes, the write cycle found by ACK polling, and the page wrap bug that a wrong page size causes.
Chapter 2

Files on an SD card

  1. SD cards and FATA microSD card on SPI: blocks, a FAT16 file system, listing the card, and why a file name has to fit in eight characters and three.
  2. CSV logsA temperature every second appended to LOG.CSV: a header row, one record per line, a separator, and the file printed back on demand.
  3. Timestamps from an RTCRows stamped by a DS3231: why millis() is not a time, Unix time, a date that rolls over at midnight by itself, and an ISO 8601 timestamp.
Chapter 3

Surviving power loss

  1. Power-loss safe writesA file kept open for speed: what flush() really does, a power cut that loses the unflushed rows, and the trade between speed, wear and safety.
Chapter 4

Boss project

  1. Boss: a month-long flight recorderA weather balloon logger built for a month: a file per day named by the RTC, timestamp, temperature and altitude rows, the flight number in EEPROM, and a resume after a power cut.
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Data logging: SD, EEPROM and flash

Is Data logging: SD, EEPROM and flash free?

Yes. All 7 lessons of Data logging: SD, EEPROM and flash are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Arduino Uno R3?

No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Data logging: SD, EEPROM and flash take?

About 6 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: A 24LC256 on the bus and Timestamps from an RTC.

Where do I start?

With "EEPROM and wear", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.