Using EEPROM with Arduino - Internal & External

  Переглядів 190,297

DroneBot Workshop

DroneBot Workshop

День тому

Today we will learn how to use EEPROM with an Arduino to add nonvolatile memory to our projects.
Article with code: dronebotworkshop.com/eeprom-a...
More projects and tutorials: dronebotworkshop.com
Chat about this on the Forum: forum.dronebotworkshop.com
Join the Newsletter: dronebotworkshop.com/subscribe/
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!

КОМЕНТАРІ: 213
@ezrabarrow2005
@ezrabarrow2005 4 роки тому
your voice is so calming. you're like an electronics bob ross
@GhettoRanger01
@GhettoRanger01 4 роки тому
The lisp is kinda catchy, too.
@learningpower9437
@learningpower9437 4 роки тому
Fully....agree...He just needs start painting some arduino...few trees...here and there...
@ezrabarrow2005
@ezrabarrow2005 4 роки тому
@@learningpower9437 happy little microcontrollers
@dwalden74
@dwalden74 4 роки тому
Let’s give this arduino a little friend.
@somebody9033
@somebody9033 3 роки тому
@@dwalden74 I thought it was lip synced lol
@jacquesmertens3369
@jacquesmertens3369 4 роки тому
Sir, I can't thank you enough for this fantastic channel. It's the only UKposts channel where I never interrupt any advertisment so that you have a bit of extra income. Keep up the good work.
@waswestkan
@waswestkan 4 роки тому
Clearly not, the only UKposts channel, that doesn't have *video* *interrupting* advertising. Then you and I probably never have seen every channel, however I have seen enough to of them to falsify your assertion.
@frankbose544
@frankbose544 3 роки тому
I don't think they actually get extra money if u watch the hole ad but idk
@shamrithponlingam1656
@shamrithponlingam1656 2 роки тому
@@frankbose544 for the video ads you have to watch them for at least two thirds and for the ads that is like in the lower half of the video, you have to go to the website.
@EmirUysal
@EmirUysal 3 роки тому
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.
@brigosx
@brigosx 4 роки тому
Welcome back Bill. It's nice to see you again in Workshop. You inspire us man. Thank you !!!
@danjason2167
@danjason2167 4 роки тому
dude,loved the production value with the multiple-camera setup, didn't expect that from a tutorial video like this well done sir
@gweliver
@gweliver 4 роки тому
AWESOME!Just what I've been starting to research!!! Thanks for the AWESOME CHANNEL
@musaadejoshuaibuopaluwa1712
@musaadejoshuaibuopaluwa1712 4 роки тому
I missed your videos. Welcome back and I hope your videos will keep coming in. Thank you and welcome back
@imadjawad4408
@imadjawad4408 4 роки тому
Organized, detailed, informative and educational I love this channel
@edsonkiyohara
@edsonkiyohara 4 роки тому
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!!!
@dalar2
@dalar2 4 роки тому
fantastic video - you explain everything in full detail, thanks dronebot!
@stevetobias4890
@stevetobias4890 4 роки тому
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.
@gasko2762
@gasko2762 4 роки тому
Thank you for the excellent work on the topic, I always like to come here when something new comes out.
@janetmccusker9512
@janetmccusker9512 4 роки тому
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.
@ReneStover
@ReneStover Рік тому
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!
@bluescream7463
@bluescream7463 4 роки тому
So great to have you back and again a super kristal-clear video. It would be so nice if could give 2 thumbs up! Thanks for sharing your knowledge !
@robertwillemsen368
@robertwillemsen368 4 роки тому
Nice to see you back! Thank you. Nice video again
@kellyklaask7su990
@kellyklaask7su990 4 роки тому
Great video! I'm just learning so all this stuff you show is new to me. Thanks for taking the time to do these videos!
@raymondmichael4987
@raymondmichael4987 4 роки тому
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
@frankmayo1410
@frankmayo1410 4 роки тому
Recently found your Your tube page, great stuff and you're a great instructor! I'll be watching many more! Thank you!!
@kevingrimshire7462
@kevingrimshire7462 2 роки тому
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!
@luberies
@luberies 4 роки тому
Your videos are teaching works of art. Thank you very much!
@rongeernaert1208
@rongeernaert1208 4 роки тому
Much learned from an EEPROM in this great video.
@mikepennington8088
@mikepennington8088 4 роки тому
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".
4 роки тому
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 )
@AlienWacker
@AlienWacker 4 роки тому
OMG this is the COOLEST VIDEOS I HAVE EVER SEEN YOU MAKE!
@paarthsstudio
@paarthsstudio 2 роки тому
Thanks a lot for explaining about EEPROM so well and in detail. You got a new subscriber!
@simonndungu1196
@simonndungu1196 4 роки тому
New to the channel and I love your way of explaining stuff. Thanks and Cheers Man
@wardprocter2371
@wardprocter2371 4 роки тому
Excellent, well explained tutorial! Thanks!
@dleland71
@dleland71 3 роки тому
That experiment was so cool!
@Good-Enuff-Garage
@Good-Enuff-Garage 9 місяців тому
brilliant presentation, thank you so much
@jnecece
@jnecece 4 роки тому
Your explanation is one of the best.
@maybornelectronics7944
@maybornelectronics7944 4 роки тому
AS USUAL, FANTASTIC EXPLANATION.
@Lunolux
@Lunolux 4 роки тому
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)
@republicoftutorials6068
@republicoftutorials6068 2 роки тому
Your channel is fantastic, one of the best electronic channel on entire youtube Thank you sir
@StrsAmbrg
@StrsAmbrg 2 роки тому
You are a very kind Gentleman.
@jimkirk360
@jimkirk360 4 роки тому
Always enjoy your videos
@petercall4267
@petercall4267 4 роки тому
Fantastic channel! Thanks so much for your inspirational teaching!
@ThePixel1983
@ThePixel1983 4 роки тому
Thank you! I was planning to add an SD card to my led matrix display, but 1kb on the Nano should be enough! ❤️
@gasko2762
@gasko2762 4 роки тому
Simple and easy to understand video. I love your videos
@hadireg
@hadireg 4 роки тому
GREATLY EXPLAINED!! 👍👍👍👌 Thank you!
@thilinawijebandara3232
@thilinawijebandara3232 2 роки тому
Thank you so much for making such a wonderful explanation with the experiments. You are the one of best youtuber I have seen in you tube. . Thank you again 🙂👍 Go ahead sir.
@josephbonello163
@josephbonello163 4 роки тому
Thank you Sir ..Love all your video's you are a great teacher
@jagannathkulkarni
@jagannathkulkarni Рік тому
Thank you for the magnificent video. Learned a lot from you !
@samuelgeorge6756
@samuelgeorge6756 3 роки тому
Thank you sir. Thats how you teach something well. Great !
@ALiALi-rm3pp
@ALiALi-rm3pp 4 роки тому
Thank you for your great work
@GerardWassink
@GerardWassink 3 роки тому
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...
@gmonkman
@gmonkman 3 роки тому
Really clearly explained. TYVM
@electronic7979
@electronic7979 4 роки тому
Helpful information. I like it
@billglass5160
@billglass5160 2 роки тому
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 100000 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 100000 weeks or 1923 years!!
@bik35
@bik35 4 роки тому
Great video as usual. Best Regards.
@lisandroiaffar4501
@lisandroiaffar4501 Рік тому
Just impecable, thank you so much!!!
@shivamdeshpande1959
@shivamdeshpande1959 3 роки тому
Thanks a lot sir!! It was really helpful
@ronalddhs3726
@ronalddhs3726 4 роки тому
Great tut! Thanks.
@stephenbarlin2314
@stephenbarlin2314 Рік тому
Indeed inspiring. Thankyou
@cokecamilo
@cokecamilo 9 місяців тому
THANK YOU!!!!!
@jeremyvi
@jeremyvi 4 роки тому
Quality content 👍
@Robolearning
@Robolearning Рік тому
Great Explainer !!!!!
@cybaneticcybanetic441
@cybaneticcybanetic441 2 роки тому
Wow first time I've seen a comprehensive use of an eeprom, he he he my projects are about to be interesting even more
@waswestkan
@waswestkan 4 роки тому
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
@melkiorwiseman5234
@melkiorwiseman5234 4 роки тому
If you still had it, it would probably be possible to replace the EEPROM with a new one. Maybe even one with a longer life.
@HamzaKhan-mf4ot
@HamzaKhan-mf4ot 3 роки тому
thank you for your great work sir.....
@rgdphome8974
@rgdphome8974 4 роки тому
Lovely, Sir.
@levelmastersystems117
@levelmastersystems117 4 роки тому
You are great man , Thanks
@foxanderson967
@foxanderson967 4 роки тому
that was amazing
@catalinalb1722
@catalinalb1722 4 роки тому
Hello Sir. Thank you for your great work by sharing your experience. What software are you using for the beautiful wiring diagrams?
@inferno6012
@inferno6012 4 роки тому
very informative new skills gained
@OsoPolarClone
@OsoPolarClone 4 роки тому
Great video
@meekirimusic
@meekirimusic 2 роки тому
great video
@jjjxxxaime
@jjjxxxaime 3 роки тому
Very interesting and nice video...thanks a lot
@PatnaikUC
@PatnaikUC 2 роки тому
Excellent as usual. Can the operation of the servo be carried out without using Arduino but only the EEPROM?
@mysterythecat971
@mysterythecat971 4 роки тому
Wonderful!
@VorpalForceField
@VorpalForceField 11 місяців тому
Excellent content .. Thank You for sharing .. Cheers :)
@ayganotomasyon1109
@ayganotomasyon1109 Рік тому
Very useful thank you.
@MJ-iy4fb
@MJ-iy4fb 3 роки тому
I love it! So you can record the movement and then replay it making the servo move exactly like it did before?
@amnesie6615
@amnesie6615 4 роки тому
Thank you!
@navodnandima4305
@navodnandima4305 2 роки тому
well explained and can understand anyone
@karte2626
@karte2626 4 роки тому
Great channel!!! Do you have any video about an analog isolator? That is, the input ranges from 0 to 5 volts and the output follows the range input 0 to 5 DCV. I appreciate!!!
@BarackBananabama
@BarackBananabama 4 роки тому
You may want to explain the fail mode of the EEPROM. What do you get if you write too many times? Could you read the last successfully written byte or not?
@basmangeorge
@basmangeorge 3 роки тому
Just want to say thank you.
@caffeinatedinsanity2324
@caffeinatedinsanity2324 3 роки тому
I bought EEPROMs on digikey that were capable of holding decent amounts of memory and could go as low as not even 1$ CAD so yes they are very inexpensve. However be ready to read datasheets since you are a huge variety of models made by a massive number of manufacturers. Like I bought some from Microchip. I better be ready to use the basic Wire.h commands haha. Speaking of, using sensors like AM2320 or the i2c eeprom I talked about, but only using basic I2C commands can be a great exercise to learn how to use the peripheral itself. Useful especially since not everything has an arduino library AND if you move to other platforms like STM32CubeIDE, you just learned something valuable Same for SPI, UART, etc...
@tomneto8791
@tomneto8791 2 роки тому
Very good
@hosseinbehdarvandi1504
@hosseinbehdarvandi1504 3 роки тому
very useful
@Arnodi_Project
@Arnodi_Project 4 роки тому
Good job.
@siddharthmali5841
@siddharthmali5841 4 роки тому
Great thank you sir 😊
@somebody9033
@somebody9033 3 роки тому
Thank you very much for this tutorial! One thing though, according to all resources I have found on the internet other than this one, EEPROM is measured in *kilobytes* not *kilobits*
@jimwhitehead1650
@jimwhitehead1650 3 роки тому
Well, not exactly... He's got it right. See ATmel AT24C32 (or 64) Datasheet. They are specified in Kilo bits (Kb). Divide by 8 and you'll get number of Kilo Bytes (KB). Hope this helps. Cheers!
@somebody9033
@somebody9033 3 роки тому
@@jimwhitehead1650 I am sorry but I have to disagree with you here. I have just checked the Arduino Uno's EEPROM size and it is 1024 bytes, however the tutorial erroneously says that the Arduino Uno has 1 *kilobit* of EEPROM.
@jimwhitehead1650
@jimwhitehead1650 3 роки тому
@@somebody9033 Sorry, you're absolutely correct that he misspoke about the ATmega328 uC EEPROM size: it's 1 kilobyte (KB). Perhaps I misunderstood the intention of your original comment "EEPROM is measured in kilobytes not kilobits". I am merely pointing out that external EEPROM (like what he accessed in his video), as a separate product, is marketed in kilobits (Kb). It can be confusing for someone new to the game. Nice catch on his ATmega328 EEPROM size comment, BTW 👍
@somebody9033
@somebody9033 3 роки тому
@@jimwhitehead1650 Thanks! Yes, I am not disputing what you said about external EEPROM but the internal one is definitely 1kB not 1kb. What makes it even more annoying is that the official arduino EEPROM tutorial on their website states that the size of the EEPROM is 1kB but then refers to kilobytes as kb, which is actually the symbol for kilobits...
@joshadikal1617
@joshadikal1617 4 роки тому
Teaching-Masterpiece. Thanks a lot for your help. Is this technique the better way to command a motor in real-time ? With a temperature sensor for examle ?
@sammyk7024
@sammyk7024 4 роки тому
A little heads up for my fellow enthusiasts: When the IDE says something like "low memory, things may get unstable" when compiling, well, it appears to be true. At least when dealing with the internal EEPROM. While playing around with it, I wrote a particularly long sketch, with several debug utilities. When running the sketch on a nano, after complaining of such low memory, EEPROM.length() would report extremely low values, eventually reaching ZERO! I thought I have ruined the internal EEPROM, after a couple dozens of write operations. Turns out it was just an "instability" issue. Reducing the sketch size (removing several debug utilities) solved the issue.
@placetoentertain6564
@placetoentertain6564 4 роки тому
Sir your explanation is excellent.sir upload video about wifi module esp8266
@user-ne7rc5hy2r
@user-ne7rc5hy2r 3 роки тому
This is a very nice introduction/DEMO of the EEPROM for very beginners. Although :: CAUTION :: the introducer is not mentioning something very fundamental. EEPROM 's blocks (namely addresses) CAN NOT store a number greater than 255 - unsigned integer - or a byte number. Thus in case you need to use it for a real/practic purpose you will need to develop a special Driver-software. In addition to the previous fact you will need to include to the software a piece of code that will prevent loss of data. As a general fact if you try to write a number to your memory and before finished the MCU come with power loss you will lose your data for sure. You want to store the data in order not to lose them but if your Driver is not a proper one there will be always a chance to lose them. Good luck !
@ahphorsheang4587
@ahphorsheang4587 4 роки тому
Thank you so much
@berndeckenfels
@berndeckenfels 4 роки тому
What’s the difference to the flash? Can you also compile to the eeprom?
@arthurfricchione8119
@arthurfricchione8119 4 роки тому
Just starting out in electronics where do you get the software. Just purchased the arduino uno and lookin for any instructional material I can find. Your channel was highly recommended so I am just beginning to follow it. Thanks for sharing Artie 👍
@pauldecastro1523
@pauldecastro1523 4 роки тому
thank you sensei! your so great! can i ask you questions?
@ser7ser7i
@ser7ser7i 4 роки тому
Thank you.
@harshvarshney5747
@harshvarshney5747 2 роки тому
Thank you, Sir for the nice video. I have a question, if we are using Arduino mega which have 4kb storage can we store a float value in it instead of int.
@abreytie
@abreytie 4 роки тому
Just a small add-in. ROM is normally programmed at silicon level during manufacture. PROM is Programmable Read Only Memory A windowless EPROM was available to be a pseudo-PROM EEPROM = Electrically Erasable Programmable Read Only Memory.
@davidbolha
@davidbolha 2 роки тому
Hi, Could you use the Arduino to reset/reprogram various BQXXXX ICs that are usually found in laptop batteries ? 🤔😕 Thanks &.... Best Regards,
@patrickmattele2013
@patrickmattele2013 Місяць тому
great channel thkx
@avejst
@avejst 4 роки тому
Greagt vidio Thanks for sharing👍😀
@TuanTran-xi4vs
@TuanTran-xi4vs 4 роки тому
Thanks for your this video clip, it's very easy to understand. Now I know how to use external EEPROM. if you can make a clip about arlarm clock which use the external EEPROM of I2C RST1307, that's a wonderful thing.
@nguyenangthang7473
@nguyenangthang7473 3 роки тому
Thanks for sharing, I'd like to ask if I want to send a list of values that (each value) larger than 1 byte into EEPROM so how would I change my code, thank you very much!
EEPROM Memory - Store Anything - Arduino101
13:16
Electronoobs
Переглядів 96 тис.
Using SD Cards with Arduino - Record Servo Motor Movements
31:53
DroneBot Workshop
Переглядів 191 тис.
Уроки Arduino. Работа с EEPROM памятью
10:35
Заметки Ардуинщика
Переглядів 73 тис.
MOSFETs and Transistors with Arduino
40:50
DroneBot Workshop
Переглядів 1 млн
Using an EEPROM to replace combinational logic
25:22
Ben Eater
Переглядів 1,4 млн
How to Run Linux on an ESP32
18:53
element14 presents
Переглядів 143 тис.
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
Rachel De Barros
Переглядів 364 тис.
How many times can you write to the Arduino EEPROM without killing it?
2:46
Replace EEPROMs with FLASH Memory from Scratch
5:05
Slu4
Переглядів 17 тис.
Arduino - How to Save a String into EEPROM
11:31
Robotics Back-End
Переглядів 15 тис.
Никто не помогал ему😢
0:30
Фильмы I Сериалы
Переглядів 1,6 млн
DO YOU LOVE HELPING THE HOMELESS | write ✍️?? ✍️
0:51
DO YOU LOVE HELPING THE HOMELESS | write ✍️?? ✍️
0:51
Normal vs Smokers !! 😱😱😱
0:12
Tibo InShape
Переглядів 9 млн