Using SD Cards with Arduino - Record Servo Motor Movements

preview_player
Показать описание
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.

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 YouTube channel. That way you won’t miss out on any of the videos.
Рекомендации по теме
Комментарии
Автор

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 !!!

lesrstoxsal
Автор

The clearest, most consistent and useful Arduino content on YouTube. I'm hooked.

Keep up the great work.

daiseman
Автор

Your videos are the best and easiest to understand

fenylmecc
Автор

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 YouTube Channel.

MysticDreamer
Автор

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

mihaiadam
Автор

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

kijijikhalid
Автор

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

joeybennett
Автор

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

UReasonIt
Автор

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

asrajo
Автор

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!

KikiTay
Автор

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

phanxquang
Автор

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

abhijitrashinkar
Автор

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!

REDACTD
Автор

Your are worth billions, thank you, your the best

danielherrera
Автор

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

diego.alienigena
Автор

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! 😎👍

erikw
Автор

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

tameral-rodainieh
Автор

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

paulhurd
Автор

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

paulbertrand
Автор

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 YouTube!!

wernerberry