Make your Arduino “Remember” using the built in EEPROM - Tutorial

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • *There's an easter egg in this video, comment below if you saw it :)
    Power failure? No problem! Just use the Arduino EEPROM to save the state so you can restart from there when the power is restored.
  • Věda a technologie

Komentáře • 36

  • @zzzzzzz1729
    @zzzzzzz1729 Před 3 lety

    it really helps a lot man...your explanation for comments had cleared my doubts as well....Thanks for sharing 😊...!

  • @TechBuild
    @TechBuild Před 3 lety

    Great video, your explanation was clearly understandable. Thanks for sharing!

  • @akroutsamo
    @akroutsamo Před 5 lety +1

    thanks Mr, Ivan this is really a good Tuto (y) ;)
    it helps on my project that i still working on it

  • @ronvoy
    @ronvoy Před 2 lety

    thanks a lot man, that saves a lot resource and time than storing few bits of data in SD module.

  • @billglass5160
    @billglass5160 Před 2 lety

    Thanx for the video. I'm working on a library for storing and saving strings to internal or external EEPROM. You gave me an idea on what kind of functions are interesting to include in these libraries. This library will store your random number to one of 32768/1024 external/internal EEPROM addresses (address calculated automatically by the library). Each new random number will be stored at address+1 in a circular addressing mode. When you power up, the latest address will be again calculated by the library to enable you to fetch your latest random number. I'm doing this as a wear-levelling mechanism to prolonge the life of the EEPROM. You can only write 100000 times to any specific address. So now, you'll have about 100 million stores of your number before you have to change your Nano.

  • @stephanedenis5394
    @stephanedenis5394 Před 5 lety +1

    Very good tutorial, I was looking for a solution for a small project. It will help me. Thank you.

    • @BrainybitsCanada
      @BrainybitsCanada  Před 5 lety

      Thanks for watching Stephane, glad the video helped with your project. Cheers!

  • @stefanmayer444
    @stefanmayer444 Před 2 lety

    Thanks for the very good explanation!

  • @pileofstuff
    @pileofstuff Před 5 lety +3

    I assume seeding the random number generator (maybe a sample from one of the open analog pins) would make that random number sequence become a bit less predictable?

  •  Před 2 lety

    thank you so much for your tutorial!!

  • @BlondieSL
    @BlondieSL Před 9 měsíci

    I've been using EEPROM for a long time now on many projects.
    It's really handy when you have a larger project where you have setup configurations that you may need to change.
    For those who may have not used this before, I want to suggest that you be very careful of which locations you use and for how many bytes a variable may require.
    If it's just up to 256, no problem to keep locations close.
    BUT, if you have a variable that can get very large, where you need to use .put instead of .write, this is where you need to be aware of what can happen as the variable gets larger.
    This is something that I totally forgot about when I made a project that I called, "mini sump pump."
    This was a little pump that was triggered by a water level float that I made to detect when the water level in an area. The pump would be turned on to pump the water out.
    The water level float is an arm that I designed on the 3D printer with a gear end on it. When lifted or lowered, it moved a gear on a potentiometer. I use those number for low/high water levels.
    I have a setup page where I can set values to trigger the pump for on or off, based on a lower number and higher number.
    But here's where I messed up. LOL
    In location 0, I had the sketch keep a count of how many times the pump was cycled. I just wanted to get an idea of how much water was coming into the area.
    The bad part, was that I didn't just save the number now and then, rather, I updated it on every cycle.
    I used .put. The number grew to almost 300,000 and of course, more types were used.
    So what happened there, is that this over-wrote some configuration numbers and caused problems. OOOPS! LOL This caused the system to be glitchy and not run properly.
    So a few days ago, I re-wrote the sketch to not bother with the counter and now, all is working right again.
    I just thought that I'd share that and save people some headaches.

  • @electricswine1
    @electricswine1 Před 5 lety +1

    Great vid, thanks. I have a homeautomation project that this would come in handy. But what if you hit the reset button, would that clear the memory?

    • @BrainybitsCanada
      @BrainybitsCanada  Před 5 lety +1

      Great question! No The reset button just restarts the code on the Arduino. So the EEPROM memory doesn't get affected. Technicaly you can't really clear the EEPROM memory, I think that when you receive a brand new Arduino, all the bytes in the EEPROM will contain "ones" or are set to "11111111", or a decimal value of 255 . So I guess if you wanted to get back to that state you could do a FOR LOOP to write a value of 255 to all the bytes. Thank again for a great questions and for watching! Cheers!

  • @James_Maguire
    @James_Maguire Před 4 lety

    If your using an int I presume it must assign 2 address bytes so when how do you know what address to put in brackets

  • @Omarbg95
    @Omarbg95 Před 4 lety

    Thanks for sharing 💁

  • @taranagnew436
    @taranagnew436 Před 5 lety +1

    is there a way to store gifs or something on the memory of the chip on the uno?

    • @BrainybitsCanada
      @BrainybitsCanada  Před 5 lety

      The EEPROM memory is too small for pictures, but I have another video where I use the PROMEM memory to store some 16x16 pictures. Maybe it can help, check it out here: czcams.com/video/Q1iVtLQOZOI/video.html

  • @gsrathore97x
    @gsrathore97x Před 3 lety

    You teach me a lot and very important from 1:38

  • @dilshankasthuriarachchi4737

    Where does the codes get to this?

  • @mukageegee
    @mukageegee Před 4 lety

    Thank you for the great tutorial. Are you sure your name isn't Al? (tall Guy from Police Squad!)

    • @BrainybitsCanada
      @BrainybitsCanada  Před 4 lety

      Wow, totally forgot about that guy "Al" from Police Squad, had to google it... Thanks for the laugh!

  • @Hauketal
    @Hauketal Před 5 lety +2

    Don't forget there is a limited number of writes an EEPROM cell can handle, about 100000 is guaranteed. Write as rarely as possible and never in a short loop.

    • @BrainybitsCanada
      @BrainybitsCanada  Před 5 lety +1

      That's correct, but also those 100,000 Writes are for "each" byte of the EEPROM... So you can write 100,000 times to byte#0, 100,000 times to byte#1, etc, before the bytes memory becomes unreliable. Thank you for your comment and for watching.

  • @alibehrouz9833
    @alibehrouz9833 Před 5 lety +1

    greatttttttttt

  • @chronobot2001
    @chronobot2001 Před 11 měsíci

    Good video, but what I was hoping for was to see how to save two different numbers in that are as high as 60 million.

  • @brigittefarah2684
    @brigittefarah2684 Před 5 lety

    I saw the easter egg!

  • @garthhowe297
    @garthhowe297 Před 5 lety

    Tres bien (that's close to the limit of my French) I didn't know there was space available to store data... interesting... 1001 uses I think.

    • @BrainybitsCanada
      @BrainybitsCanada  Před 5 lety +1

      Hi Garth, long time no see, hope all is well! Yes having some non volatile memory (even if it's just a little bit) can be very useful. Thanks for watching and hope to see you again soon. Cheers!

  • @ericthered9655
    @ericthered9655 Před 3 lety

    Camp Crystal Lake! LMAO!

  • @prasadkirkire6311
    @prasadkirkire6311 Před 5 lety +1

    😘😊😊👍🏻👍🏻👍🏻❤️

  • @MrSasha3050
    @MrSasha3050 Před 5 lety +1

    Классно

  • @altamiradorable
    @altamiradorable Před 5 lety +1

    C'est pas "byte" ton affaire ! lol !

  • @Haamedtm
    @Haamedtm Před 5 lety +1

    what happened to your head?