Using SD Cards with Arduino - Record Servo Motor Movements

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • SD and microSD cards are an ideal way to store large amounts of non-volatile data for your Arduino projects. Today I will show you how to use SD card modules in your Arduino designs. I’ll also build a servo motor position recorder that can record and playback the motion of a servo motor.
    Full article with code - dronebotworkshop.com/sd-card-...
    More articles and tutorials: dronebotworkshop.com
    Join the conversation on the forum: forum.dronebotworkshop.com
    Subscribe to the newsletter and stay in touch: dronebotworkshop.com/subscribe/
    Today I will take a look at SD and microSD card modules. These are a simple way of adding storage to your Arduino projects.
    SD cards have been around since the turn of the century and are used in a variety of electronic devices. I’m sure you probably have several of them for your phone, tablet, music player or camera. If you use a Raspberry Pi a microSD card is used to hold your operating system and data, it basically takes the place of a hard drive in this case.
    It is very simple to use SD cards with the Arduino. They connect via the SPI bus and the Arduino IDE has a built-in library to work with them.
    I’ll show you how to connect a microSD card module to an Arduino Uno and how to use some of the sample code that is included with the library. This includes code to read and write files to the card, as well as a Datalogger that can record the position of three potentiometers.
    After we master the sample code we will create a small project.
    Our project will have a servo motor and potentiometer along with the microSD card module. You will be able to move the servo using the pot and record its movements on the microSD card. After that, I’ll show you how to play those movements back.
    You can use this code “as-is” or expand upon it to use more servos, perhaps to control a robot arm. You could also use it to record DC motors, LEDs or pretty well anything else you can think of.
    Here are the contents of today's video:
    00:00 - Introduction
    02:20 - SD and microSD Card Module introduction
    05:44 - ReadWrite Example
    11:53 - Datalogger Example
    18:56 - DumpFile Example
    21:46 - Servo Recorder
    27:25 - Servo Playback
    As always you will find a detailed article to accompany this video on the DroneBot Workshop website. The article also has the code for the servo motor recorder and player in a handy ZIP file.
    Hopefully, this will inspire you to include SD cards in your next Arduino design.
    And if you aren’t a subscriber yet please do subscribe to the CZcams channel. That way you won’t miss out on any of the videos.
  • Jak na to + styl

