Using SD Cards with Arduino - Record Servo Motor Movements
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
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 !!!
yes!!! thanks for no crappy music!!!
Yes....
he aint lettin u hit bru
The world needs more people like you, very, very good job explaining, thank you, and hope to see more from you. Best regards.
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
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!
The clearest, most consistent and useful Arduino content on CZcams. I'm hooked.
Keep up the great work.
Your videos are the best and easiest to understand
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.
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.
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
One of the best video. Your tools arrangement at the back shows that you are very organized man. Great
Just what I needed! Thank you for putting all this information in one spot!!!
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!!
(yep) ** 10
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.
Excellent Thank you very much,please keep sharing your awesome Videos.
I’m Beginner but I’m learning very quickly from your Channel .
Just what I was looking for. Nothing short nor nothing extra!
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!
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.
Thank you very much (currently from Germany). Your videos are very professional and very easy to understand. My sincere appreciation!
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
Nope its 20 out of 10
As usual
Your tutorials and method of teaching are of the highest quality
Thank for being there for us
I love the subtle camera move here and there. And the neck turn.
You have no idea how much this helped…I can’t thank you enough!!
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!
I Thank you so much for what you do and do so well. It was a pleasure finding your video's.
Excellent video as always, dear Bill. Thanks for putting so much effort which is helping me in learning all these topics.
Vijay Khole czcams.com/video/Ub1Qcx1ZWsY/video.html
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! 😎👍
Thank You ..You are a very good teacher
Thank you, and hope to see more from you. Best regards.
Awesome video good sir. I subbed the channel and the newsletter. I look forward to future videos.
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!
Mystic Dreamer czcams.com/video/Ub1Qcx1ZWsY/video.html
Thank you so much for the detail explanation. keep up the good work
thanks Bil for your easy and important videos.
Fantastic video - thanks for your hard work making it!
Marvelous explained! Thank you!
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.
Really good video, thank you. Methodically explained and demonstrated, subbed.
You explanation is soooo perfect.
Really appreciate.
Thank you for your easiest and clear explaination
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
Perfect and clear explanation - thank you.
Always great explanations.
really cool, great details and explanation.
Superb tutorial, as usual. Thank you.
Sir, no other word to address, I am very much impressed with your tutorial, I have subscribed, thank you by heart.
Thank you for the very detailed explanation
Thank you so much for the clean explanation ☺️
excellent, very clear explanation. I'll be using SD cards soon!
Thank you very much for your time and for all your efforts.
This video explained very well. You are very good tutor and generous helper
thanks so much for your excellent tutorial, I used this tutorial for stepper motor and it is working, thanks again...
Great work! Thank you for sharing
Thank you for all that you do, truly excellent
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.
Fantastic video. Even I get it right when you explaine it. ;) Thank you very much.
Fantastic tutorial, thank you!
This video is gold for me
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
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.
Thank you sir it was very good knowledge you are sharing.Thank you for the video you make
Very useful and interesting.. thanks a lot for the valuable information
excellent tutorial! thanks very much.
Thanks very much for this video!
Great video from GREAT MAN.
Hi quality content! Love your channel!
Paul Mcworther was right, you have one of the best techsites , keep on the good work!
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 🙏
Very good teaching video
Wonderful job Congratulations!
Incredible. Thanks!!
wonderful video great man!
Great video. Thank You.
It's incredibly clear how well you explain things; you're quite intelligent. I wonder if you've registered any inventions yet?
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
this video is really helpfull
I love this tutorial
El orden de las herramientas en su laboratorio es simplemente inspirador... 😍
The Bob Ross of electronics. Love it.
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
thanks great tutorial!
Thanks you sir it's so help full
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
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
Fantastic!
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!!!!!
Thanks as always, teacher.
1085243 czcams.com/video/Ub1Qcx1ZWsY/video.html
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
👍 👍 👍
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? 😭
You the best sir
Wonderful bro
That was so fun!
Creston Witte czcams.com/video/Ub1Qcx1ZWsY/video.html
Great video as always! One note: The SD library now supports multiple open files.
Yes your correct Scott, I actually realized that after I finished the recording!
@@Dronebotworkshop You do a super job so no worries!
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
Good video
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
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.
Many thanks 🙏🌹
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
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
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.
thank you so much :)
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!!
Very good