Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To keep Arduino settings after a restart or power loss, store them in the persistent storage supported by your board: use the EEPROM API on boards that provide it, and use Preferences for Arduino-ESP32. Load saved values in setup(), use defaults if no valid configuration exists, and save only when a setting changes.

Choose storage for your specific board

Arduino-compatible boards do not all implement storage the same way. Check the documentation for your exact board and core before using an API or assuming a particular capacity.

Platform Storage API How data is organized Best fit
Arduino boards with EEPROM support EEPROM Bytes at addresses; get() and put() handle typed values and structures Small settings stored as bytes or typed data
ESP32 with Arduino-ESP32 Preferences Key-value pairs in nonvolatile storage (NVS) Many small scalar values, strings, and byte arrays
ESP32 with larger data sets Filesystem library such as LittleFS Files Larger data than is suitable for Preferences

EEPROM on supported Arduino boards

The Arduino EEPROM guide covers byte-level read() and write(), as well as typed get() and put(). Its Uno example lists 1 kB of EEPROM; capacity varies by board. The guide states a 3.3 ms write operation and a limit of 100,000 write cycles per location in its EEPROM discussion, so avoid needless writes. update() skips writing a byte if its value is unchanged, and put() uses update semantics.

Preferences on ESP32

For new Arduino-ESP32 applications, Espressif describes Preferences as the replacement for EEPROM. The Preferences API reference says the library is unique to Arduino-ESP32 and should be considered the replacement for the Arduino EEPROM library. It stores key-value data in NVS and retains it across restarts and power loss. Namespace and key names are ASCII, case-sensitive, and limited to 15 characters each. Supported values include scalar types, strings, and byte arrays. Espressif recommends a filesystem such as LittleFS for larger data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
ESP32 Development Board Max V1.0 Compatible with Arduino, USB-C, Wi-Fi, Bluetooth, MicroPython Compatible, Single Board Computer Suitable for Building Mini PC/Smart Robot/Game Console (QA009)
  • 【ACEBOTT ESP32 Development Board】 - Powerful WiFi and wireless development board, driven by the rugged ESP 32 module, seamlessly integrated with Arduino IDE. With Hall sensors, high-speed SDIO/SPI, UART, I2S and I2C, it is the cornerstone of IoT and smart home innovation.
  • 【Wi-Fi/Bluetooth and Arduino Cloud Compatibility】 - This board uses 2.4GHz dual-mode WiFi and wireless chips with low-power technology, which are RoHS-compliant, simplifying wireless communication and allowing you to easily connect devices and platforms. Whether you are using a compatible Arduino IDE or exploring other development environments, our board can easily adapt to your needs.
  • 【Improved and Professional Edition】 - All IO pins are brought out for easy development; no additional breadboard is required; the Type-C interface is equipped with electrostatic discharge protection diodes and transient voltage suppression diodes to protect the chip from damage by electrostatic breakdown and various surge pulses. In addition, it is equipped with a freeRTOS operating system, which is very suitable for the Internet of Things, smart homes, and building smart robots/game consoles.
  • 【Easy to Use】- The ACEBOTT ESP-32 Development Board includes everything you need to support the microcontroller. Just connect it to a computer via a USB cable or use an AC-DC adapter or battery to power it to start using it. Whether you are an experienced developer or a hobbyist, this development board can provide you with the tools you need for unlimited innovation.
  • 【 Install Plugins And Download Drivers】: This ESP32 development board includes detailed instructions on how to download plugins and all necessary programs and codes from the network environment. The path is: ACEBOTT official website - Resources - WIKI.

Load settings and establish defaults at startup

Use setup() to open storage and choose between the saved configuration and factory defaults. A known marker key or validity indicator prevents uninitialized bytes or missing values from being treated as real settings. Espressif’s Preferences tutorial demonstrates using a predetermined key to decide whether to load defaults or last-run settings.

  1. Select the board-specific API. Confirm the target board and core support the EEPROM API, or use Preferences when programming ESP32 with Arduino-ESP32.
  2. Open the storage interface in setup(). For Preferences, open a namespace; for EEPROM, use the implementation available on the selected board.
  3. Check for a valid configuration. Test a marker or another validity indicator before trusting stored fields.
  4. Load or initialize. If the marker is valid, read the saved values using the same data types used to write them. Otherwise, apply defined defaults and save the initial configuration if appropriate.

Reading uninitialized EEPROM data can produce invalid values. The Arduino guide warns, for example, that an EEPROM string without a null terminator may print garbage and a float may display invalid output. Validate data before using it, and fall back to sensible defaults when it fails validation.

