please remember that the complete
information for the class that you are
about to view is at Eli the computer guy
comm not only do we have our videos
there but we have parts lists diagrams
pictures and even complete code examples
so if you are watching this video and
you want more information please go to
Eli the computer guy comm welcome back
as you know I am he like the computer
guy and in today's class I'm going to
show you how to use a nard you cam with
an Arduino to store image files to an SD
card this is one of those things where
if you know what the steps are it's
incredibly simple and if you don't know
what the steps are it's a complete pain
in the ass and you will rip the little
hair you have left out of your head so
in this class I'm going to be showing
you how to be able to take pictures with
your argue cam and be able to store them
to an SD card so the warning warning for
today is that you use a good data
logging a shield for this particular
Arduino project so basically we're gonna
have our Arduino Uno board on the bottom
we're going to have our data logging
shield connected to that that is what we
connect our SD card into and then on top
of that we are going to connect our
argue cam the important thing for
today's project is that you have a
standards-based data logging shield that
you're going to be using the problem
that you may run into is if you're like
me and you simply went to Amazon and you
purchased a data logging module that may
not be 100 standard 100% standards
compliant what I mean by this is that
the argue cam uses the i2c protocol in
order to be able to communicate with the
Arduino board itself and one of the
issues you may run into with your data
logging module is that if there are
certain things within the data blotting
logging module that are hard-coded into
the module then when basically the
Arduino boots up and it tries to
dynamically assign resources to the
different things connected to it you may
run into problems so basically I was
using this particular data login module
and I've used this we have used this on
other projects so this thing does work
it does work with others
the problem that I was running into is
when I connected this to try to build
this project to have the Rd camp
save to this module what would happen is
I would get an F I fo size error so
essentially when when the argue cam is
creating the image file if it is above a
certain size it fails out because
obviously you don't want the image files
to be too big and what there's a weird
problem where how the communication was
happening essentially I would
continuously get FIFO a size errors
because of this particular module when
it did a lot of research try to figure
out what the hell is going on I figured
oh maybe I put in the wrong pin number
maybe I did something wrong and
apparently if you go and you do a good
bit of research on it apparently there
is something hard-coded in this
particular module and so when you try to
connect this and use it with an Arduino
with a ru cam essentially it just fails
out right so basically the standard is
whatever the hell is hard-coded in here
is not supposed to be hard-coded in
there so initially to make this project
work I actually went and I step simply
used an Arduino Ethernet shield so this
is a standard Arduino Ethernet shield
this is actually from Arduino itself and
on this it happens to have a micro SD
slot again for data logging
functionality and what I was able to do
is literally literally I spent like an
hour trying to make this thing work kept
getting the 5 ho errors then I saw
there's a problem it's like huh I'll
take this I slapped this on all I used
was a data logging component and
literally I had the project working in
about 5 minutes once I was able to get
it working on this I then simply went
out and bought a a clone data logging
shield from a hit Lego I actually like
them as a vendor I slapped this on and
again this is now working so my ru cam
is able to save images to the SD card
that is in the slot and so the big thing
is if you're going to try to do this
project make sure you get a
standards-compliant SD shield literally
it may all simply come down to if you're
a little data logging module doesn't
like to play nice with the art you can
no amount of coding that you're going to
do is make it will make it work or at
least any amount of coding that I'm
going to show you how to do when these
particular projects so the big a warning
a warning for today is go buy a good
data logging to shield for your project
if you're gonna be using the argue cam
make sure everything works that way and
then once you make sure everything works
that way and then you can go out and try
to experiment with other things but
literally right if if you get an SD
shield that is not compatible none of
this is going to work
the only other warning for the code that
I'm going to be showing you today is for
the SD so the SD has a CS port and so
basically we're going to be using
digital pin 10 today so for these
shields when you have a shield you don't
actually know what things are connected
to us so you're not necessarily sure
what s what digital pin the SD card is
connected to so again you can go and do
a little bit of google research and what
you can find again by standards is that
the SD card on a shield is connected to
digital pin 10 so one of the things you
may have to do is for the SD cs10 within
the code you may have to modify that to
ten so those are just two of the things
to keep in mind the big warning warning
is just make sure you get a data logging
module that will actually work and then
beyond that you may have to change the
pin assignment number within the code to
make this functional that is literally
all I really had to modify today other
than all one of the configurations in
the memory file so with that let's go
over oh you on the workbench basically
how this is all connected up then I'll
go and I will show you the code so
here's the basic setup for the project
that we have today again so we have a
standard arduino uno board and on top of
that we have this data logging shield
this particular data logger shield us
from hit Lego but basically any
standards-compliant data logging shield
for work will work for you again I
initially did this project using the
Ethernet shield that actually has a
micro SD card a slot built into it and
so this project works completely fine
with this again you need that
standards-compliant
SD card or micro SD card in order to
to make this work this this is the data
logging module to be clear I have used
this data logging module to work on
other projects again for things like
temperature sensors other types of
sensors and it works completely fine
when you're dealing with normal analog
or digital sensors but for some reason
when this is trying to communicate with
I to see an SPI it basically fails out
so do be careful this is one of those
times where literally the product you
use to build a project may be whether or
not the projects exhale succeeds or
fails one of the things to be thinking
about whenever you do go out and you buy
your data log and shield as long as the
data log is yield is a standards
compliant so it works with i2c and I an
SPI
so on and so forth the other thing to
think about is you can get a different
functionality out of the data logging
shield they're using so obviously this
has an Ethernet port to it so if you
want to create something like a web
server that's able to take pictures you
might use something like this one of the
things I like about this particular hit
Lego shield is it actually has a
real-time clock mechanism on here
so what you can do is for things like
naming the image file so you could
actually pull the name as whatever the
current timestamp is so again something
to be thinking about with your Arduino
projects is if you need a shield like
this so the primary purpose of the
shield is for the data storage but on
top of that you might look and see what
other components are available simply
having something like a real time clock
built directly onto the shield that can
be very useful again for doing things
likes timestamps with the image names
beyond that basically again you have the
shield connected directly into into the
Arduino Uno board one of the big things
with this is when you're dealing with a
shield do make sure you have the SDA and
the SCL ports that go all the way
through the shield so you can connect
your argue cam to the SDA in the SCL
ports again some different shields so
again so this this this shield right
here again is an Ethernet shield but
this is a sane smart at their net shield
this also has a microSD slot on it but I
don't know if you can really tell from
up there the pins that does not have the
DL and the SCA pins coming up through so
that's one of the reasons I didn't use
this for the particular project so one
of the things you want for the shield
that you're gonna be using is that the
SCL and the SDA pins actually go all the
way through and then you can connect to
the top pass that again you're gonna
connect five volt VCC you're gonna
connect your ground you're gonna connect
your sta your SEL then your going to be
connecting two pins 11 12 and 13 at
based off of the diagram that our do cam
will give you and then there's a pin for
the actual picture itself so you can
actually connect you can actually
connect multiple cameras to your Arduino
project but then have them be triggered
by different digital pins so basically
what you can do is you can split these
off so basically you can basically split
these off to have these connect to
multiple different cameras but then the
actual image file itself when it comes
in that will be triggered by whatever
digital pin you connect this final pin
to so for this this is actually going to
pin seven so within the code you could
actually code for multiple different
pins but that's something to deal with
with a different project later that's a
little bit more complicated again in
order to connect all of this you
essentially look at the diagrams that
are you cam gives you and basically slap
it all together the big thing is that
the SDA in the SCL go all the way
through and other than that that's
basically what this project looks like
so let's go over and take a look at the
code itself okay so to make this project
work there are going to be a few things
that you're going to need and you're
going to need to know so at our new cam
ad R you see a m.com
that's where you can get information
about the art you cam one of the
important things is you are also going
to need to get the ru cam a library so
they have the the library available you
can download it and basically all you
have to do is then copy and paste the
library that they give you into the
Arduino libraries folder or in your
document directory on your computer so
the first thing you're gonna have to do
is actually download that art you cam
library the next thing is you're going
to need to know the information for your
particular camera that you have so if we
go over to our T camp products we can
click on our new camera
and what we can see is that there are a
few different versions there's a
5-megapixel version there's a
2-megapixel version and so on and so
forth so basically what I have is I have
the 2-megapixel version and so the two
things that I'm going to need to know is
I'm going to need to know the the
basically the name of the camera so I
have an argue cam 2 megapixel plus I'm
gonna need that information and then I'm
going to need to know the many module
information so this ovie 2 6 4 0 I will
show you where you're going to need that
in the configurations going forward so
you will need to have this information
this isn't simply a plug-and-play play
any art you cam will work you do need to
know this information for the
configurations pass that again for this
data login project you're also going to
need to verify what digital pen your
particular shield uses for the SD card
so I went here to Adafruit so the
Adafruit is basically the design that
this particular shield is based off of
and so for the CS the CS pin that we're
gonna use that goes to digital pin 10
again in different on different shields
that might go to a different digital pin
and you may have to configure that
within the actual sketch itself so with
that let's go over and take a look at
the code so here we are taking a look at
a code the demonstration I'm going to
show you today is from the examples it's
the rdu cam the Mini 2 MP plus multi
capture 2 as 2d example so if you go to
file you go to example you go to file
you go to examine yeah you go to
examples you go down to r2 you cam you
then go to mini right so there's a whole
bunch of different versions here you
then go to many basically what we're
going to be doing is we are going to be
using this particular example right here
the art you can mini to mp+ multi
capture to SD i will tell you that's one
of the big problems with I find with art
you cam is they give you so many options
they make things very difficult to
figure out exactly what the hell you're
doing initially so again that's one of
those that once you figure it all out it
becomes very easy again it is important
that once you download the art you cam
library that you then store it with
in the Arduino folder and your documents
directory so in libraries you can come
here and basically you can see I've
saved this art you can library here now
within this library there is going to be
a configuration file that you're going
to need to modify there's this
configuration file called memory saver
so the memory saver file you do have to
configure for your particular ru cam so
if you open this up you can see that
there's two steps so step one select the
hardware platform that you're going to
be using so basically here what you do
is you basically uncomment out what
you're using so I have the O v26 for O
mini 2-megapixel plus this is a
particular camera that I'm using you can
see that there's a two megapixel three
megapixel 5 megapixel 5 megapixel plus
so on and so forth so this is what we're
using or at least I'm using so I
uncomment this out and then down here
you also select the camera module so
again as I said before I'm using that
ovie 2 6 4 0 camera module and so I
uncomment that out again it's important
to see that they have a whole bunch of
different camera modules here so just
there's different there's different
cameras there's different camera modules
if you if you don't do this properly you
will run into issues with your code once
you're done and modifying this as need
be you can then simply click Save and
once that saved you should be good for
for dealing with the rest of your sketch
so let's go and take a look at this
particular sketch so we take a look here
you have a lot of stuff that's commented
out in the beginning just gives you a
lot of information about the sketch and
then we come down here to the actual
libraries so we have the wire library
SPI and yes D library they so should all
be within your Arduino IDE by default
and then the important thing is you're
going to need that argue cam librarian
then past that is this is that
configuration file that we just dealt
with memory saver dot age so basically
this and then receiver dot H file again
it's going to come here and it's going
to grab the information about your
and your module if you do not configure
that or you configure it properly if you
go through and you try to compile this
sketch it will fail out and it'll tell
you that there's a problem you're gonna
come down here there's a whole bunch of
different information defining a frame
number a whole bunch of different things
CS so the Const int CS so this right
here this is important so this is for
the argue cam remember where I showed
you that wire so if we go over and we
take a look at my at the actual physical
thing so this is for this digital wire
here so again II each one of your argue
cams that's going to be connected to the
Arduino that will have its own
individual C S Pen and so for this
that's the C S Pen seven so you can you
could change this for some reason if you
had an art you cam on a project where
you had a bunch of different pet devices
already connected to digital pins and
you want to use this on digital pin 2 or
digital pin 3 for whatever reason you
would modify the CS within the sketch
but it is important to understand that
when you're taking a look at this CS
this is the cs for the art you cam
itself and there isn't a reason to
modify it just leave it as is and
connected it to a pin like normal then
the SD CS so defined as d CS so this is
the digital pin your SD card is going to
be using so that if we go over and we
take a look at the documentation so this
this here is a documentation for that SD
shield and so we can see the CS for this
for this particular SD shield is pin
number 10 so again if you're running
into problems for some reason do a bit
of research make sure you're connected
to the proper pin so that works and then
pass that basically that's the only
thing you do to modify the code there's
a lot of code in here and again you can
basically go and take a look at it but a
lot of this has to do with basically
again and Arduino does not have a lot of
what you would call computing power and
so a lot of a lot of things that can be
accomplished in the normal computing
world simply with a single line of
odhh takes a lot more to accomplish in
the arduino world so if you're taking a
look at this this is everything that's
required in order to basically take the
image out of the art you cam and be able
to save it to the SD card so with that
what we're going to do is I'm going to
plug the SD SD card into my little R do
camp project so the SD card is in it's
connected to the art of a card you can
project we're then going to connect the
this into the computer and then what we
can do is we can go and we can take a
look at the serial monitor so if we go
and we go up to tools and we take a look
at a serial monitor this is where we're
going to get some diagnostic information
so let me point the camera at myself so
we can start taking some some images of
myself as I talk we can take a look at
this in a second so basically what we
have here at the top is our new cam
start
SPI interface okay so if there's any
kind of problems with the art you can
itself or the SPI you may get some
errors here but we can see that that's
okay AK command so the O V two six four
zero is detected so that's the actual
module on the ru cam itself to make sure
that's detected the SD card is detected
so for some reason the SD card is not
detected it'll fail out there and so
then it's going to start to capture and
it's gonna say the capture is done then
it's gonna tell you the total time so it
took about a second slightly over a
second for the capture and this FIFO
length again if you start getting FIFO
link errors where it's too big that most
likely means you have a problem with
your data module and then basically it's
just going to continue to do this and
for this particular project every few
seconds it's simply going to take a
picture save that to the SD card and
keep going so there's no there's no
triggers on this it's not triggered by a
motion sensors not triggered by anything
this is simply waiting again waits for
about five seconds or so and then it
takes a picture and this keeps it taking
a picture a picture takes a picture it
takes a picture and it keeps taking a
picture to the SD card so with that what
I can do is I can simply pull out the SD
card so you can you can it's not a
computer it's not a computer you can
pull out the SD card
what I'll show you though is when you
pull out the SD card that's where you'll
get this file open failed and then
you'll start to get failures basically
that it can't read that the SD card is
there so let me if I reboot and so it
won't be able to continue on one of the
things that I will tell you is see if
you get the SD card error there so we
keep getting SD card error one of the
things that I will tell you is if you
pull the SD card out and then you put it
back in restart your Arduino that's an
important thing to understand restart
the Arduino if you don't restart the
Arduino most likely it will not start
saving files to to your SD card so with
that let's go over to my little
demonstration computer
I will then slot the SD card and to the
Sun to the demonstration computer and
then we can go and we can take a look at
the high quality image files that we
give so again the untitled card shows up
and then we get all of these image files
look how pretty they are
again you start to realize that a two
megapixel image files may not be quite
as impressive as you thought they were
but you know now you can see that our
little Arduino project is actually able
to take pictures and so as it goes
through is just continuously taking all
of these different pictures and you can
see one of the things again one of the
warnings to be thinking about and why
that real-time clock is significant is
you will notice the naming convention by
default is simply basically counting up
so 1 2 3 4 5 6 7 8 9 10 11 12 so on and
so forth one of the things you do have
to realize is remember is when you
restart the Arduino it will restart the
numbering process again so if you have a
bunch of pictures taken with your art
you cam and then you hit restart it will
start overwriting so if you already have
an image file called one jpg when you
restart it will overwrite 1 DP jpg with
a new one dot jpg with a new to jpg so
on and so forth
so this is one of the things we're
having something like a real-time clock
can be significant so when you start
doing more complicated projects
you do a naming convention based off of
a time stamp so you don't have the art
you can continuously trying to overwrite
image files that are already there again
just one of those little warnings to be
thinking about
so that's really what there is to using
the art view cam again again if you set
it up properly it's relatively easy to
get set up and running and if you don't
it's a horrible horrible thing so there
you go now you can have your argue cam
saving image files to your SD card again
if you set it up properly with a
standard compliant shield you'll do okay
if you use a non standards compliant
shield it's it's gonna be a lot of
troubleshooting that will be no good
this this is one of those perfect
examples this is one of those perfect
examples were literally spending the six
dollars for something that
standards-compliant is just is just so
worth it just like what I'm so I could
either troubleshoot this for the next
five hours or I could buy what I really
need to have and get it working a couple
of minutes kind of one of those things
to be thinking about
so again if you're gonna be doing this
project do you make sure because this
this uses I to see and the SPI in order
to be able to communicate and so for
that the Arduino needs to be
communicated in specific ways if your SD
card your capture device doesn't allow
that to happen you can run into problems
you will most likely get that problem
with that FIFO link error if you see
that so just keep that in mind beyond
that when you go to configure this again
do remember with these shields or if you
find a compliant data module it will
have a specific CS PIN number for
communicating with the SD card so I
think by default its us is 10 but again
in the in the sketch when you initially
open it up I think it defaults to 9 so
you may need to modify that within the
sketch and you may need to modify that
going in the future if you use a
different shield that for some reason
uses a different pen for the CS again
also as far as a CS goes pin for the Rd
you cam itself again I have this
connected to pin number 7 and that's the
default for this particular project you
could have this connect
two different digital pens on your on
your Arduino project basically you just
have to then write that into the sketch
and why that's useful is that you can
actually have multiple argue cams
connected to a single Arduino depending
on what type of thing that you're trying
to accomplish with your project beyond
that you go into that little memory
saver configuration file again it's port
important that you know what camera you
have and then what module you have on
the camera so essentially when you buy
it you'll know what you're buying is
that of two pluses of five plus is that
whatever and then again when you buy it
it'll tell you what that module is and
so you go into that configuration file
you say this is the camera that I have
this is the module that I have and away
you go
if you can figure that properly it works
fine if you don't configure it it
doesn't work it's pretty simple then
beyond that the only final thing if you
are actually going to be using this
project in any kind of real world
scenario is do realize the default
naming convention is simply one two
three four five six seven eight nine ten
basically that is simply an iteration so
basically when you turn it on the
first-base sure it takes is one the
second picture it takes is two and the
third picture it takes is three so on
and so forth so every time you reboot
your Arduino it will overwrite the
pictures that it has taken before that's
why it's important to be thinking about
something like having a real-time clock
component so that when you actually
start building projects with the art of
your cam you can have a naming
convention based off of eight off of a
real-time clock timestamp so that you
don't run into overwriting situations
when you don't want to deal with
overwriting situations and pass that
then you can just start playing and see
what you can do with this again you can
do I've already created a little motion
sensor projects with this you can create
like time lamps lapse projects so right
now again it takes it takes a picture
every couple of seconds or so you can
actually delay the code so it only takes
a picture like every minute so if you
wanted to set this up and then I'll take
a picture every minute then you can get
some time-lapse over a week or something
like that there's a lot of interesting
things that you can do with the art you
cam once you get this initial setup wait
yeah the initial setup is more difficult
than it needs to be do you have any
issues go over take a look at the art
you can website again their
documentation isn't the best but if you
take a look at it for a while you'll
probably figure out what is going on so
anyways that's really what there is to
it to the basic setup for the art you
cam saving to an SD card go play with it
as always I enjoy doing this video I
look forward to seeing on the next one
if you like the content that I create
please think about going to Eli the
computer guy comm and becoming a member
or donating please understand that all
the educational videos are in front of
the paywall that includes the videos
that includes the notes the diagrams and
the code example all of that is freely
available and in front of the paywall
but if you want to watch opinion videos
or if you want to be able to comment you
do need to become a member
membership is $5 a month or $60 a year
and gives you access to those opinion
videos and the ability to comment if you
don't want to become a member you just
want to give a one-time donation there
is also a donate button where you can do
that please understand in order to
provide the education that I am it does
cost money the servers cost money
equipment cost money travel cost money
all of these things cost a reasonable
amount of money and the fact of the
matter is is YouTube's advertising
program no longer supports creators the
way that it used to so if you want to
these classes to continue to stick
around and you find them to be valuable
please think about either becoming a
monthly member or donating a few dollars
for this project