Grow your YouTube views, likes and subscribers for free
Get Free YouTube Subscribers, Views and Likes

Using SD Cards with Arduino - Record Servo Motor Movements

Follow
DroneBot Workshop

SD and microSD cards are an ideal way to store large amounts of nonvolatile 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 https://dronebotworkshop.com/sdcard...
More articles and tutorials: https://dronebotworkshop.com
Join the conversation on the forum: https://forum.dronebotworkshop.com
Subscribe to the newsletter and stay in touch: https://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 builtin 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 “asis” 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.

posted by ironfrecklesvp