How to save data from EEZ Studio directly to your Arduino's storage

EEZ Studio is a visual design tool that runs on your computer, but your Arduino board has its own file system you can write to. The most practical way to send data from EEZ Studio to Arduino storage is through the serial connection that already links them — you send commands over that same wire, and Arduino code running on the board writes the data to its SD card or internal storage.

This means you do not need a separate library or complicated setup. You write a small Arduino sketch that listens for incoming data over serial, then saves whatever it receives. On the EEZ Studio side, you use the serial output action to send that data. The Arduino board handles the actual file writing.

Key Takeaways

  • EEZ Studio sends data to Arduino over the serial connection using the serial output action in your project flow.
  • Your Arduino sketch must include code that reads the incoming serial data and writes it to storage using the SD library or EEPROM, depending on your board.
  • Most Arduino boards need an SD card module connected via SPI pins to store files larger than a few kilobytes.
  • Test the serial connection first by sending simple text before you try to write actual files.
  • The data format you send from EEZ Studio must match what your Arduino code expects to read and parse.

Setting up serial communication between EEZ Studio and Arduino

Before you write any files, confirm that EEZ Studio can talk to your Arduino board over serial. Open your EEZ Studio project and locate the serial output action in the flow editor — this is the tool that sends data from your computer to the board. Set the baud rate to match what your Arduino sketch declares, typically 9600 or 115200.

On the Arduino side, open the Serial Monitor in the Arduino IDE and set it to the same baud rate. Send a simple test message from EEZ Studio — something like "hello" — and watch the Serial Monitor to confirm it arrives. If you see garbled text or nothing at all, the baud rates do not match or the USB cable is loose. Fix this before moving forward, because file writing will fail silently if the serial link is broken.

Writing a basic Arduino sketch to receive and store data

Your Arduino sketch needs to listen for incoming serial data and decide what to do with it. Here is the structure: set up serial communication in setup(), then in loop() check if data has arrived, read it, and write it to storage.

For boards with an SD card module, use the SD library that comes built into the Arduino IDE. Include the library at the top, define your chip select pin (usually pin 10), and initialize the SD card in setup(). In loop(), use Serial.available() to check if data is waiting, then Serial.read() to grab it one byte at a time. Collect the bytes into a string or buffer, and when you receive a newline character or reach a size limit, open a file on the SD card, write the buffer, and close the file.

If your board does not have an SD module and you only need to store a small amount of data, use EEPROM instead. The EEPROM library is also built in. EEPROM has limited space — typically 1024 bytes on an Arduino Uno — so this works only for short messages or sensor readings, not large files.

Sending data from EEZ Studio to the Arduino file writer

In your EEZ Studio project, add a serial output action to the flow where you want to send data. This action takes a string as input. You can build that string from text fields, sensor values, timestamps, or any other data your project collects. Format the string so your Arduino sketch knows where one piece of data ends and the next begins — a common approach is to separate fields with commas and end each line with a newline character.

For example, if you want to log temperature and humidity readings, send something like "25.3,60.5\n" from EEZ Studio. Your Arduino sketch reads this, splits it on the comma, and writes both values to the SD card file. The newline tells the sketch that the message is complete.

Test with a short message first. Send "test\n" and check the SD card file on your computer to confirm it arrived. Once that works, send your real data.

Handling file names and preventing data loss

Decide whether you want to append new data to an existing file or create a new file each time. Appending is simpler — open the file with FILE_WRITE mode, which adds data to the end without erasing what is already there. Creating a new file each time requires you to generate a unique name, usually by adding a timestamp or counter.

If you append to the same file for days or weeks, it will grow large and slow down read operations. If you create a new file for each session, you will have many small files to manage. A middle ground is to create a new file once per day or once per hour, using the date or time in the file name.

Always close the file after writing. An unclosed file can lose data if the power cuts out or the board resets. Use the file.close() command after every write, or write less frequently but in larger batches to reduce the number of open-close cycles.

Debugging when files are not being written

If data arrives at the Arduino but nothing appears on the SD card, the most common causes are a missing or uninitialized SD card, incorrect chip select pin, or a file write that fails silently. Add debug output to your sketch: send messages back to EEZ Studio over serial to confirm each step. For example, print "SD card initialized" after the SD.begin() call, print "file opened" after opening the file, and print "data written" after each write.

Check that the SD card is formatted as FAT32, which the SD library expects. If you have formatted it on a Mac or Linux machine, it may use a different file system. Reformat it on Windows or use a tool like Etcher to write a known-good image.

If the file opens but no data appears, the write may be failing because the SD card is full or the file name contains invalid characters. Arduino file names must be 8 characters or fewer with no spaces or special characters other than underscores and hyphens — use names like data_001.txt instead of data 001.txt.

Frequently Asked Questions

Can I write to Arduino internal memory instead of an SD card?

Yes, but only for small amounts of data. Arduino boards have EEPROM (usually 1 to 4 kilobytes) and flash memory. EEPROM is slower and has a limited number of write cycles before it wears out. Flash memory is larger but requires special libraries and is harder to work with. For anything larger than a few kilobytes, use an SD card module.

What baud rate should I use?

9600 is the most reliable for long cable runs and older boards. 115200 is faster and works well for short USB cables. Pick one, set it in both EEZ Studio and your Arduino sketch, and test before you send real data. Mismatched baud rates cause garbled text or no output.

How do I know if the file was written successfully?

Check the SD card on your computer by removing it and plugging it into a card reader. You should see the file with the data inside. If the file exists but is empty or incomplete, the write failed partway through — this usually means the SD card was full or the power was interrupted. Add serial debug messages to your sketch to confirm each write succeeded before moving on.

Can I write multiple files at the same time?

The SD library can open only one file at a time on most Arduino boards. If you need to write to multiple files, open one, write to it, close it, then open the next one. This is slower but works reliably. Do not try to keep multiple files open simultaneously.

What happens if the USB cable disconnects while writing?

The Arduino will stop receiving data from EEZ Studio, but any data already written to the SD card will remain. If a write was in progress when the cable disconnected, that write may be incomplete or lost. Always close files immediately after writing to minimize the risk of data loss during a disconnect.