LESSON 21: Data Logging from Arduino to SD card

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024
  • This video shows step-by-step instructions on logging sensor data from an Arduino to an SD card. This facilitates easy importing into Excel and easy charting, graphing and data analysis. We use the BMP180 pressure sensor and a standard SD card reader. For more details see Arduino LESSON 21 at www.toptechboy.com.

Комментарии • 127

  • @jeans.1328
    @jeans.1328 6 лет назад +62

    Give this man a medal, He is actually teaching, not just posting links for the codes and pictures with the pinouts. while playing a weird background music

    • @rbmnewton
      @rbmnewton 5 лет назад +6

      He deserves more than a medal . Such a selfless Human , never seen in recent past...

    • @caiomolinari4790
      @caiomolinari4790 5 лет назад +3

      he's a mith

    • @navadeep025
      @navadeep025 5 лет назад +2

      @@caiomolinari4790 no doubt

    • @OcenaSoft
      @OcenaSoft 5 лет назад +2

      @@caiomolinari4790 An Enigma

  • @antoniomontalvo1118
    @antoniomontalvo1118 5 лет назад +9

    Hey Paul if you still look at these comments i just wanted to say that these lessons helped me so much. THANKS!!

  • @georgeross5527
    @georgeross5527 4 года назад +6

    Paul is right on the money. Simple , straight forward , and best of all the code actually works. Good Job.

  • @shadowofstars849
    @shadowofstars849 4 года назад +8

    I had never seen that kind of TUTOR on the youtube. Just Amazing.

  • @daviddeegan1740
    @daviddeegan1740 7 месяцев назад +1

    First of all just like to say a massive thanks , I've been struggling for years trying to learn basic electronics and programming and your lessons have opened up a whole new world of learning.
    This particular lesson was a bit challenging but so rewarding, I had to jump through a few hoops such as buying a different SD logger and the kit I had a temperature and humidity sensor with only three pins !
    Such a fantastic feeling getting it to work, thank you Paul.

  • @electronicsexplained287
    @electronicsexplained287 6 лет назад +2

    Hey Mr.Paul
    You are the best teacher I've ever seen. I am sure that your students love your classes and They are LUCKY to have you as their teacher.
    please keep those lessons coming and let us (people who have no access to learning resources ) learn something new day by day and pass it to others so that the entire PLANET EARTH is happy :)

  • @mariodominguezaguilar5968
    @mariodominguezaguilar5968 Год назад +1

    Many thanks Paul, I had built a project using the Micro SD manufacturer recommendations and an ARDUINO UNO (Elegoo). The SD card vendor diagram tells you to use PIN10 as CS, but the SD card crashed after recording some data and had to be formatted. Windows could not even detect the card and had to be formatted with the SD format software, but after a few SD reformats it was damaged beyond repair... and of course data lost.
    I followed your advice and used PIN 9 as CS and left PIN10 free , and this has worked and I am recording data every 2 seconds to test the SD card.
    I will start reading the libraries to understand this type of requirements better
    Again, a beautiful tutorial and extremely helpful for those of us learning this beautiful technology. God Bless You.

  • @ErlankBru
    @ErlankBru 3 месяца назад

    With the help of this extraordinary well explained tutorial of yours, I was able to get my triple axis accelerometer data onto a micro SD card and onto MS Excel. Thank you for helping and showing us to learn engineering skills!

  • @rahm0054
    @rahm0054 3 года назад +1

    I just wanted to tell you Paul, these helped me gain recognition at my job. You taught us so well.

  • @emmtzi1
    @emmtzi1 8 лет назад

    Dear Paul
    you are a great tutor! I am intensively watching your videos during the last months! Thumbs up for Space Cowboys too!

  • @NearlyFromAfar
    @NearlyFromAfar 8 лет назад

    I'm writing this just in case it can help somebody else who may have had a similar experience.
    All these lessons have been stellar. I followed this one to exact detail, and everything worked on the Ardiuno side (serial monitor was rolling through temp and press readings just as expected), but every time after ejecting the SD card and plugging it into the computer, it was full of corrupt and fragmented files. My card reader looks exactly the same (no mfgr name printed anywhere) as Paul's, and came dirt cheap from amazon. But it kept writing corrupt files.
    What finally got it working was moving the connection wire on the SD card from 5V to 3.3V, and then plugging the other end directly into the 3.3V pin on the arduino, instead of into the 5V rail on the prototype board. In other words, the arduino has one wire from its 5V pin to the prototyping board, and another wire from its 3.3V pin straight to the 3.3v pin on the sd card reader.
    I tried this because several other SD card readers on the market only have a 3.3v input. This lead me to believe 5V is too much for an SD card. I don't really know enough about electronics to know for sure. It was just a pattern I noticed. I think in my case I got a faulty SD reader. Maybe it's supposed to step down any 5V inputs to the 3.3V an sd card needs, but mine wasn't doing that correctly. So, a direct use of 3.3 made things work. Again, no idea why, as I don't have an electronics background, but it worked.

  • @cupbowlspoonforkknif
    @cupbowlspoonforkknif 9 лет назад

    I was trying to mash code together to get my datalogger to work, unsuccessfully, until I found your videos. From one of your comments in a video I realized my error. This time I learned from the ground up with your sensor video and this one. I now completely understand the code I'm using and look forward to trying to add RTC data to this sketch. Thank you so much!

  • @erygion
    @erygion 5 лет назад

    Thank you so much Mr. Mcwhorter, my code was very different because I used an LCD instead of serial and added some print statements incase no sd card was found and it runs exactly the same as yours. I really can code arduino (not all of course) by myself now and it's because of your lessons. This is invaluable to me, seriously from the bottom of my heart thank you so much! Sadly I don't have a gps module yet but when I get one I'll continue with the course but I'm going to browse your other Arduino related stuff. Thank you again I'd give you a hug if I wasn't hundreds of miles away. Best teacher I've ever had...

  • @OcenaSoft
    @OcenaSoft 5 лет назад +1

    OMG - Your amazing... I am new to micro controllers and was a little stuck as to what to do and how to do it. I have watched your videos and have learnt so much. Your amazing and most of the questions I have had whilst watching your videos have been answered by the end. Keep up the great work.

  • @rajcodes100
    @rajcodes100 5 лет назад +2

    Thanks Paul - I am continuing to learn from your lectures .

  • @saadrauf500
    @saadrauf500 4 года назад +1

    It is good to see your lessons . Thank u so much sir

  • @mikedelosier95
    @mikedelosier95 9 лет назад +2

    Hello Paul, You have vary good Arduino training video series, nicely done :)
    I was working Lesson 21:
    Anyways the SD file system limitation is a legacy DOS 8.3 file format convention / limitation meaning up to 8 characters for file name and up to 3 characters for file extension XXXXXXXX.XXX .
    Also your SD data logging example, if you use .csv comma-separated values (CSV) vs (TXT) file extension it will automaticly associate and import into Excel without manually determining the deliminator fields every time.
    You are vary good teacher and your students are vary lucky to have you :)
    Thanks MIke DeLosier.

  • @charlesdelv.6049
    @charlesdelv.6049 9 лет назад +3

    One more time !!! surprise me with this good tutorial !!!!!! "" God bless you paul "" "!!
    Greetings from Colombia!

  • @justinheath2189
    @justinheath2189 6 месяцев назад

    Wow ... what a guy! You are a rare gem. Thank you so much for the help and tutorials you provide.
    You teach in such an informative and effective way. :)

  • @abhyudaysingh2943
    @abhyudaysingh2943 6 лет назад

    You are simply amazing sir, wasted 3 hrs of my valuable time by not checking on your website if u have a tutorial for Sd card. Looked around on Google. Some hits some miss. But now I am clear on the logic the way this module works. Thanks a lot

  • @berkaykocaaliler1133
    @berkaykocaaliler1133 Год назад

    Thank you very much, Mr. McWhorter. I'm preparing for the CanSat competition. Videos like this help me a lot.

  • @cyrushenry1909
    @cyrushenry1909 5 лет назад +2

    Another great lesson. Time to get my big mug of iced coffee and get into it!

  • @fphenix
    @fphenix 6 лет назад +7

    @13:13 : The Arduino SD library only supports the DOS 8.3 filenames (i.e. up to 8 char for the file name and 3 for the extension).

  • @Theresamallory9279
    @Theresamallory9279 9 лет назад +2

    Great lesson! I love your enthusiasm. Thank you!

  • @michaelcostello6991
    @michaelcostello6991 4 года назад

    Waiting patiently for my sensor to arrive so i can implement this project. My 14 year old step daughter likes your videos because she says she likes chilled out teachers like you.

    • @paulmcwhorter
      @paulmcwhorter  4 года назад +2

      It is good to hear a young lady is interested in Engineering. We need more women in this profession.

  • @patriotprepper6915
    @patriotprepper6915 9 лет назад +7

    Great video! I seemed to have found you on lesson 21 however I am certainly going to go back and start with lesson 1. By far the best Arduino videos I have found so far. Thank you very much for making these videos. A thumbs-up for sure! How could anyone possibly give these videos any other rating. My initial batch of Arduino 'stuff' arrives in a day or two and I can't wait to use your videos as a major reference.

    • @paulmcwhorter
      @paulmcwhorter  9 лет назад +1

      Patriot Prepper Thanks for the encouraging words. Glad you found the videos useful. Thanks!

  • @ianbertenshaw4350
    @ianbertenshaw4350 7 лет назад

    Amazing!
    Being able to data log then convert to a graph has many uses , you could possibly use a load cell , temp sensor , hall effect sensor etc to make a small engine dynamometer and much more !
    Your videos just keep getting better and better!
    I'm starting to kick myself for not getting into PIC when it first hit the ground and now even more so because i ignored Arduino for so long .

  • @cupbowlspoonforkknif
    @cupbowlspoonforkknif 9 лет назад

    Great video. I like how you explain and add comments to each line.

  • @EFoxVN
    @EFoxVN 3 года назад

    Many thanks for this wonderful lesson and explanation of this powerful tool. I started learning Arduino with the very goal in mind to log data. God bless you from South Africa

  • @mrcamperon
    @mrcamperon 5 лет назад

    great tutorial. very well explain every single tutorial from this gentleman .
    after checking youTube and other Udemy and other tutorials this still one of the best teacher .thank you for introduce programming to the people.

  • @zusekhan
    @zusekhan 6 лет назад

    Thank you Paul for all these videos.

  • @Yogibernd
    @Yogibernd Год назад

    Absolutely amazing and very comprehensive.

  • @ghostridar1988
    @ghostridar1988 7 лет назад

    Dear Mr.McWhorter thank you so much for your videos! keep up the great work !!!

  • @bantoo1988
    @bantoo1988 3 года назад

    Sir Paul McWhorter, you are a motivation for me to take interest in programming. although I hate programming when I saw your lectures I came to know that programming is a bit kind of a game.

  • @McGavel1
    @McGavel1 8 лет назад

    Awesome stuff - thanks! I ordered the same card reader & pressure sensor just now and can't wait to get em in a couple days so I can do this exercise.
    Also, thanks for pointing to your Python+Arduino lessons cuz I almost forgot you had those and so will check those out too while waiting for my parts.
    I looked ahead at the rest of your lessons for any more parts I might need for those and ordered the GPS tracker today too. Thanks again - keep up the good work - have fun - peace.

  • @Europayacht
    @Europayacht 4 года назад +1

    Fun and very telling - Thank you Paul !!!

  • @veganath
    @veganath 8 лет назад

    Thanks Paul, not too late for a compliment on your tutorials, they are fantastic, I ping & echo the same sentiment as others here, finally projects that have utility.....lol

  • @AdityaKumar-qr7gf
    @AdityaKumar-qr7gf 8 лет назад +1

    Great and Very Very Thank you for this.
    If it is possible can you please cover the RTC Real Time clock module in your lesson?

  • @Drmerlin604
    @Drmerlin604 7 лет назад +5

    Hi Paul. Thoroughly enjoying your course! However, I am sure that you know that Virtuabotox gear is not available in Amazon. It might be helpful to update the videos pr information accompanying them with appropriate alternatives... Kind regards

  • @David-wf3cc
    @David-wf3cc 4 года назад

    best teacher on youtube

  • @dzeykop
    @dzeykop 10 лет назад +1

    Hello Paul
    This was a perfect lesson
    Thank you for yours time.

  • @toomahhaddad2786
    @toomahhaddad2786 7 лет назад

    pleasure
    Watch your videos on RUclips
    I learned a lot from you
    Your explanation is pleasant to hear. Because you are an excellent teacher.
    Please continue to teach humanity
    Many thanks

  • @lamdawave
    @lamdawave 2 года назад

    Excellent Lesson!
    Is there a way to specify the time interval e.g. every minute, every hour etc? Thanks.

  • @muhammadtanvir5298
    @muhammadtanvir5298 6 лет назад

    Interesting project. I have watched your previous lessons too. Nice and lucid explanation. Thank you sir. :)

  • @xsirfr1958
    @xsirfr1958 3 года назад

    Very Nice Video Paul! I just subscribed. FYI, MOSI = Master OUT, Slave IN, MISO = Master IN, Slave OUT. Of course, Arduino is the Master in this case.

  • @sarathsmart2439
    @sarathsmart2439 6 лет назад +2

    sir,why are we using a reserve pin????? where should it be connected??? give more details about it

  • @andymessina9857
    @andymessina9857 6 лет назад

    #21 is a great tutorial!!! My next step is to time stamp the data by reading time and adding it as column 1 in the Excel data. I have an RTC shield on my Arduino Uno R3. Do you have a tutorial on time-stamping? Thank you for your wonderful easy-to-follow lessons

  • @jamessalvador8075
    @jamessalvador8075 7 месяцев назад

    Amazing video, what type of SD card did you use? I keep getting the "SD card initialization failed."

  • @mainkordormawblei
    @mainkordormawblei 7 лет назад

    love your explanation... details works are always the best

  • @florinalexandruro
    @florinalexandruro 7 лет назад

    Really clear and useful! Thank you for sharing!

  • @ArtR0001
    @ArtR0001 10 лет назад +1

    Just wondering, for scientific measurements, wouldn't you want date and time recorded with each Temp/pressure measurement? The data seems kind of useless without that. I suppose you would need a RTC or GPS connected?

    • @paulmcwhorter
      @paulmcwhorter  10 лет назад +1

      Yes, certainly you would want to save more data and relevant information. The point of the lesson was simply to show how to hook up and write to the SD card. For your project you would decide the relevant information to include.

  • @smitamohanty6386
    @smitamohanty6386 5 лет назад

    Thank you so much sir... Can we use the same logic for data logging from modbus sensors.

  • @DeeegerD
    @DeeegerD 9 лет назад

    Just checking out pin 10 you mentioned and apparently it only has to be set to output to set the SPI mode as Master, once that is done you can use it for something else. SD card file names must use the 8.3 convention (8 character maximum name with 3 character maximum file extension).

    • @paulmcwhorter
      @paulmcwhorter  9 лет назад

      Digger D I am really not sure. I don't understand exactly what is going on with pin 10, so I set it and leave it alone. I dont know if it can be used for something else or not.

    • @DeeegerD
      @DeeegerD 9 лет назад

      As I read and think I understood it, it's part of the SPI setup to Master. Once the SPI has been initiated in this mode the pin is free for other use.

  • @gordonhope9219
    @gordonhope9219 Год назад

    Paul, I am having difficulty in getting the SD card reader to initialize using the basic Arduino IDE supplied, "CardInfo" program. According to the documentation you posted about the reader itself, it indicates that it needs both 3.3VDC and 5VDC as I believe I see no level shifters present on the board. Yet, somehow in your video, you did not connect 3.3VDC and yet your project worked? I am confused at this point because I have virtually the identical hardware for the SD reader and yet I am having a major challenge just getting it to be read....any thoughts would be much appreciated :-)

  • @kobedde
    @kobedde 5 лет назад

    Great tut, thank you Paul!

  • @4paritosh
    @4paritosh 7 лет назад

    hello ...sir
    ur teaching method is amazing....
    could u please make a tutorial with RF modules ....
    i have searched ...online...but i could not understand....so....

  • @forknowledge6959
    @forknowledge6959 8 лет назад

    great video! The link to the card on your website is out of stock on amazon. I found it on ebay but I am trying to find out the capacity of the SD card it takes. I'm wondering how much data I would be able to record. This card is cheaper than the one I found on sparkfun and I wouldn't have to solder pins to it.

  • @ianhayden2839
    @ianhayden2839 2 года назад +1

    What sd card does it work with

  • @KJ7JHN
    @KJ7JHN 4 года назад

    on the SD card reader, does the AMS1117 on the shield in addition to voltage regulation, act as a current limiter?

  • @rohitjadhavpatil5181
    @rohitjadhavpatil5181 7 лет назад

    can you give some idea regarding getting data from an hall effect sensor.I am using it for measuring the speed of shaft.

  • @barry10ish
    @barry10ish 5 лет назад

    I want to make a pixel stick ( led light painting tool ) with image processing. I have never even seen an arduino uno so would it be possible for someone with my experience to have a go using your channel ? I think it would drive me nuts but I also see some fun. The idea is to load via an SD card reader then paint it .

  • @swapnilbandgar8730
    @swapnilbandgar8730 4 года назад

    this is well understood ... thank you...I tried this with lm35 temp sensor, its worked perfectly...
    but its not working for three sensors data logging of DS18B20 ..
    please help me out...

  • @noufel3
    @noufel3 4 года назад

    thanks for your tutorial,i just have one question, there is a possibility to display data that is written on sd card on lcd display like a monitor ?

  • @karenlalayan3700
    @karenlalayan3700 6 лет назад

    Great videos. Thank you very much!!!

  • @sibisri819
    @sibisri819 5 лет назад +2

    How to add time and date along with the data in the SD card.

    • @xelionizer
      @xelionizer 4 года назад

      For that you could use a RTC module (Real Time Clock). Then timestamp the data with that.

  • @56NeilWatson
    @56NeilWatson 3 года назад

    That pressure sensor is extremely sensitive. Definitely use it as an altimeter

  • @fabiogtz
    @fabiogtz 9 лет назад

    great!!!! very good lessons. how could I put the variable time in the graph ? thank you.

  • @rafac13
    @rafac13 8 лет назад

    Paul,
    If you had multiples sensors logging at the same time, would be better to use raspberry pi?

  • @xelionizer
    @xelionizer 4 года назад

    8:55 I appreciate you trying to explain the File object to us, but I would have liked it better, if you had gone a little more into detail about how it actually works? Thanks;)

  • @Aghil-pw4bu
    @Aghil-pw4bu Год назад

    Hello... I want to create a table in Excel and save it in the sd card which contains three columns.. The first column is longitude and the second column is latitude and the third column is a number between 0 and 10... then We receive GPS input, and if the longitude and latitude were equal to each of the numbers we wrote in the first column and the second column, it will display one of the numbers (0 to 10) on the serial monitor... Your help is very important to me.

  • @florinalexandruro
    @florinalexandruro 7 лет назад

    Hi! Using only the libraries, the SD writing and one sensor, I ended in 13,000 bytes sketch, which on UNO is a huge room to occupy. Did I do something wrong, or this is the expected value?

  • @AviAlgaly
    @AviAlgaly 8 лет назад

    Hi Paul,
    I want to use the sd card to log my rfid module problem is legs are already taken by the rfid module.
    question is how to combine both ?
    Thanks!

  • @lanecejka4080
    @lanecejka4080 2 года назад

    thank you brother

  • @navdhn7414
    @navdhn7414 7 лет назад

    Hi Paul,
    I am working with (Arduino Uno) + (nrflo1) to detect wlan channels. I have followed your steps and I can get the readings from Serial Monitor BUT the readings do not save on SD Card,I don't know why! Do you have any suggestion on this matter?

  • @santiagoaillon5794
    @santiagoaillon5794 4 года назад

    What if I have an SD shield? do i do the same process or do i need to change something

  • @abhijitpatil8177
    @abhijitpatil8177 6 лет назад

    can i use sd card module other tahn u have used.?
    by the way vdo is very much good.
    request u to clarify

  • @yasirhussain3629
    @yasirhussain3629 8 лет назад

    Can we use the same method for electret microphone?

  • @bruceclothier8238
    @bruceclothier8238 Год назад

    Could you explain how you could take readings every 10 mins ie a time course.

    • @phenomenal821
      @phenomenal821 Год назад

      I think it's through delay(60000) as
      delay(1000) = 1 sec.

  • @YouKnowMeDuh
    @YouKnowMeDuh 2 года назад

    Thanks a ton!

  • @navadeep025
    @navadeep025 5 лет назад

    sir, can i connect my usb pendrive (flash drive) as a sd card and store all stufff in it? if yes ,what are the pinouts? basically an usb port has only 4 pinouts right?
    so.............is it possible to do so?

  • @abinaustin
    @abinaustin 9 лет назад

    Hi
    i wanted to know how to read a csv file from sd card shield with 4 values in row(2 int values and 2 boolean values) from sd card? can you help me with the program

  • @antonviper7803
    @antonviper7803 7 лет назад

    Thumbs up definitely! If I tried to do this on my own - it wouldn't work at all

  • @rejamatin101
    @rejamatin101 7 лет назад

    sir, what if I want to create the logging interval time become every 1minute? what the code should be create? could you tell me and make the tutorial video please? I need it for my project, I've try my best and the logging interval time still not work as I want

  • @vedantbarje134
    @vedantbarje134 8 лет назад

    What do i do if i want to make a graph like that in real time?

  • @ianhayden2839
    @ianhayden2839 2 года назад

    Is the sd card thing for micro sd card or normal

  • @nguyenthuy9824
    @nguyenthuy9824 4 года назад

    Hi Paul McWhorter. After seeing this video. I'm thinking about that "how to protect arduino program by password". So do you have any ideal for helping? Thanks

  • @ErvensonMaban
    @ErvensonMaban 6 лет назад

    Hello paul have a nice day, can you teach how to delete specific log on a file

  • @surapodphetsri8073
    @surapodphetsri8073 9 лет назад +1

    Thank you so much

  • @eugenewong6425
    @eugenewong6425 7 лет назад

    Hi seeking for help in this project currently on going for remote sun logging ,any code done for si1145 uv/ir/lumens sensor with rtc to excel

  • @burakayan3360
    @burakayan3360 4 года назад

    awesome ...

  • @Atlesus
    @Atlesus 9 лет назад +2

    Hello Paul,
    Very nice video. I've been trying to do something with SD module and I still don't know how. I created a webpage using an arduino mega and the shield w5100, but i want to show a picture on the webpage, a backgorund, now, I'm sending a link from the web, so if the user have access to the internet, he will see the background, otherwise, if he is in my lan network and I have no internet acces on it, it show's nothing. So I want to host the image on the SD card, the problem is, I don't know to get it from the sd card to the arduino. Do you have any ideia how to do that?

    • @paulmcwhorter
      @paulmcwhorter  9 лет назад +1

      Arthur Lang If you look at the sample programs that come with the Arduino IDE, you can find several sample SD programs. In those programs you can see examples of reading and writing the SD card. Check them out and you should find what you need.

  • @marisol51295
    @marisol51295 8 лет назад

    does it work the same way id i´m using a micro SD?

  • @zzPeaceMakerzz
    @zzPeaceMakerzz 7 лет назад

    For some reason my SD card won't run, if I take out the if statement it will. I even try on your codes and the result's still the same.

  • @JohnMacGuy
    @JohnMacGuy 3 года назад

    The infamous pin 10 works on UNO. Does anyone know what it is for MEGA?

  • @shrikantnikam2426
    @shrikantnikam2426 4 года назад

    Sir how to transfer .txt file from one sd card to another using arduino?

  • @shaileshkumar-rg9tg
    @shaileshkumar-rg9tg 6 лет назад

    memory card initialization failed,what may be the possible cause.
    thank you

  • @JoachinYnchausti
    @JoachinYnchausti 4 года назад

    awesome!

  • @dzeykop
    @dzeykop 9 лет назад

    Hello Paul
    It is possible to make a Arduino data logger and with Wifi Shield send dat to Google drive?
    If yes can you please make a lesson?
    Thanks

    • @paulmcwhorter
      @paulmcwhorter  9 лет назад +1

      dzeykop It would probably be possible. You would need the Wifi shields for arduino, and then talk between Wifi shield and Python running on a PC. Python would then need to save to google drive. I have done this type of things using the arduino ethernet shield, then connect ethernet shield to bullet radio, and then Python on PC talk to arduino over the bullet radios. I would like to make some lessons on this, but will need some time.

  • @ErvensonMaban
    @ErvensonMaban 6 лет назад

    Any one here can provide tutorials how to delete specific file on txt file, using arduino?

  • @regienavarro9168
    @regienavarro9168 6 лет назад

    can you create a code that can delete a text line using sd card
    line 1
    line 2
    line 3
    line 4
    line 5
    the line 1 will be deleted permanently
    thanks