Skip to content

The library's functionality is to format and log sensor data coming from Arduino in a streamlined manner as CSV.

License

Notifications You must be signed in to change notification settings

new01/StreamLog

 
 

Repository files navigation

StreamLog

The idea of streamlining your data logging process.


Releases GitHub Tag License GitHub top language arduino-library-badge

Library functionality is to format and log sensor data, coming from your microcontroller in a streamlined manner.

Need ? 🙄

The StreamLog library simplifies the process of logging and formatting data from your Arduino sketch, allowing you to focus on your core logic without worrying about the intricacies of data formatting. With just one function call, you can log multiple data variables along with their corresponding names, and the library takes care of CSV formatting of your data, adding timestamps, and visualizing it directly on the Arduino serial console.

This streamlined approach eliminates the need for writing additional lines of code in your sketch for data logging purposes, saving your time and effort.
You can easily use the logged data with any additional application for further analysis, visualization, or integration with other systems as it formats the raw Arduino data into a comma-separated file (CSV). Whether you're prototyping a project or developing a complex application where you want to monitor changes in data patterns over an extended period of time, StreamLog simplifies the process and enhances the efficiency of data logging and formatting within one platform without using any additional or third-party application.

Features 🌟

  • No, need to write extra codes for data formatting and printing on the serial monitor.
  • Standard data output as comma-separated file (CSV).
  • Support custom time intervals for data output ( second, minutes, hours etc..)
  • Use any software to see your data ( Arduino serial monitor, PuTTY etc. ) as long it supports serial communication.
  • Available as plug-and-play, just import/include the library in your sketch.

Download 👇


  • You can download the latest release of this library as zip : download and import it using the library manager.
  • Available on Arduino IDE library manager

    image


Working ⚙️

  • Import the StreamLog library in your Arduino sketch.

  • Call the functions of this library in your sketch, and put your data variables as arguments along with their names.

ex:

void setup (){

StreamLog.begin(9600); // intilize and define baud rate
}

void loop(){

  StreamLog.head("LDR1, LDR2, LDR3, etc....");
  StreamLog.data(5000, 3, LDR1intensity, LDR2intensity, LDR3ntensity, etc...);

}

Here,

  • StreamLog.head function is for sensor data headings/names of columns, this could be as many as you want.
  • In StreamLog.data
    • 5000: Time interval between data logs in milliseconds (5 seconds)
    • 3: Total number of variables ( sensor readings), including the delay and other values. This could be as many as you want.

Upload the sketch and turn on the serial monitor.



Output 🚀

Output on the Arduino Serial monitor as CSV format, of an LDR connected as analog input.
You can also enable the timestamp feature of the Serial monitor, otherwise timestamp column will be zero.

Timestamp (HH:MM:SS.MMM), Light Intensity,  Elapsed time ( S )
16.53.45.687, 100, 0 
16.58.00.011, 75, 300
17.03.00.094, 46, 600
17.08.00.014,  17,900

This is data reading of sunset, the experiment was started just before sunset, and set to log data in an interval of every 5 minutes in StreamLog.data(300000, ..... );



Post Processing 👷‍♂️

  • Now after completing the experiment, click on Serial monitor windows and copy everything.
  • Open any text editor, here I am opening Notepad, and past it there, Click on "Save As.." or click Ctrl+Shift+S.
  • Save it as .CSV

image

  • Change "Text Documents (.txt)" to "All Files"
  • You are done, the file was already in CSV format, just open it in MS Excel or anywhere else. Open it to see the changes in data over elapsed time or visualize the trend line

image



Reporting Issues & Contributions

Feel free to report issues and contribute to this repository

License

Copyright © 2024 Abhijeet kumar. All rights reserved.

Licensed under the MIT License.

About

The library's functionality is to format and log sensor data coming from Arduino in a streamlined manner as CSV.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%