Using SD Cards with Arduino - Record Servo Motor Movements

  Рет қаралды 195,079

DroneBot Workshop

DroneBot Workshop

Күн бұрын

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 KZbin channel. That way you won’t miss out on any of the videos.

Пікірлер: 256
@lesrstoxsal1764
@lesrstoxsal1764 3 жыл бұрын
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 !!!
@spencoid1
@spencoid1 3 жыл бұрын
yes!!! thanks for no crappy music!!!
@venkatyalamati3285
@venkatyalamati3285 Жыл бұрын
Yes....
@impossiblesquad140
@impossiblesquad140 Ай бұрын
he aint lettin u hit bru
@mihaiadam4024
@mihaiadam4024 5 жыл бұрын
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 3 жыл бұрын
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
@daiseman
@daiseman 4 жыл бұрын
The clearest, most consistent and useful Arduino content on KZbin. I'm hooked. Keep up the great work.
@davidbelchamber6102
@davidbelchamber6102 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.
@fenylmecc6347
@fenylmecc6347 5 жыл бұрын
Your videos are the best and easiest to understand
@paulhurd954
@paulhurd954 5 жыл бұрын
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
@KikiTay
@KikiTay 5 жыл бұрын
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!
@kingshahzad78
@kingshahzad78 5 жыл бұрын
One of the best video. Your tools arrangement at the back shows that you are very organized man. Great
@Mystic0Dreamer
@Mystic0Dreamer 5 жыл бұрын
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 KZbin Channel.
@wernerberry7800
@wernerberry7800 5 жыл бұрын
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 KZbin!!
@drjwilber
@drjwilber 4 жыл бұрын
(yep) ** 10
@timothynicholson8231
@timothynicholson8231 4 жыл бұрын
Just what I needed! Thank you for putting all this information in one spot!!!
@michaelschneider5407
@michaelschneider5407 4 жыл бұрын
Thank you very much (currently from Germany). Your videos are very professional and very easy to understand. My sincere appreciation!
@MrMarkatgrc
@MrMarkatgrc 3 жыл бұрын
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.
@kacperbardecki3671
@kacperbardecki3671 Жыл бұрын
I love the subtle camera move here and there. And the neck turn.
@nareshprabhu8397
@nareshprabhu8397 4 жыл бұрын
Just what I was looking for. Nothing short nor nothing extra!
@Mystic0Dreamer
@Mystic0Dreamer 5 жыл бұрын
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. 4 жыл бұрын
Mystic Dreamer kzbin.info/www/bejne/i5OUgpauZr-Kqbs
@ruelsarno5123
@ruelsarno5123 5 жыл бұрын
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!
@MrGreenblatt
@MrGreenblatt 4 жыл бұрын
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.
@paulbertrand8935
@paulbertrand8935 4 жыл бұрын
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
@paarthsstudio
@paarthsstudio 2 жыл бұрын
Nope its 20 out of 10
@joeybennett887
@joeybennett887 Жыл бұрын
You have no idea how much this helped…I can’t thank you enough!!
@tameral-rodainieh849
@tameral-rodainieh849 5 жыл бұрын
Excellent Thank you very much,please keep sharing your awesome Videos. I’m Beginner but I’m learning very quickly from your Channel .
@Taran72
@Taran72 5 жыл бұрын
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.
@danylipsker
@danylipsker 4 жыл бұрын
As usual Your tutorials and method of teaching are of the highest quality Thank for being there for us
@kijijikhalid601
@kijijikhalid601 2 жыл бұрын
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
@vk4865
@vk4865 5 жыл бұрын
Excellent video as always, dear Bill. Thanks for putting so much effort which is helping me in learning all these topics.
@AlfieLab.
@AlfieLab. 4 жыл бұрын
Vijay Khole kzbin.info/www/bejne/i5OUgpauZr-Kqbs
@ErnestoOportoBooks
@ErnestoOportoBooks 4 жыл бұрын
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.
@REDACT3D
@REDACT3D 5 жыл бұрын
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!
@josephbonello163
@josephbonello163 5 жыл бұрын
Thank You ..You are a very good teacher
@DSVidyasagar
@DSVidyasagar 3 жыл бұрын
You explanation is soooo perfect. Really appreciate.
@BooktownBoy
@BooktownBoy Жыл бұрын
Really good video, thank you. Methodically explained and demonstrated, subbed.
@alibehrouz9833
@alibehrouz9833 5 жыл бұрын
thanks Bil for your easy and important videos.
@roberthodgson3574
@roberthodgson3574 4 ай бұрын
Perfect and clear explanation - thank you.
@gasko2762
@gasko2762 5 жыл бұрын
Thank you, and hope to see more from you. Best regards.
@phanxquang
@phanxquang 2 жыл бұрын
This video explained very well. You are very good tutor and generous helper
@ec11368
@ec11368 Жыл бұрын
Thank you very much for your time and for all your efforts.
@hmdmddh
@hmdmddh 5 жыл бұрын
Thank you for your easiest and clear explaination
@EarlGray_kd7sjt
@EarlGray_kd7sjt 5 жыл бұрын
Awesome video good sir. I subbed the channel and the newsletter. I look forward to future videos.
@luberies
@luberies 4 жыл бұрын
Marvelous explained! Thank you!
@croissantossus
@croissantossus Жыл бұрын
Thank you for the very detailed explanation
@abhijitrashinkar
@abhijitrashinkar 2 жыл бұрын
Sir, no other word to address, I am very much impressed with your tutorial, I have subscribed, thank you by heart.
@BriT6245
@BriT6245 4 жыл бұрын
Fantastic video - thanks for your hard work making it!
@MrBanzoid
@MrBanzoid 3 жыл бұрын
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.
@hywelthomas7797
@hywelthomas7797 5 жыл бұрын
I Thank you so much for what you do and do so well. It was a pleasure finding your video's.
@arthus1971
@arthus1971 6 ай бұрын
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
@hassan_ksu
@hassan_ksu Жыл бұрын
Always great explanations.
@weetzinng2217
@weetzinng2217 5 жыл бұрын
Thank you so much for the detail explanation. keep up the good work
@venkatyalamati3285
@venkatyalamati3285 Жыл бұрын
Thank you so much for the clean explanation ☺️
@erikw8644
@erikw8644 5 жыл бұрын
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! 😎👍
@MrCutlerylover
@MrCutlerylover 3 жыл бұрын
Paul Mcworther was right, you have one of the best techsites , keep on the good work!
@TheUnofficialMaker
@TheUnofficialMaker 2 жыл бұрын
really cool, great details and explanation.
@tszulpinedo757
@tszulpinedo757 3 жыл бұрын
El orden de las herramientas en su laboratorio es simplemente inspirador... 😍
@diego.alienigena
@diego.alienigena 3 жыл бұрын
excellent, very clear explanation. I'll be using SD cards soon!
@simonbancroft8579
@simonbancroft8579 4 жыл бұрын
Superb tutorial, as usual. Thank you.
@mehmetgul8686
@mehmetgul8686 4 жыл бұрын
thanks so much for your excellent tutorial, I used this tutorial for stepper motor and it is working, thanks again...
@akshayjose6555
@akshayjose6555 5 жыл бұрын
This video is gold for me
@asrajo5728
@asrajo5728 Жыл бұрын
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
@stuartron29
@stuartron29 3 жыл бұрын
Thank you for all that you do, truly excellent
@siamtourist
@siamtourist 3 жыл бұрын
Great work! Thank you for sharing
@dwalden74
@dwalden74 4 жыл бұрын
The Bob Ross of electronics. Love it.
@bobbihansel
@bobbihansel 2 жыл бұрын
Fantastic tutorial, thank you!
@azyfloof
@azyfloof 5 жыл бұрын
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
@taykarottis
@taykarottis 5 жыл бұрын
Fantastic video. Even I get it right when you explaine it. ;) Thank you very much.
@101appsCoZa
@101appsCoZa 4 жыл бұрын
excellent tutorial! thanks very much.
@BrisbaneStomp
@BrisbaneStomp 9 ай бұрын
Thanks very much for this video!
@danielvanschalkwyk3749
@danielvanschalkwyk3749 4 жыл бұрын
Incredible. Thanks!!
@vegansynths7757
@vegansynths7757 3 жыл бұрын
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!!!!!
@vatsalmodi8352
@vatsalmodi8352 4 жыл бұрын
Thank you sir it was very good knowledge you are sharing.Thank you for the video you make
@jjjxxxaime
@jjjxxxaime 3 жыл бұрын
Very useful and interesting.. thanks a lot for the valuable information
@conversationwithgod272
@conversationwithgod272 7 ай бұрын
Great video from GREAT MAN.
@ve2sr
@ve2sr 5 жыл бұрын
Wonderful job Congratulations!
@Alex-eu6kn
@Alex-eu6kn 5 ай бұрын
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.
@sroongap
@sroongap 2 жыл бұрын
Very good teaching video
@josephciaravino4115
@josephciaravino4115 3 жыл бұрын
Hi quality content! Love your channel!
@ShahabSheikhzadeh
@ShahabSheikhzadeh Жыл бұрын
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? 😭
@homevibe9283
@homevibe9283 Жыл бұрын
I love this tutorial
@BekirBilge
@BekirBilge 5 жыл бұрын
Great video. Thank You.
@dijuathomas5955
@dijuathomas5955 4 жыл бұрын
Thanks you sir it's so help full
@UReasonIt
@UReasonIt 5 жыл бұрын
Great video as always! One note: The SD library now supports multiple open files.
@Dronebotworkshop
@Dronebotworkshop 5 жыл бұрын
Yes your correct Scott, I actually realized that after I finished the recording!
@UReasonIt
@UReasonIt 5 жыл бұрын
@@Dronebotworkshop You do a super job so no worries!
@MARS-GREENH0USE
@MARS-GREENH0USE 4 жыл бұрын
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
@AngryRamboShow
@AngryRamboShow 5 жыл бұрын
Thanks as always, teacher.
@AlfieLab.
@AlfieLab. 4 жыл бұрын
1085243 kzbin.info/www/bejne/i5OUgpauZr-Kqbs
@kumarjha1729
@kumarjha1729 4 жыл бұрын
wonderful video great man!
@drdbbajpai
@drdbbajpai 3 жыл бұрын
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
@josephdreamz
@josephdreamz 3 жыл бұрын
this video is really helpfull
@northshorepx
@northshorepx 5 жыл бұрын
thanks great tutorial!
@isoguy.
@isoguy. 5 жыл бұрын
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 👍 👍 👍
3 жыл бұрын
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 🙏
@Wajiduddaim
@Wajiduddaim 4 жыл бұрын
3:24 if its 32 Gega Byte, 2 Tera Byte and 128 Tera Byte than you should Use Capital "B" because the small "b" stands for "bit"
@conversationwithgod272
@conversationwithgod272 9 ай бұрын
It's incredibly clear how well you explain things; you're quite intelligent. I wonder if you've registered any inventions yet?
@user-iv7er8du5m
@user-iv7er8du5m 4 жыл бұрын
Many thanks
@inferno6012
@inferno6012 3 жыл бұрын
note you can use icsp pins those are at the bottom as spi pins
@The1Creston
@The1Creston 5 жыл бұрын
That was so fun!
@AlfieLab.
@AlfieLab. 4 жыл бұрын
Creston Witte kzbin.info/www/bejne/i5OUgpauZr-Kqbs
@TheSammybot
@TheSammybot 5 жыл бұрын
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
@amelliamendel2227
@amelliamendel2227 4 жыл бұрын
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
@malangputra3693
@malangputra3693 4 жыл бұрын
You the best sir
@davidshepherd7533
@davidshepherd7533 Жыл бұрын
Fantastic!
@syaduinotech3681
@syaduinotech3681 3 жыл бұрын
I wish there are videos from dronebot about sd card and sensor
@camcompco
@camcompco 2 жыл бұрын
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
@PatnaikUC
@PatnaikUC 3 жыл бұрын
Excellent. Can you extend it to 16 servos using Arduino servo shield 2+16 or the SD card with one joystick to record the position of each servo and play automatically thereafter
@pantac4493
@pantac4493 5 жыл бұрын
Can this be used for setting different variables that it reads from the txt file? (I could change blinking rate of led, pin numbers, etc.) all from variables on sd card? Thanks
@magmagth4346
@magmagth4346 2 жыл бұрын
Many thanks 🙏🌹
@techienomadiso8970
@techienomadiso8970 4 жыл бұрын
Good video
Introduction to ESP32 - Getting Started
47:57
DroneBot Workshop
Рет қаралды 1,6 МЛН
Using EEPROM with Arduino - Internal & External
31:54
DroneBot Workshop
Рет қаралды 192 М.
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 20 МЛН
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 81 МЛН
ESP32 SD Card Interfacing Fast!
7:07
ArtsyEngineering
Рет қаралды 49 М.
LESSON 21: Data Logging from Arduino to SD card
28:01
Paul McWhorter
Рет қаралды 139 М.
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
Arduino SD Card and Data Logging to Excel Tutorial
6:22
How To Mechatronics
Рет қаралды 467 М.
Tutorial: Writing and reading to SD cards
15:55
Kris Kasprzak
Рет қаралды 8 М.
Which water gun won??
0:25
YJTOYNIKOLA
Рет қаралды 11 МЛН
Он просто решил сэкономить на плитке, но...
0:25
Chúa ơi - Hãy thử cái này #automobile #funny #shorts
0:12
hoang quach
Рет қаралды 28 МЛН