Datalogging with Arduino Mega + DS3231 RTC + microSD card module (SPI)

Is it possible to use a formatted (borders, fonts, print layout, etc) excel file for data logging purposes using Arduino Mega + DS3231 RTC + MicroSD card module.

The excel file have general information data to be printed in the upper part and daily data to be printed in table form.

header


data log from DAY 0 - DAY 120

This is a part of an automatic feed dispenser with datalogging feature.

Can I write the data using a code in Arduino IDE in specific cells in that excel file?

Maybe if you know the Excel internal file format in extreme detail, byte-by-byte, you could do that. I'm not sure anyone on the forum has that knowledge.

Look at the size of some typical Excel files and compare with the memory size of the Mega.

Sure. Just compile with the F( ) macro for all the formatting text, write to file, filling in data where needed. Or the bulk of the file could be copied from SD and regurgitated back out with data filled in. You can also do it in html.
Create file in excel and EXPORT it. Chop into chunks and ouput "monkee copy" with data stuck in right place.
Set up Excel template for import of CSV file with data so formatting is separate from data.
Several ways to skin that cat.

What you might be able to do more easily would be to have the Mega write to a .CSV file, then have Excel read that .CSV file and format it to your requirements on the PC.

the way I want to do it is to pre format the file using Excel 2019 in my pc and save it to the microSD file. then write some code to write variable values to specific cells in the file.

I want the final file from the MEGA to be ready to print, if possible.

Can you elaborate more on this?

As I have said on the title, I will use microSD module to write the data in the excel file.

Which?
Its standard C++ file formats. Filenames must be DOS 8.3, but internally to the code, its standard file & string handling.

You will have to open the file in Excel in order to print it, so why not have Excel do the formatting that that point?

Are you using Excel only to format the data for printing? Is there no other data processing or archiving to the done later?

If only for printing, maybe some other printable file type that allows formatting of tables etc could be used. For example HTML.

If further data processing, analysing or archiving is needed, .CSV could the a better solution than having to combine a large number of individual Excel sheets.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.