Using EEPROM with Arduino - Internal & External

preview_player
Показать описание
Today we will learn how to use EEPROM with an Arduino to add nonvolatile memory to our projects.

Nonvolatile memory refers to memory that retains its data even after being powered down. While there are many ways to accomplish this one of the simplest is by using EEPROM - Electrically Erasable Read-Only Memory.

The Arduino already has some EEPROM built-in, not too much, but for many applications it will be more than enough. You can use it to retain settings in your project. If you need more nonvolatile memory you can add an external EEPROM chip.

Today I will show you how to do both.

The Arduino's internal EEPROM is very easy to work with, thanks to the EEPROM library included within the Arduino IDE. The library comes with several small example sketches, and we’ll see how to use those sketches in our first demo.

We will also work with the AT24LC256, also called just the 24LC256 or 24C256. It’s an EEPROM chip that can store 256 Kilobits (or 32 KB) of data, and it uses the I2C bus for easy interfacing.

We will use the external EEPROM to record servo motor movements and then play them back. This would be perfect for an automated display. Of course, you can build upon the sample code to add EEPROM to almost any project.

Here is what we will cover today:

00:00 - Introduction
02:46 - Understanding EEPROMs
07:16 - Using Internal EEPROM
16:02 - Using External EEPROM

I’ll also cover some of the limitations of using EEPROMs, they are not entirely perfect. The biggest limitation is that they have a limited number of write operations, I’ll show you how you can reduce writes to the internal EEPROM by using the ”update” method.
I hope you enjoy the video!
Рекомендации по теме
Комментарии
Автор

Sir, I can't thank you enough for this fantastic channel. It's the only YouTube channel where I never interrupt any advertisment so that you have a bit of extra income.
Keep up the good work.

jacquesmertens
Автор

your voice is so calming. you're like an electronics bob ross <3

ezrabarrow
Автор

It almost comes naturally, this impulse to shower you and your channel with compliments. I feel grateful for having this information for free. So structured, neat, easy to follow and quite thorough.

And I see at the comments that I'm never alone. Your channel is my biggest ally as I started getting into electronics.

EmirUysal
Автор

Thank you for the great instruction, I taught electronics for 13 years, worked in the field altogether for 49 years, never had the opportunity to work on my own projects, and never worked with memory, other than using it in computers. I purchased a couple of Arduino Unos and parts kits, and have been meaning to get into learning how to use them in some projects. You have given me the drive to go ahead with my dreams, thank you!

ReneStover
Автор

If you are using the Tiny RTC module, there is an eeprom module available there also. According to the source that I found when researching why the address scan showed two for the Tiny RTC: "The clock doesn't use the EEPROM at all, it's just there as a convenient place to log data if you so desire".

WatchesTrainsAndRockets
Автор

This is the best channel to learn about electronics stuff. I seldom subscribe in any channel, but this I do recommend for everyone. All subject are presented in a clear manner, in clean and
neat and well organized workshop, and explained so well, paused and calm voice that everybody can understand even for who is not english native. Congratulation, I am your big fan!!!

edsonkiyohara
Автор

Thanks for this information, well presented, precise, and thorough. Very Useful!!! I was able to add an external EEPROM AT24C256 (32768x8) module to my Sensor prototype. I was initally planning to use an SDCard but it requires a lot of Arduino Nano program(40%) and data(49%) memory. My sensor program and data memory requires 50%, 72%. After installing the EEPROM module it uses only 53%, 72%. I am able to log approx. 28000 characters (2000 14-character strings). This enables me to monitor more than a week of sensor activity (air & water temperature, humidity, pool water level, Internet information, etc.). In addition, if I neglect checking the EEPROM when it is full, I added a circular address mode for the EEPROM. When I DO check it, I always have the most recent week's activity.

Another advantage of using the circular mode is its wear-leveling characteristic. One can only safely write times to a specific address before the EEPROM becomes unreliable. In my case, I am writing to any specific address only once per week, which gives me a guaranteed reliability for my EEPROM of weeks or 1923 years!!

billglass
Автор

dude, loved the production value with the multiple-camera setup, didn't expect that from a tutorial video like this well done sir

danjason
Автор

Welcome back Bill. It's nice to see you again in Workshop. You inspire us man. Thank you !!!

brigosx
Автор

Back in the day I decided to purchase an Alinco DJ-160 VHF portable transceiver, because it used an EEPROM, thus no need for a backup battery. Being aware the memory had a limited number of writes to it, I was conscious about of not changing the contents of the memory channels, unless I absolutely had to, which wasn't often because of the number of channels available. Alas within 5 years the radio quite retaing the memory. Much of my days then where spent outdoors in cold winters, and hot summers, the temperatures where never to the extremes, to make that a fac.tor. Video given, thumbs up, Channell, subscribed to, and bookmarked

waswestkan
Автор

AWESOME!Just what I've been starting to research!!!
Thanks for the AWESOME CHANNEL

gweliver
Автор

Have tried several libraries but none work as well as your code. A fantastic video and your code is so reliable - using it for a data logger and has not missed a beat - well done!

kevingrimshire
Автор

Great video, I am finding your videos very handy as someone who is just getting into Arduino to make learning basic electronics fun. My advanced starter kit and 45 sensor package should arrive in the next week or two. Have installed Arduino and playing with it to familiarise myself with the programming side. I would be lost already without your videos. So a huge thank you for putting in the time to create your content.

stevetobias
Автор

this is perfect but more importantly, it is you sir, the video description gives the big picture about the video not some "sit & dig in to find out" kind of videos, thanks; especially the last part of the description, thanks again.


Greetings from Tanzania

raymondmichael
Автор

In every single one of your videos the effort for building them as educational as possible just pours from my screen.. thank you very much for your effort.. regards from Paraguay! (psss.. in the middle of South America ;D )

Автор

I missed your videos. Welcome back and I hope your videos will keep coming in. Thank you and welcome back

musaadejoshuaibuopaluwa
Автор

Hi Bill, a tip: instead of using the number 13 for the internal LED it would be better to use the predefined LED_BUILTIN constant. This will hold the number of the internal LED dependent on the Arduino model you are working on...

GerardWassink
Автор

Welcome back Bill, was waiting for your new video.

On one of your earlier vids you mentioned using multiple I2C Masters.

That would be very useful and I hope you make the video soon.

janetmccusker
Автор

i spend many hour today watching your video, very good explanation and demo, great work,
i bought an arduino 2 year ago but never try to build something more complexe than the basic turn ON/OFF LED xD, and always found video about "arduino" very hard to understand, but your are the first one that explaine it so well, great job (sorry for my bad english)

Lunolux
Автор

Recently found your Your tube page, great stuff and you're a great instructor! I'll be watching many more! Thank you!!

frankmayo
join shbcf.ru