EEPROM is a small memory inside the Arduino that keeps data even when the power is off. It is used to save settings or information that should stay after the board is turned off.
Click to reveal answer
beginner
How do you write a byte to EEPROM in Arduino?
Use the function EEPROM.write(address, value); where address is the memory location and value is the byte to store.
Click to reveal answer
beginner
How do you read a byte from EEPROM in Arduino?
Use the function EEPROM.read(address); to get the byte stored at the given address.
Click to reveal answer
intermediate
Why should you limit EEPROM writes?
EEPROM has a limited number of write cycles (usually 100,000). Writing too often can wear it out and cause data loss.
Click to reveal answer
intermediate
How can you store multiple settings in EEPROM?
You can store each setting at a different address or use a structure and save it as bytes. Remember to read and write each setting carefully to avoid overwriting.
Click to reveal answer
What happens to EEPROM data when Arduino is powered off?
AData is erased automatically
BData is copied to RAM
CData becomes random
DData is saved and remains intact
✗ Incorrect
EEPROM keeps data even when power is off, unlike RAM which loses data.
Which function writes a byte to EEPROM in Arduino?
AEEPROM.read()
BEEPROM.write()
CEEPROM.store()
DEEPROM.save()
✗ Incorrect
EEPROM.write(address, value) stores a byte at the specified address.
What is a common limit of EEPROM write cycles?
A100,000 times
B100 times
C10,000 times
D10 times
✗ Incorrect
EEPROM typically supports about 100,000 write cycles before wearing out.
How do you read a byte from EEPROM?
AEEPROM.write(address)
BEEPROM.get(address)
CEEPROM.read(address)
DEEPROM.load(address)
✗ Incorrect
EEPROM.read(address) returns the byte stored at the given address.
What is a good practice when storing multiple settings in EEPROM?
AUse different addresses or a structure for each setting
BAvoid reading settings
CWrite settings every second
DStore all settings at the same address
✗ Incorrect
Using different addresses or a structure prevents overwriting and keeps data organized.
Explain how EEPROM can be used to save and retrieve a user setting on Arduino.
Think about how to save a value and get it back even after turning off the Arduino.
You got /4 concepts.
Describe why it is important to limit the number of writes to EEPROM and how you might do that in a program.
Consider the lifespan of EEPROM and how to avoid unnecessary writes.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of using EEPROM in an Arduino program?
easy
A. To increase the speed of the program
B. To store data permanently even when the power is off
C. To connect to the internet
D. To control the brightness of an LED
Solution
Step 1: Understand EEPROM functionality
EEPROM memory keeps data saved even if the Arduino loses power.
Step 2: Compare options with EEPROM purpose
Only To store data permanently even when the power is off describes permanent data storage, which matches EEPROM use.
Final Answer:
To store data permanently even when the power is off -> Option B
Quick Check:
EEPROM stores permanent data = A [OK]
Hint: EEPROM saves data without power loss [OK]
Common Mistakes:
Confusing EEPROM with RAM (temporary memory)
Thinking EEPROM speeds up the program
Mixing EEPROM with internet or LED control
2. Which of the following is the correct syntax to write the value 42 to EEPROM address 10?
easy
A. EEPROM.save(42, 10);
B. EEPROM.read(10, 42);
C. EEPROM.write(10, 42);
D. EEPROM.store(10, 42);
Solution
Step 1: Recall EEPROM write syntax
The correct function to save data is EEPROM.write(address, value);.
Step 2: Match syntax with options
Only EEPROM.write(10, 42); uses EEPROM.write with correct parameter order.
Final Answer:
EEPROM.write(10, 42); -> Option C
Quick Check:
Write uses EEPROM.write(address, value) = D [OK]
Hint: Use EEPROM.write(address, value) to save data [OK]
Common Mistakes:
Using EEPROM.read() to write data
Using non-existent functions like EEPROM.store()
Swapping address and value parameters
3. What will be the output of this Arduino code snippet?
EEPROM.write(5, 100);
int val = EEPROM.read(5);
Serial.println(val);
medium
A. Error
B. 0
C. 5
D. 100
Solution
Step 1: Understand EEPROM write and read
The code writes 100 to address 5, then reads from address 5.
Step 2: Predict Serial output
Reading address 5 returns 100, so Serial.println prints 100.
Final Answer:
100 -> Option D
Quick Check:
Write 100, read 100 = A [OK]
Hint: Read returns last written value at address [OK]
Common Mistakes:
Expecting read to return address instead of value
Confusing EEPROM.read() with EEPROM.write()
Assuming default value 0 without write
4. Identify the error in this code that tries to save a setting to EEPROM:
int setting = 25;
EEPROM.read(0, setting);
medium
A. Using EEPROM.read() instead of EEPROM.write() to save data