Rank #2
ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (3PCS)
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Support LWIP protocol, Freertos
  • SupportThree Modes: AP, STA, and AP+STA
  • Ultra-Low power consumption, Compatible with Arduino IDE
  • ESP32 is a safe, reliable, and scalable to a variety of applications

Save settings when they change

Save after a user changes a setting, not unconditionally on every pass through loop(). Frequent writes waste EEPROM write life; the Arduino guide’s update behavior is specifically useful for avoiding writes when a byte is unchanged. Check return or status values when the selected API exposes them, so the program can detect a failed save.

For Preferences, pair each read and write with the same data type: for example, use the matching typed getter and setter for a value. Keep namespace and key names within the 15-character limit, and remember that capitalization matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
ELEGOO ESP-32 Super Starter Kit with Tutorial Compatible with Arduino IDE
  • Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
  • Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
  • Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
  • Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
  • Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Persisting a structure requires a format check

EEPROM.get() and EEPROM.put() can transfer structures, but saving raw structure bytes couples stored data to the structure’s layout. Changing field order or types, or changing compiler padding, can make older saved bytes incompatible with new firmware.

As an implementation safeguard, include a format marker or version and validate loaded fields before accepting them. If the saved version is unknown or the values fail validation, initialize defaults and save the new format. Arduino’s guide demonstrates transferring structures but does not prescribe a universal migration method.

Best Value
Sale
ELEGOO UNO R3 Project Super Starter Kit with PDF Tutorial for Beginners
  • TURN CODE INTO REAL-WORLD RESULTS — Follow 22+ guided lessons to make LEDs blink, read temperature and distance, move servo and stepper motors, control an LCD and respond to joystick or IR input; ideal for a family weekend build, homeschool unit, coding club or STEM classroom
  • MORE PROJECT VARIETY IN ONE ORGANIZED KIT — Includes the UNO R3 controller, LCD1602 with pre-soldered header, breadboard power module, ultrasonic and DHT11 sensors, joystick, IR receiver and remote, SG90 servo, stepper motor, relay, DC motor, fan blade, displays, LEDs, buttons, resistors and jumper wires
  • START WITHOUT SOLDERING — Plug-in modules, a solderless breadboard and the pre-soldered LCD help beginners focus on wiring, code and testing; the illustrated component list makes it easier to find each part and move from one lesson to the next
  • LEARN THE LOGIC, THEN CREATE YOUR OWN — Use Arduino IDE and the included example code to understand digital input and output, analog sensing, timing, motor control and display functions, then change thresholds, speeds and sequences for alarms, environmental monitors, reaction games and motion projects
  • CLEAR SETUP SUPPORT FOR FIRST-TIME BUILDERS — Download the latest tutorial and code, select the UNO board and correct computer port, check component polarity and breadboard rows, and keep power-module input at 9V or below; younger learners should work with an experienced adult
Rank #4
Sale
ELEGOO UNO R3 Microcontroller Board ATmega328P+ATmega16U2 with USB Cable
  • START CODING WITH THE ELEGOO UNO R3: Connect the included USB cable, upload your first sketch, and build sensor, motor, display, and automation projects, making it a practical controller for maker desks, classrooms, coding clubs, and robotics labs
  • ATMEGA328P CORE FOR EVERYDAY PROJECTS: A 16 MHz clock, 32 KB flash, 14 digital I/O pins with 6 PWM outputs and 6 analog inputs provide a versatile foundation for LEDs, buttons, relays, servos, displays and sensors
  • RELIABLE USB PROGRAMMING AND CLEAR WIRING: The ATmega16U2 USB interface supports sketch uploads and serial communication, while clearly labeled headers help simplify connections to jumper wires, shields and modules
  • POWER AND EXPAND YOUR WAY: Run the board from USB or a recommended 7-12 V external supply, then add compatible shields and modules for data logging, automation, robotics, test fixtures and custom electronics projects
  • BOARD AND USB CABLE INCLUDED: Comes with 1 ELEGOO UNO R3 development board and 1 USB-A to USB-B data cable; breadboard, sensors, shields and power adapter are not included, and younger learners should work with an experienced adult

Common mistakes to avoid

  • Assuming EEPROM works identically everywhere: verify support and capacity for the exact board and core.
  • Trusting storage without checking it: use a marker and validate values before applying them.
  • Writing on every loop: save only after a change and use update behavior where available.
  • Using mismatched Preferences types: read a value with the same type used to write it.
  • Choosing Preferences for large files: use a filesystem such as LittleFS for larger ESP32 data.
  • Changing a stored structure without compatibility handling: version its format and validate it when loading.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.