Create CSV Files with Arduino Uno & Python (FULL TUTORIAL)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 มิ.ย. 2024
  • How to generate a CSV File from Arduino Sensor Data Using Python.
    Create a data logger script using the Python Serial module and an Arduino Uno (connected via USB).
    Full walk-through guide on how to wire the Arduino read multiple analog sensors, and display information to the Serial Monitor. You'll then learn how to collect this data using a Python script and add it to a CSV file for use with Excel and other Data Analytics tools. 👇 👇 👇
    Get the Code 👉 learnrobotics.ck.page/product...
    From this Video:
    Read the Full Article 👉 bit.ly/3fL83Nl
    🚀 LIZ'S RESOURCES:
    Learn Robotics: www.learnrobotics.org
    Join My Robotics Newsletter: www.learnrobotics.org/newsletter
    Book a Technical Consult: www.learnrobotics.org/tc
    Hey! I'm Liz from Learn Robotics. I'm a robotics engineer and I help people build robots and advance their careers in robotics.
    ▶️ Thanks for watching! If you read this far, make sure to SUBSCRIBE, and DROP A ROBOT 🤖 in the comments telling me what you'd like to learn next ✌️👱🏼‍♀️
    WHO SHOULD LEARN ROBOTICS?
    ⚡️ Students who want multiple offers to Ivy League and Top Tier Engineering Schools
    ⚡️ Professionals wanting a career change, promotion, or a switch to automation or robotics
    ⚡️ Parents who have a budding Engineer (and want them to have a competitive advantage)
    ⚡️ Educators who want to feel comfortable and confident teaching robotics
    ⚡️ Hobbyists who want to learn more about robots, understand technology better, and apply it to their lives
    🔥 Want help getting into robotics? Book a Consult ➔ www.learnrobotics.org/tc
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 86

  • @LearnRobotics
    @LearnRobotics  2 ปีที่แล้ว +2

    Interested in getting a Career in Robotics or Joining our Coding Bootcamp? Schedule a call using go.learnrobotics.org

  • @sumitsingh-fm2nz
    @sumitsingh-fm2nz 2 ปีที่แล้ว +4

    I was searching for 4 hours how to save data from arduino to csv and now I got it... Thank you :)

  • @deldridg
    @deldridg 3 ปีที่แล้ว

    Thank you Liz for your well produced tutorial - lovely presentation style too. I'm returning to electronics after being a hobbyist as a kid - now doing fun stuff with my son. We're building a wearable Arduino heart rate sensor (possibly also with GPS and 3D accelorometer - MPU-6050 etc.) with logging to an SD card for a school science fair project. We'll be testing his heart rate response to various types of physical exertion and analysing and presenting the findings. You've just saved me a ton of mucking around! Cheers and thank you from Sydney, Aust - Dave and young Will

    • @LearnRobotics
      @LearnRobotics  3 ปีที่แล้ว

      Love our friends in Sydney! Beautiful city. Glad this tutorial helped. Please keep us posted on how your project turned out. We're always impressed with the projects our students make!

    • @deldridg
      @deldridg 3 ปีที่แล้ว

      @@LearnRobotics Hey there! Thanks for your reply. If you are interested, here's a link to my son's video on his Arduino project. He's 10. th-cam.com/video/lThLvML6UjE/w-d-xo.html
      Hope you enjoy it - your video really helped us and he got a stunned response from his school - they were amazed. Many thanks, Dave

  • @jrcuosbn
    @jrcuosbn 4 หลายเดือนก่อน +1

    This was exactly what I was looking for. Awesome!!!!

  • @tildebengtsson865
    @tildebengtsson865 3 ปีที่แล้ว +1

    Huge thank you, this will help me a lot with my Master Thesis!

  • @MartinWeiss1255
    @MartinWeiss1255 3 ปีที่แล้ว +1

    You made my engineering project work!! Thank you for this video!!

  • @gustavarium
    @gustavarium 3 ปีที่แล้ว +1

    I just made a great project with your help! Thank you!

  • @jonathaniskandar8817
    @jonathaniskandar8817 ปีที่แล้ว

    Thank you Liz for your well content to produced, 🙏

  • @Kamal_Kalyan887
    @Kamal_Kalyan887 2 ปีที่แล้ว

    Wonderful you are. Please do make more of these kind 😊🙏🏻 thank you so much

  • @JaviBt4
    @JaviBt4 3 ปีที่แล้ว

    Crystal clear! Thank you

  • @geoffwade8144
    @geoffwade8144 3 ปีที่แล้ว +1

    Well done, thank you.

  • @henka4065
    @henka4065 8 หลายเดือนก่อน +1

    Now this is what i wanted to see.

  • @5coffeebreak2
    @5coffeebreak2 ปีที่แล้ว +1

    many thanks, thanks a lot ... ...
    not enough to appreciate your effort and your useful information,
    please keep going and waiting for more tutorials like this

    • @LearnRobotics
      @LearnRobotics  8 หลายเดือนก่อน

      Appreciate the kind words! check out our blog: www.learnrobotics.org/blog/?

  • @boubacarsantara8085
    @boubacarsantara8085 3 ปีที่แล้ว

    I did it Glade ! Thank you!

    • @davebrown5850
      @davebrown5850 3 ปีที่แล้ว

      Why would I be getting an attribute error for ser=serial.Serial(port="/dev/ttyAMC0")
      module 'serial' has not attribute 'Serial'
      ??

  • @jlearnicap911
    @jlearnicap911 3 ปีที่แล้ว

    Thank you, clear & applied for 100%

  • @rafaelrosenberg5214
    @rafaelrosenberg5214 3 ปีที่แล้ว

    awesome! great video! thanks!

  • @tomoguitaro
    @tomoguitaro 3 ปีที่แล้ว

    You are a goddess, I have been trying to bring Arduino data into excel for years and it just never really worked out but your video is straight forward and informative, thank you!

  • @mohammedsiddig7975
    @mohammedsiddig7975 3 ปีที่แล้ว

    it is really helpful thanks ever

  • @grimmwits
    @grimmwits 3 ปีที่แล้ว

    Doing this on Windows, arduinoserial module works just fine, up until I attempt to execute the code, and I am met with this error:
    ModuleNotFoundError: No module named 'termios'
    I looked it up, and apparently the termios module is unique to Linux from what I've read, and I guess some variant exists on macOS. Is there any fix for this on Windows, or will I have to use an emulator to run this code?

  • @stifenjans4342
    @stifenjans4342 3 ปีที่แล้ว

    data log thumbnail is interesting😄

  • @dany241
    @dany241 3 ปีที่แล้ว

    Thank you

  • @AbhaySingh-fv7or
    @AbhaySingh-fv7or ปีที่แล้ว

    you are glamorous.

  • @Taran72
    @Taran72 3 ปีที่แล้ว

    WOW! great tutorial: I wouldn't imagine it was so simple. Thank you for explaining everything step by step! My question is: can we view the data in Python and save it to csv at the same time? I will check your channel for more tutorials you may have already answered my question....

    • @LearnRobotics
      @LearnRobotics  3 ปีที่แล้ว +1

      Yes, you can. Just add print statements in the Python file and the data will show up in the terminal when you run the script

    • @Taran72
      @Taran72 3 ปีที่แล้ว

      @@LearnRobotics , thanks!

  • @henishviradiya1468
    @henishviradiya1468 4 ปีที่แล้ว

    Thanks for this, But in second time can we remove the Label of potentiometer and other stuff??

  • @DIYRobotGirl
    @DIYRobotGirl 7 หลายเดือนก่อน

    Can we put data angles in serial port from mg996 servos then put the servo angles in excel and then run those angles automated back to arduino. If so can it be done in state machine with millis timer and record wait times? This is with desire to run to arms and kneck 2 axis joint of a humanoid robot in recorded kinematics from pentiometers.

    • @LearnRobotics
      @LearnRobotics  7 หลายเดือนก่อน +1

      Yes - I have an example of this using Raspberry Pi on my blog: www.learnrobotics.org/blog/raspberry-pi-servo-motor/

  • @chamikamac
    @chamikamac 3 ปีที่แล้ว

    this video is great 👍👍

  • @manfredbogner9799
    @manfredbogner9799 29 วันที่ผ่านมา

    Sehr gut

  • @waleedaiad3411
    @waleedaiad3411 2 ปีที่แล้ว

    How can i use hc-12 with arduino using python language?.

  • @ashutoshdash7860
    @ashutoshdash7860 3 ปีที่แล้ว

    Can you please help to add the time stamp corresponding to each sensor reading while storing in CSV file in python.

    • @LearnRobotics
      @LearnRobotics  3 ปีที่แล้ว

      Read the comments on our blog for the answer to this: www.learnrobotics.org/blog/arduino-data-logger-csv/

  • @jiafu6784
    @jiafu6784 2 ปีที่แล้ว

    Is this possible for logging data from different serial ports simultaneously?

    • @LearnRobotics
      @LearnRobotics  2 ปีที่แล้ว

      Possibly, if you're using Python and define different Serial ports. In the Arduino IDE, nope. Usually only lets you use one port at a time

  • @rverm1000
    @rverm1000 2 ปีที่แล้ว

    excellent!

    • @rverm1000
      @rverm1000 2 ปีที่แล้ว

      ive been studing/learning python for 2 years now. it makes it easier to write arduino programs. im going make a mux multimeter and display it with python.

  • @josephdaquila2479
    @josephdaquila2479 2 หลายเดือนก่อน

    So you could have this running as a logging program and some other code deployed to the firmware of the arduino, right?

  • @Mohamm-ed
    @Mohamm-ed 3 ปีที่แล้ว

    Thanks very much for wonderful tutorial. Can I upload the csv to any iot cloud? I want to make data logger to store the data from a sensor every 15 seconds in sd card and then send the data for a whole day to iot cloud like thingspeak or something else. I need this very much

    • @LearnRobotics
      @LearnRobotics  3 ปีที่แล้ว +1

      Yes, you can

    • @Mohamm-ed
      @Mohamm-ed 3 ปีที่แล้ว

      @@LearnRobotics how?

    • @LearnRobotics
      @LearnRobotics  3 ปีที่แล้ว

      @@Mohamm-ed Try these two articles on our blog: www.learnrobotics.org/blog/how-to-fetch-data-from-dweet.io-using-python-tutorial/ + www.learnrobotics.org/blog/create-a-database-for-iot-using-dweet-io-tutorial/

  • @josephocampo
    @josephocampo 3 ปีที่แล้ว

    Nice

  • @gustavodearaujo8108
    @gustavodearaujo8108 2 ปีที่แล้ว

    THANKSSSSSS

  • @davebrown5850
    @davebrown5850 3 ปีที่แล้ว

    Why would I be getting an attribute error for ser=serial.Serial(port="/dev/ttyAMC0")
    module 'serial' has not attribute 'Serial'
    ??

    • @halifimuhamad4322
      @halifimuhamad4322 3 ปีที่แล้ว +1

      try to install pyserial package.
      run cmd
      pip3 install pyserial

  • @aakashdewangan7313
    @aakashdewangan7313 2 ปีที่แล้ว

    do you use MATLAB/Simulink with Arduino?. It will be great if you make it for control system designing. Let me know if you are planning to do so, recently.

    • @LearnRobotics
      @LearnRobotics  2 ปีที่แล้ว

      Nope - why do you need MATLAB? Is there a particular mathematical module you need from a sensor? You can get basic visualization from the Arduino IDE itself - or just read things serially into Python!

  • @cryptorcrypt1142
    @cryptorcrypt1142 2 ปีที่แล้ว

    not sure if you still comment here but i don't get the second row, I only get a
    \ at the end. Any solutions?

    • @LearnRobotics
      @LearnRobotics  2 ปีที่แล้ว

      Could be a number of things including thresholds (readings not having enough variability), data collection (didn't collect enough samples), or number of samples (set in python file) for example. You'll have to do some debugging to figure out what exactly it is. If it works in Arduino via Serial Monitor, then it's probably something wrong with your Python file writing to a CSV (using the Serial library).

  • @nupurpurohit6841
    @nupurpurohit6841 3 ปีที่แล้ว +1

    can u pls provide ur code? It's showing an error :: serial.Serial() is not a valid attribute

    • @SeetharamN
      @SeetharamN 3 ปีที่แล้ว

      Hey Nupur, make sure you have the line.
      Import serial
      In the python file. Its a library.
      Hope this helps

  • @garvasrani8410
    @garvasrani8410 ปีที่แล้ว

    Hi can you please update the code link. Its is not available anymore. Thanks!

    • @LearnRobotics
      @LearnRobotics  ปีที่แล้ว

      go to my blog for the most up-to-date links: www.learnrobotics.org/blog/arduino-data-logger-csv/

  • @shahnaman6834
    @shahnaman6834 ปีที่แล้ว

    How we can do this wireless

    • @LearnRobotics
      @LearnRobotics  ปีที่แล้ว

      Use a wireless controller or BT dongle instead of USB

  • @mohammedsiddig7975
    @mohammedsiddig7975 3 ปีที่แล้ว

    the song i wounder the name but i founf it

  • @juneshgautam8655
    @juneshgautam8655 ปีที่แล้ว

    You collected only 10 samples, what should I do to gather data every 10 seconds, or any given duration?

    • @LearnRobotics
      @LearnRobotics  ปีที่แล้ว

      Use a 10-second delay in loop.

    • @juneshgautam8655
      @juneshgautam8655 ปีที่แล้ว

      @@LearnRobotics NO, I want to keep on adding data on some files. Like every 10 seconds, I would like to record that Arduino data on some file.

    • @LearnRobotics
      @LearnRobotics  ปีที่แล้ว

      @@juneshgautam8655 Same comment as before. You'd have to try and test it out. Unfortunately, I don't debug custom projects in the comment section of my videos. You can visit learnrobotics.org/consult and request a consult if you need personalized help.

  • @engrtehniyat1162
    @engrtehniyat1162 ปีที่แล้ว

    please give coding in discription box

    • @LearnRobotics
      @LearnRobotics  ปีที่แล้ว

      There's a link to the full tutorial on our blog and you can find the source files there.

  • @rverm1000
    @rverm1000 2 ปีที่แล้ว

    my data log is coming up a little different. b`511,576
    \

    • @cryptorcrypt1142
      @cryptorcrypt1142 2 ปีที่แล้ว

      im getting the same, did you find a solution to this?

    • @rverm1000
      @rverm1000 2 ปีที่แล้ว

      @@cryptorcrypt1142 ive done a thousand things since then. have no idea

    • @cryptorcrypt1142
      @cryptorcrypt1142 2 ปีที่แล้ว

      @@rverm1000 i figuered it out

  • @tecclaudioperez
    @tecclaudioperez 2 ปีที่แล้ว +1

    The font in your screen is too small, next time make it bigger please, for blind people like me. Thanks.

  • @Avissarin
    @Avissarin ปีที่แล้ว +2

    You can tell this was done by a woman. The wires are all nice and twisted together, men don't do that, we throw it together then complain that the wire keeps falling out.