Тёмный

Using EEPROM with Arduino - Internal & External 

DroneBot Workshop
Подписаться 598 тыс.
Просмотров 193 тыс.
50% 1

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!

Хобби

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 217   
@jacquesmertens3369
@jacquesmertens3369 4 года назад
Sir, I can't thank you enough for this fantastic channel. It's the only RU-vid 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 RU-vid 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.
@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
@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.
@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!
@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
@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!!!
@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.
@musaadejoshuaibuopaluwa1712
@musaadejoshuaibuopaluwa1712 4 года назад
I missed your videos. Welcome back and I hope your videos will keep coming in. Thank you and welcome back
@gweliver
@gweliver 4 года назад
AWESOME!Just what I've been starting to research!!! Thanks for the AWESOME CHANNEL
@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.
@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 !
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 )
@Dalamain
@Dalamain 4 года назад
fantastic video - you explain everything in full detail, thanks dronebot!
@imadjawad4408
@imadjawad4408 4 года назад
Organized, detailed, informative and educational I love this channel
@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".
@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 3 года назад
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!
@gasko2762
@gasko2762 4 года назад
Thank you for the excellent work on the topic, I always like to come here when something new comes out.
@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
@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!
@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)
@AlienWacker
@AlienWacker 4 года назад
OMG this is the COOLEST VIDEOS I HAVE EVER SEEN YOU MAKE!
@luberies
@luberies 4 года назад
Your videos are teaching works of art. Thank you very much!
@paarthsstudio
@paarthsstudio 2 года назад
Thanks a lot for explaining about EEPROM so well and in detail. You got a new subscriber!
@rongeernaert1208
@rongeernaert1208 4 года назад
Much learned from an EEPROM in this great video.
@simonndungu1196
@simonndungu1196 4 года назад
New to the channel and I love your way of explaining stuff. Thanks and Cheers Man
@dleland71
@dleland71 3 года назад
That experiment was so cool!
@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.
@republicoftutorials6068
@republicoftutorials6068 2 года назад
Your channel is fantastic, one of the best electronic channel on entire youtube Thank you sir
@wardprocter2371
@wardprocter2371 4 года назад
Excellent, well explained tutorial! Thanks!
@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
@StrsAmbrg
@StrsAmbrg 2 года назад
You are a very kind Gentleman.
@gasko2762
@gasko2762 4 года назад
Simple and easy to understand video. I love your videos
@petercall4267
@petercall4267 4 года назад
Fantastic channel! Thanks so much for your inspirational teaching!
@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!!
@jimkirk360
@jimkirk360 4 года назад
Always enjoy your videos
@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.
@maybornelectronics7944
@maybornelectronics7944 4 года назад
AS USUAL, FANTASTIC EXPLANATION.
@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! ❤️
@jnecece
@jnecece 4 года назад
Your explanation is one of the best.
@Good-Enuff-Garage
@Good-Enuff-Garage 10 месяцев назад
brilliant presentation, thank you so much
@jagannathkulkarni
@jagannathkulkarni Год назад
Thank you for the magnificent video. Learned a lot from you !
@hadireg
@hadireg 4 года назад
GREATLY EXPLAINED!! 👍👍👍👌 Thank you!
@lisandroiaffar4501
@lisandroiaffar4501 Год назад
Just impecable, thank you so much!!!
@GerardWassink
@GerardWassink 4 года назад
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...
@electronic7979
@electronic7979 4 года назад
Helpful information. I like it
@stephenbarlin2314
@stephenbarlin2314 Год назад
Indeed inspiring. Thankyou
@maybornelectronics7944
@maybornelectronics7944 20 дней назад
Simply superb explanation
@josephbonello163
@josephbonello163 4 года назад
Thank you Sir ..Love all your video's you are a great teacher
@samuelgeorge6756
@samuelgeorge6756 3 года назад
Thank you sir. Thats how you teach something well. Great !
@bik35
@bik35 4 года назад
Great video as usual. Best Regards.
@gmonkman
@gmonkman 3 года назад
Really clearly explained. TYVM
@jjjxxxaime
@jjjxxxaime 3 года назад
Very interesting and nice video...thanks a lot
@ronalddhs3726
@ronalddhs3726 4 года назад
Great tut! Thanks.
@ALiALi-rm3pp
@ALiALi-rm3pp 4 года назад
Thank you for your great work
@VorpalForceField
@VorpalForceField Год назад
Excellent content .. Thank You for sharing .. Cheers :)
@shivamdeshpande1959
@shivamdeshpande1959 3 года назад
Thanks a lot sir!! It was really helpful
@Robolearning
@Robolearning Год назад
Great Explainer !!!!!
@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?
@PatnaikUC
@PatnaikUC 2 года назад
Excellent as usual. Can the operation of the servo be carried out without using Arduino but only the EEPROM?
@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.
@ayganotomasyon1109
@ayganotomasyon1109 Год назад
Very useful thank you.
@meekirimusic
@meekirimusic 2 года назад
great video
@inferno6012
@inferno6012 4 года назад
very informative new skills gained
@rgdphome8974
@rgdphome8974 4 года назад
Lovely, Sir.
@levelmastersystems117
@levelmastersystems117 4 года назад
You are great man , Thanks
@OsoPolarClone
@OsoPolarClone 4 года назад
Great video
@HamzaKhan-mf4ot
@HamzaKhan-mf4ot 4 года назад
thank you for your great work sir.....
@jeremyvi
@jeremyvi 4 года назад
Quality content 👍
@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?
@mysterythecat971
@mysterythecat971 4 года назад
Wonderful!
@navodnandima4305
@navodnandima4305 2 года назад
well explained and can understand anyone
@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?
@tomneto8791
@tomneto8791 3 года назад
Very good
@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.
@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...
@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 ?
@hosseinbehdarvandi1504
@hosseinbehdarvandi1504 4 года назад
very useful
@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 !
@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 👍
@basmangeorge
@basmangeorge 4 года назад
Just want to say thank you.
@foxanderson967
@foxanderson967 4 года назад
that was amazing
@cokecamilo
@cokecamilo 11 месяцев назад
THANK YOU!!!!!
@patrickmattele2013
@patrickmattele2013 2 месяца назад
great channel thkx
@amnesie6615
@amnesie6615 4 года назад
Thank you!
@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.
@watchvideo7225
@watchvideo7225 6 месяцев назад
Great Vidoe as allways! I was originally planning to use the EEPROM to save a sensor calibration, but knowing that it can only store 8 Bits, the accuracy is probably not enough for that. Still useful information though, might come in handy at some point.
@siddharthmali5841
@siddharthmali5841 4 года назад
Great thank you sir 😊
@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!!!
@berndeckenfels
@berndeckenfels 4 года назад
What’s the difference to the flash? Can you also compile to the eeprom?
@Arnodi_Project
@Arnodi_Project 4 года назад
Good job.
@avejst
@avejst 4 года назад
Greagt vidio Thanks for sharing👍😀
@ahphorsheang4587
@ahphorsheang4587 4 года назад
Thank you so much
@ser7ser7i
@ser7ser7i 4 года назад
Thank you.
@masouddayaghi5923
@masouddayaghi5923 4 года назад
Dear Sir, thank a lot for your wonderful amazing video, I really learn a lot from your channels. I have a question here, I am using esp8266 for an ioT application, in the sleep mode my current is very high, in mA and not micro Ampere, should I use another function for it rather than ESP.deepSleep?
@melkiorwiseman5234
@melkiorwiseman5234 4 года назад
The most likely reason for this is that either your logic or your wiring is wrong. Your logic can be wrong if the sleep command somehow never gets executed, or if a software event such as a timer interrupt immediately takes the CPU out of sleep mode. Your wiring can be wrong if your CPU uses an external interrupt on one or more of its external pins, and that interrupt is being triggered when it shouldn't. The former is more likely. You'll need to carefully examine what the CPU does by default and make sure that something which is operating by default isn't causing a software interrupt. A hardware interrupt can be caused by stray electrical interference. A good way to deal with this is to ensure that all inputs are tied either high (for an active low interrupt) or low (for an active high interrupt) through a resistor of around 330-1K ohms.
@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!
@muhammadmcintee-masud5956
@muhammadmcintee-masud5956 4 года назад
If anyone is getting a return value of 255, make sure you are using the correct pins on your arduino board for the SDA and SCL of the EEPROM chip. According to the Wire.h library you should use the following: Board I2C / TWI pins Uno, Ethernet A4 (SDA), A5 (SCL) Mega2560 20 (SDA), 21 (SCL) Leonardo 2 (SDA), 3 (SCL) Due 20 (SDA), 21 (SCL), SDA1, SCL1
@melkiorwiseman5234
@melkiorwiseman5234 4 года назад
It's an Electrically Erasable *Programmable* Read Only Memory. First, there were ROMs. These were generally referred to as "mask programmed ROMs" and they were manufactured with the contents of their memory already defined. The memory contents could never be changed and if the program changed, it was necessary to remove the ROM and throw it away while installing a new ROM with the updated program. Then came PROMs, also known as fusible-link ROMs. These came with every bit pre-programmed as a 1, but by using a special programmer and a high voltage, it was possible to make some bits read a 0 instead of a 1. Again, these memories could not be reprogrammed and would generally have to be thrown away and a new ROM or PROM installed if the program ever changed. Next came EPROMs. These used a similar programming method as fusible-link ROMs, but they could be erased by several minutes of exposure to ultra-violet light, then reprogrammed. Finally came EEPROMs. With this technology, almost instant reprogramming could be performed with the memory chip still in the circuit, and high voltages were no longer required. Best of all, it was possible to make EEPROMs read-compatible with the earlier EPROMs. Here endeth the lesson. :)
Далее
I2C with Arduino and Raspberry Pi - Two Methods
30:13
Просмотров 201 тыс.
Can We Save Goku In 5 SECONDS⁉️😰 #dbz #goku
00:15
MC TAXI: АК-47
35:14
Просмотров 420 тыс.
Using an EEPROM to replace combinational logic
25:22
Просмотров 1,4 млн
Replace EEPROMs with FLASH Memory from Scratch
5:05
Просмотров 18 тыс.
EEPROM Memory - Store Anything - Arduino101
13:16
Просмотров 100 тыс.
74HC595 & 74HC165 Shift Registers with Arduino
40:38
Просмотров 392 тыс.
Using Servo Motors with Arduino
43:06
Просмотров 1,4 млн
AT24C04 EEPROM Programming using Arduino
8:01
Просмотров 16 тыс.
KINDNESS ALWAYS COME BACK
0:59
Просмотров 32 млн
NEGA XECHKIM LAYK BOSMAYDI
0:14
Просмотров 2,9 млн