Komentáře • 256

  • @lesrstoxsal1764
    @lesrstoxsal1764 Před 4 lety +92

    Dear DroneBot,
    You are definitely one of the great explainators on youtube ! Cause:
    1. You just don't constantly whirling around with the cursor on de screen.
    2. You just don't play any strange music in the background.
    3. You articularly perfect and extremely effective.
    4. You take the time to explain everything accurately.
    > You are the absolute best, so keep on going strong !!!

  • @mihaiadam4024
    @mihaiadam4024 Před 5 lety +81

    The world needs more people like you, very, very good job explaining, thank you, and hope to see more from you. Best regards.

    • @spencoid1
      @spencoid1 Před 3 lety +2

      most technical youtubers just don't get that we (or at least I) want information not entertainment, thanks for such a clear no BS presentation

  • @KikiTay
    @KikiTay Před 5 lety +19

    You are incredibly generous to share your skill and knowledge to the world. The amount of work and effort you put into making it so simple to understand is incredible! I learnt a lot! Thanks for doing this, I'm extremely grateful!

  • @daiseman
    @daiseman Před 4 lety +8

    The clearest, most consistent and useful Arduino content on CZcams. I'm hooked.
    Keep up the great work.

  • @fenylmecc6347
    @fenylmecc6347 Před 5 lety +35

    Your videos are the best and easiest to understand

  • @davidbelchamber6102
    @davidbelchamber6102 Před 4 lety +4

    As with everyone else, thank you for the outstanding videos. I’ve finished building the mechanical aspects of a 4 servo CNC 3D wire, rod and tube bending machine. I’m about to add a number of optical interrupter limit switches, a touchscreen lcd control panel and an SD card reader. My knowledge of C++ is growing daily and the software design is underway. None of this would or could have happened without your videos. Profound thanks.

  • @Mystic0Dreamer
    @Mystic0Dreamer Před 5 lety +8

    Thank you, thank you, thank you Bill. This was an absolutely wonderful video lesson. I wasn't aware that using an SD card on an Arduino was so easy. I will definitely be incorporating this feature into my robotic projects. I am so happy I found your CZcams Channel.

  • @paulhurd954
    @paulhurd954 Před 5 lety +8

    You look so happy! I’m glad you made the decision to make this your full time job. Well done and thank you for all the great videos

  • @kingshahzad78
    @kingshahzad78 Před 5 lety +7

    One of the best video. Your tools arrangement at the back shows that you are very organized man. Great

  • @timothynicholson8231
    @timothynicholson8231 Před 4 lety +4

    Just what I needed! Thank you for putting all this information in one spot!!!

  • @wernerberry7800
    @wernerberry7800 Před 5 lety +13

    Thank you so much for a fantastic video! One of your best yet! Absolutely love it when you do projects with Arduino and teach how to code!! You are my favorite Channel on CZcams!!

  • @MrMarkatgrc
    @MrMarkatgrc Před 3 lety +2

    It's such wonderful the way
    you are analysing and "transmitting" to us your
    knowledgement. We Thank you from our heart for your precious work.

  • @tameral-rodainieh849
    @tameral-rodainieh849 Před 5 lety +6

    Excellent Thank you very much,please keep sharing your awesome Videos.
    I’m Beginner but I’m learning very quickly from your Channel .

  • @nareshprabhu8397
    @nareshprabhu8397 Před 4 lety +2

    Just what I was looking for. Nothing short nor nothing extra!

  • @ruelsarno5123
    @ruelsarno5123 Před 5 lety

    I love all the videos I watched with this channel (droneBot). They are very easy to understand and the step-by-step processes are well explained. Two thumbs up not only on this but all his videos!

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

    I wish I had found you when I started thinkering with the SD cards....it would have made my learning a lot easier. Great Video!!! thank you for sharing.

  • @michaelschneider5407
    @michaelschneider5407 Před 4 lety

    Thank you very much (currently from Germany). Your videos are very professional and very easy to understand. My sincere appreciation!

  • @paulbertrand8935
    @paulbertrand8935 Před 4 lety +8

    This channel is a 10.5 out of 10 - always incredibly helpful and well produced. I'd kill for you to do a similar video about playing back audio with SD cards

  • @danylipsker
    @danylipsker Před 4 lety

    As usual
    Your tutorials and method of teaching are of the highest quality
    Thank for being there for us

  • @kacperbardecki3671
    @kacperbardecki3671 Před rokem

    I love the subtle camera move here and there. And the neck turn.

  • @joeybennett887
    @joeybennett887 Před 2 lety

    You have no idea how much this helped…I can’t thank you enough!!

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

    oh sweet bud, just grabbed one of these for the Arduino Due / Eurorack drum machine project - to act as sample storage. Keep up the great work bud!

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

    I Thank you so much for what you do and do so well. It was a pleasure finding your video's.

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

    Excellent video as always, dear Bill. Thanks for putting so much effort which is helping me in learning all these topics.

    • @AlfieLab.
      @AlfieLab. Před 4 lety

      Vijay Khole czcams.com/video/Ub1Qcx1ZWsY/video.html

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

    Thank you!! I love your channel and subcribed. I'm a computer programmer, interrested in building my own hardware. You very well explain how to do this. I am sometimes struggling with why to add like other parts beside just the board and the addons, like resistance between led (not the case in this video). I guess thats beyond the scope of the videos and perfectly okay.
    I had an arduino starter kit already laying around, but didnt know how to get started. I have now ordered some extra parts and soon going to try to make my own plant watering system by measuring the soil moist.
    Love your vids. Thanks and I'll keep watching! 😎👍

  • @josephbonello163
    @josephbonello163 Před 5 lety +5

    Thank You ..You are a very good teacher

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

    Thank you, and hope to see more from you. Best regards.

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

    Awesome video good sir. I subbed the channel and the newsletter. I look forward to future videos.

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

    Hey Bill. I don't know if you read the comments from past videos but I just wanted to report that I ordered a bunch of SD modules and cards and they just came in and I followed your instructions and they work perfectly as expected.
    Thank you, thank you, thank you! This is so GREAT!

    • @AlfieLab.
      @AlfieLab. Před 4 lety

      Mystic Dreamer czcams.com/video/Ub1Qcx1ZWsY/video.html

  • @weetzinng2217
    @weetzinng2217 Před 5 lety

    Thank you so much for the detail explanation. keep up the good work

  • @alibehrouz9833
    @alibehrouz9833 Před 5 lety

    thanks Bil for your easy and important videos.

  • @BriT6245
    @BriT6245 Před 4 lety

    Fantastic video - thanks for your hard work making it!

  • @luberies
    @luberies Před 4 lety

    Marvelous explained! Thank you!

  • @ErnestoOportoBooks
    @ErnestoOportoBooks Před 4 lety

    Another very informative presentation, with an easy to follow pages. Your work is amazing. Very few presenters bother to provide the information that you do. The devil is in the details, and you provide every detail needed to learn more. Got bless you and our family.

  • @BooktownBoy
    @BooktownBoy Před rokem

    Really good video, thank you. Methodically explained and demonstrated, subbed.

  • @DSVidyasagar
    @DSVidyasagar Před 3 lety

    You explanation is soooo perfect.
    Really appreciate.

  • @hmdmddh
    @hmdmddh Před 5 lety

    Thank you for your easiest and clear explaination

  • @kijijikhalid601
    @kijijikhalid601 Před 2 lety

    You are among a GREAT MENTOR I ever met. I can't find The words to Thank you. This project just solve one of my big project to do, how the Robot can memorize the task to be executed. Thank you again

  • @roberthodgson3574
    @roberthodgson3574 Před 5 měsíci

    Perfect and clear explanation - thank you.

  • @hassan_ksu
    @hassan_ksu Před rokem

    Always great explanations.

  • @TheUnofficialMaker
    @TheUnofficialMaker Před 2 lety

    really cool, great details and explanation.

  • @simonbancroft8579
    @simonbancroft8579 Před 4 lety

    Superb tutorial, as usual. Thank you.

  • @abhijitrashinkar
    @abhijitrashinkar Před 2 lety

    Sir, no other word to address, I am very much impressed with your tutorial, I have subscribed, thank you by heart.

  • @croissantossus
    @croissantossus Před rokem

    Thank you for the very detailed explanation

  • @venkatyalamati3285
    @venkatyalamati3285 Před rokem

    Thank you so much for the clean explanation ☺️

  • @diego.alienigena
    @diego.alienigena Před 3 lety

    excellent, very clear explanation. I'll be using SD cards soon!

  • @ec11368
    @ec11368 Před rokem

    Thank you very much for your time and for all your efforts.

  • @phanxquang
    @phanxquang Před 2 lety

    This video explained very well. You are very good tutor and generous helper

  • @mehmetgul8686
    @mehmetgul8686 Před 4 lety

    thanks so much for your excellent tutorial, I used this tutorial for stepper motor and it is working, thanks again...

  • @siamtourist
    @siamtourist Před 3 lety

    Great work! Thank you for sharing

  • @stuartron29
    @stuartron29 Před 3 lety

    Thank you for all that you do, truly excellent

  • @MrBanzoid
    @MrBanzoid Před 3 lety

    Thanks for this very informative article. It's time to blow the dust off my case of Arduino bits'n'bobs and start playing with them again.

  • @taykarottis
    @taykarottis Před 5 lety

    Fantastic video. Even I get it right when you explaine it. ;) Thank you very much.

  • @bobbihansel
    @bobbihansel Před 2 lety

    Fantastic tutorial, thank you!

  • @akshayjose6555
    @akshayjose6555 Před 5 lety

    This video is gold for me

  • @asrajo5728
    @asrajo5728 Před rokem

    Thank you very much sir, your explanation is very easy to understand,
    I like that you process using the library that is already in the Arduino IDE. Unlike others using their library which makes the tutorial confusing.
    I hope you are always healthy and your business smoothly, thanks. Looking forward for your another tutorial

  • @MrGreenblatt
    @MrGreenblatt Před 4 lety +2

    For anyone having trouble with the CS pin...
    The CS (Chip Select) is also commonly referred to as SS (Slave Select). So, if your have a board and can't find the CS pin in the pinout, try looking for SS instead.

  • @vatsalmodi8352
    @vatsalmodi8352 Před 4 lety

    Thank you sir it was very good knowledge you are sharing.Thank you for the video you make

  • @jjjxxxaime
    @jjjxxxaime Před 3 lety

    Very useful and interesting.. thanks a lot for the valuable information

  • @101appsCoZa
    @101appsCoZa Před 4 lety

    excellent tutorial! thanks very much.

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

    Thanks very much for this video!

  • @conversationwithgod272
    @conversationwithgod272 Před 7 měsíci

    Great video from GREAT MAN.

  • @josephciaravino4115
    @josephciaravino4115 Před 3 lety

    Hi quality content! Love your channel!

  • @MrCutlerylover
    @MrCutlerylover Před 3 lety

    Paul Mcworther was right, you have one of the best techsites , keep on the good work!

  •  Před 3 lety +1

    Your videos are such pieces of education! Can't believe how much I've learned in an evening and how easy and entertaining that was.
    As a follow up to this video, how can I make a file browser to select the file I want to read on the SD card?
    Thanks for all 🙏

  • @sroongap
    @sroongap Před 2 lety

    Very good teaching video

  • @ve2sr
    @ve2sr Před 5 lety

    Wonderful job Congratulations!

  • @danielvanschalkwyk3749

    Incredible. Thanks!!

  • @kumarjha1729
    @kumarjha1729 Před 5 lety

    wonderful video great man!

  • @BekirBilge
    @BekirBilge Před 5 lety

    Great video. Thank You.

  • @conversationwithgod272
    @conversationwithgod272 Před 10 měsíci +1

    It's incredibly clear how well you explain things; you're quite intelligent. I wonder if you've registered any inventions yet?

  • @azyfloof
    @azyfloof Před 5 lety

    Ok I had NO idea these parsed actual file structures on the SD card! I just thought you could write/read raw data, and that was it. This makes these MUCH more attractive for future projects! :O
    Now I'm imagining my projects with Neopixels, but reading colour swatch/pattern data off of an SD card instead of from the firmware. This'll make it easier to upgrade/change colours and patterns :D

  • @josephdreamz
    @josephdreamz Před 3 lety +1

    this video is really helpfull

  • @homevibe9283
    @homevibe9283 Před rokem

    I love this tutorial

  • @tszulpinedo757
    @tszulpinedo757 Před 3 lety

    El orden de las herramientas en su laboratorio es simplemente inspirador... 😍

  • @dwalden74
    @dwalden74 Před 4 lety

    The Bob Ross of electronics. Love it.

  • @TheSammybot
    @TheSammybot Před 5 lety

    this is wicked thanks,
    and as many others said you explain it very well,now im just looking for a way to do this with multiple servos running Asynchronous and record there movements and play them back live.
    possible a project for another day.
    thanks

  • @northshorepx
    @northshorepx Před 5 lety

    thanks great tutorial!

  • @dijuathomas5955
    @dijuathomas5955 Před 4 lety

    Thanks you sir it's so help full

  • @arthus1971
    @arthus1971 Před 7 měsíci

    Bravisimo!!! Use The SD Card to save status of the micro and send it to sleep, when inactivity, wake up, read and save battery power. Greetings

  • @drdbbajpai
    @drdbbajpai Před 4 lety

    SIR, THANKS FOR YOUR CONTRIBUTION FOR ARDUINO LEARNERS AS WE AE NOVICES IN THIS FIELD AND WANT TOUNDERSTAND THE POWER OF FUNCTIONING ARDUINO AND RELATED PROJECTS

  • @davidshepherd7533
    @davidshepherd7533 Před 2 lety

    Fantastic!

  • @vegansynths7757
    @vegansynths7757 Před 4 lety

    FINALLY!!!!! A video showing how to record and playback input!!!!!! THANK YOU THANK YOU THANK YOU!!!!!!!!! P.S. Can you do a follow up showing how to record it to a timeline? one where the playback speed can be adjusted? I might be asking too much but thank you so much for this!!!!!

  • @AngryRamboShow
    @AngryRamboShow Před 5 lety

    Thanks as always, teacher.

    • @AlfieLab.
      @AlfieLab. Před 4 lety

      1085243 czcams.com/video/Ub1Qcx1ZWsY/video.html

  • @isoguy.
    @isoguy. Před 5 lety +1

    Would love to see more sensor arduino vids, combining sensors for practical uses like opening a greenhouse window e.g. temperature, humidity, servo/ stepper motor.
    When the humidity or tempetature gets to a cirtain level move servo/stepper to a certain position to open a window or if too cold close window and or turn on the heater. If humidity too low turn on water for 3 minutes.
    Log temperature/ humidity, sevo position, water on off every time it changes within say +/- 2○C, +/- 2% humidity and/ or every 5 minutes and save to a monthly data file on an sd card.
    Results could also be show live on web page sending you a message if cirtain perameters are exceeded.
    There are lots of vids showing how to use individual sensors but so few putting the sensors together for practical use.
    A project like this could be split across multiple videos to make individual series.
    Great vid and thank you for sharing
    👍 👍 👍

  • @ShahabSheikhzadeh
    @ShahabSheikhzadeh Před rokem

    This video is absolutely a work of art and I have a lot to learn when teaching students and creating content. Thank you for the work you do. What's the best way to support You? 😭

  • @malangputra3693
    @malangputra3693 Před 4 lety

    You the best sir

  • @ThiefKingBakuraX
    @ThiefKingBakuraX Před 5 lety

    Wonderful bro

  • @The1Creston
    @The1Creston Před 5 lety

    That was so fun!

    • @AlfieLab.
      @AlfieLab. Před 4 lety

      Creston Witte czcams.com/video/Ub1Qcx1ZWsY/video.html

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

    Great video as always! One note: The SD library now supports multiple open files.

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

      Yes your correct Scott, I actually realized that after I finished the recording!

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

      @@Dronebotworkshop You do a super job so no worries!

    • @MARS-GREENH0USE
      @MARS-GREENH0USE Před 4 lety

      All 5 of these sketches return error 0x000 etc. Been 3 days. None of this works. You never show how u upload the code and bootloaded

  • @techienomadiso8970
    @techienomadiso8970 Před 4 lety +1

    Good video

  • @camcompco
    @camcompco Před 2 lety

    To add to what others have already said . . .thank you for sharing your obvious wealth of knowledge in such a clear and cohesive way. Question, how would you introduce a feature to playback the servo motion in the same speed you recorded it, including pauses, etc . . . . Thank you for any assistance with this. All the best, John

  • @garybiggs9010
    @garybiggs9010 Před 4 lety +1

    Great vid, thanks! Can I use a SD card that has music recorded on it and layer over that with a file to move a servo to match the music? This would be for like a dancing Santa prop.

  • @magmagth4346
    @magmagth4346 Před 2 lety +1

    Many thanks 🙏🌹

  • @amelliamendel2227
    @amelliamendel2227 Před 4 lety

    I love your videos. The one thing is I really wish you had more of a range of very inexpensive I've seen that mean less than a dollar to just under$50

  • @HelloThere-ph3zb
    @HelloThere-ph3zb Před 4 lety

    You're doing a great job in your tutorials. I will forward your site to others that want to learn, especially women that want to learn code. I also love your "BLUE" shop color scheme. Was that your concept or a interior decorator? What city/country are you in? Thanks, Best Wishes

  • @Alex-eu6kn
    @Alex-eu6kn Před 5 měsíci

    Nice explanaition. I did similar things. Worte a python app on Linux connected a PS4 Controller via BT and records the data on the PC and visualize the JoystickPositions. By developing that I noticed that it is important to write a timer for each dataset (mean per array row). Keep in mind that the microcontroller may cannot read and proceed the data in realtime. If you plan for example sound synchronised animatronics you need to have a timer based data structure. Otherwise it will go thru faster or lower than you planned.

  • @mohammedalsaleh8089
    @mohammedalsaleh8089 Před 2 lety

    thank you so much :)

  • @mog99lie
    @mog99lie Před 4 lety

    Greetings from Germany and thank you for the video. I have just finished my 6 axis arm and looking for a Ardunio program to control it and only came across your channel this evening. You have asked for suggestions for more videos?? I have two. First, what about a push button switch for start and finish points for the servo to record the location, that would save a lot of memory and perhaps the S card would not be needed? If using multi servos it would also enable every servo to go to the final position directly. My second request (If not already requited) is a guide around your workshop, looking around your shop you are well organise, I wish I was!! I can do simple programming with the Aruino and learning all the time, it is great but I will be 70 very soon so I want to run before I can walk!!! Ha Ha!!

  • @mahmoudsayedel-shakhs5355

    Very good