File Exchange

image thumbnail

Data Logger on Arduino UNO

version (584 KB) by Techsource Technical Team
Program a Data Logging Shield using the S-Function Builder


Updated 26 Apr 2016

View License

This Simulink Model uses the S-Function Builder to program a Data Logging Shield attached to an Arduino UNO.
It is makes use of existing C-code by Adafruit Industries (see below link), and shows how to integrate it into Simulink.
The data logger is portable and enables you to log sensor readings based on the sample time you set. The shield houses a real-time clock (RTC) that is powered by an external battery. This means that the clock is continuously ticking, regardless of whether the board is powered up or not. Data is logged onto an SD card in .csv format.

You can connect the external circuit to an LDR to log light intensity in a room. Alternatively, you can utilize other sensors.

Blog post on the data logger:

**NEW** Youtube Demonstration:

By: Esther Ling, Edu Engineer

Cite As

Techsource Technical Team (2020). Data Logger on Arduino UNO (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)


An updated submission is available here:

- Easier to add the include lines for the libraries.
- Eliminates the need to keep re-building whenever a change needs to be made to the code.

Leow Cheah Wei


Added Youtube demo link.


Added blog post on submission.

Added image to mask.

Removed GNU-licensed libraries and added information in the documentation on how to locate them.

Added copyright lines to renc2cpp function.

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Device Drivers

Inspired: Driver for Arduino Data Logging Shield