Arduino Tutorial 56: How to Graph Live Data Using the Serial Plotter

Поделиться
HTML-код
  • Опубликовано: 20 авг 2024
  • You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
    / paulmcwhorter
    In this lesson we show how to plot live data over the Serial Plotter. While there are no formatting options, it really does help to be able to quickly and easily get a live look at your data.
    You can get the kit I am using for this series at the following link:
    amzn.to/2I7N4Ek
    I strongly suggest picking up an arduino nano, since it can plug directly into the breadboard, making a portable system more practical. You can pick one up here:
    amzn.to/2WXTC2M
    As projects get more complicated in these lessons, you guys really need to get a set of breadboard jumper wires which allow you to make neater connections on the board in your projects. You can pick a pack of these wires up here:
    amzn.to/2XrY5Kq
    In addition as projects get more complicated, you are going to need a bigger breadboard. This is a reasonable one here:
    amzn.to/2IY4d3M
    Follow this lesson on our WEB site:
    toptechboy.com...
    [Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. This means if you visit the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.]
    #Arduino

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

  • @Experts_top_5
    @Experts_top_5 4 года назад +37

    Sir, take care and stay safe from Corona. by the way I have learned a lot from this series, thank you

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

    Thank you for the tip on the auto-scaling tendency of the serial plotter, Sir Paul.
    The plotting of additional data, i.e. the constants, acts as if we have a lower boundary and an upper boundary.
    While it is true that the plotter still auto-scales when data is beyond the boundaries, the graph remains neat and tidy.
    This tip is great for when visualizing if a data exceeds a certain limit. And we can see that when the data plot crosses the lower or the upper boundary, i.e. when the data plot crosses the lower horizontal line graph or the upper horizontal line graph.
    We are saved from being surprised with constantly varying scales / constantly varying lower and upper boundaries.
    Thank you for this lesson Sir Paul!

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

    Thank you so much for this lesson, and It was the first tie, when I use the serial plotter 😋.
    Pls Sir Stay at home, because you are one of the best teacher 😄😄🤗

  • @keyboardlearning7552
    @keyboardlearning7552 2 года назад +3

    This Plotter looks really useful! Finding Sin and Cos as functions in the IDE was a good surprise too. I used the Serial Printer first to check that I was getting the results that I was expecting. Finding that the Cos and Sin functions needed the angle in Radians took me a moment to unravel when I looked at the results, but I now have scrolling Sin and Cos waves. Many thanks

  • @matthewcollins1858
    @matthewcollins1858 Год назад +2

    Present. I do have a tendency to kind of wonder off and play around a bit. And I have saved a copy of every code and taken pictures of every wiring set up, so that I can go back and reference them. when I have finished your tutorials i plan on using this for personal projects.

  • @MohammadMomin
    @MohammadMomin 4 года назад +3

    Sir, your style of teaching is my favorite.💖You make concepts easier to understand and interesting. Thanks, a lot.

  • @DesertVox
    @DesertVox 4 года назад +5

    It's simpler than I thought. Although the feature has been around for a while, I haven't tried it because I thought I had to do a proper research. After watching how simple it is, I'll give it a try. Thanks for the video.

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

    Another great lesson. The serial plotter is an Arduino tool that most people either don't use or don't realize is there. The Arduino IDE is a great piece of software and, while I don't know why they don't give you a few more options regarding the plotter, it's still great. I love that I can use my ESP32 boards as well as other boards with it. Thanks again for a great lesson!

  • @frang342
    @frang342 10 месяцев назад

    Hey Paul,
    I struggled with the math on this one.However I wrote it all down in my notebook I use for coding and future reference. It's been a rewarding experience, I've learned a lot on how to write to the Arduino ide and understanding the other libraries more. Thankyou.

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

    Well that worked, nice to see something other than numbers passing you by. Onward to the homework. Have a great week Paul.

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

    Hi Paul. I just finished up your first video series that goes along with your website tutorials. While I didn't have a lot of the hardware, I still went through every lesson and got the code where it will compile. Today I ordered the kit linked in the description and can't wait to try this new series with all the new components. I also ordered the GPS and a few other components from the first series so I can go back and try them. Thanks again for what you do!

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

    Sir please start the series of Raspberry Pi tutorials this will help to improve the skills regrading for engineering.

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

    Plotting Sine and Cosine was easy.
    Declare the values as floats and do angle increments in 0.1 . I used the expression: angle+=angle+0.1; in for expression.
    The Sine and Cosine are 90 degrees out of phase with each other.
    Note: the EEPROM is guaranteed for 100,000 writes
    Wayne

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

    Awesome. Dimensional analysis is easier than I thought, now that I know it.

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

    COOL ! Love the plotter functionality. Played around with the 'delay' and it looked like a cardio monitor hehe. On with the HWrk ..

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

    Okay, sir I've done the homework. Used a "For" loop to read out the angle from 0 to 360 degrees and the sine and cos functions of the Arduino to work out the values. However I could not come up with a method to separate the 2 waves like in an oscilloscope and they were overlapping each other. Finally decided to increase the amplitude of the sine wave by doubling its value( value of the cosine wave remains the same ).
    Thankfully the plotter has various colors(colours) and the waveforms can be differentiated visually though they overlap .
    Now to check out Tutorial 57 and see if all went accordingly here or if I have goofed up.

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

      Most Excellent! Keep up the good work.

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

    Fun to learn about the Serial Plotter, thank you.

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

    sir I became your big fan for your teaching ❤

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

    Another great lesson thank Paul!! I'm going to play with sine and cosines now!! Be back soon 👍

  • @sargetester99
    @sargetester99 4 года назад +3

    A program for this, called 'telemetry ' , you can view it on RUclips, search 'arduino telemetry '

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

    Wow, didn't even know that exists. Awesome! I'll think of ways to use it in my projects :D. Thank you and stay safe!

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

    you deserve at least 5 million subs

  • @johnhechtlinger9465
    @johnhechtlinger9465 5 месяцев назад +1

    this is insane....my serial plotter showed NOTHING...someone else here had the same problem even though the serial monitor worked fine. The solution? I had to remove the space between the colon and "Distance to target is: " in Serial.print . Huh?? Anyway, now it works

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

    Thanks a lot for this lesson sir....... It's a new lesson I learned today.

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

    I used if statements to ignore values above 10 and less than 0 for the variable distanceToTarget to keep plot between 0 and 10. It gives better plot.

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

    Thank you. Was wondering what Serial Plotter was in the Tools.

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

    Thanks Paul.

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

    Thank you.

  • @3xAudio
    @3xAudio 4 года назад

    Nice Video and project. great idea I'm going back to basics because I'm a bit rusty with arduino and looking for ideas

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

    will be there any ARM tutorials?

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

    Using an if statement to constrain the variable value to be printed could be used to constrain the y-axis plot value and keep the plot from wild rescaling. For example:
    if (varY > maxYValue) {
    Serial.print(maxYValue);
    }
    else {
    Serial.print(varY);
    }
    set maxYValue to a level beyond expected plus add some guardband. This should keep your plot from rescaling.

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

    You should do a Tutorial on the RTC Module

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

    Great video

  • @aaroneipejohn5715
    @aaroneipejohn5715 Месяц назад

    hey great idea to prevent auto scaling, but is there a way to prevent it from hiding away old reading? as in could it compress the whole graph horizontally as new data keeps adding in?

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

    Thanks!

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

    Gute gemacht👾🤖

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

    Hi sir I have worked thru the the lessons from 1 to 56 and now the rest is privet video's, do I need to join toe do the rest. Thanks a lot excellent why of explaining I have learned a lot .

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

    Thank you grandpa 😊😊

  • @christianbautch4015
    @christianbautch4015 2 года назад +2

    Hey Paul, so I tried pulling up my serial plotter but instead of showing me the graph it showed a blank screen and the number values went from left to right instead of bottom to top. Do you know why that would be?

    • @johnhechtlinger9465
      @johnhechtlinger9465 5 месяцев назад

      same problem

    • @mattryan-mq2yp
      @mattryan-mq2yp 21 день назад

      @@johnhechtlinger9465 @christianbautch4015 I'm pretty late. But it's most likely because in your Serial.println you have text. The Serial Plotter doesn't understand human text, so it doesn't know what to print.
      Change it to this Serial.println(pingTravelDistance); ... should work

  • @MarvelBi
    @MarvelBi 2 месяца назад

    Ok it seems to balance out with the boundaries but still really jumpy if anything moves

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

    Awesome video! Can you make one about a 7 segment display tutorial? Thankyou!!

  • @s.sonski631
    @s.sonski631 Год назад

    You make learning so much easier. I was working on the Sin wave, BUT, the X axis moves way to fast so all I get is a wave line. Is their a way to slow the X axis speed/count/ ? down?

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

    Hi Paul,do you have a series on the speeduino, vehicle ecu,Iwould love to learn to use this product,,,,awesome lessons

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

    Thanks

  • @ricardohenry2160
    @ricardohenry2160 9 месяцев назад +2

    Clean graph*

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

    You could limit the distanceToTarget between 0 & 10.

  • @simontopley4771
    @simontopley4771 8 месяцев назад +1

    Out of interest, i upset mine, it was hung, the plotter was hung, the LCD display was stuck, even after changing data ints, i reset the arduino several times, in the end, i reset the sensor then reset the arduino, this cured the problem, can't say why, but there is quite a bit of logic on the pcb, so who knows?

    • @JimPeugh
      @JimPeugh 5 месяцев назад

      Thanks to your comment I reset the sensor and plotter began working.

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

    Sometimes you get a negative spike for distance if you swipe your hand quickly across the sensor. Why is this ?

  • @user-zz7nt5xn3g
    @user-zz7nt5xn3g Год назад

    Can you use the distance data in another program live (like Unity)?

  • @MarvelBi
    @MarvelBi 2 месяца назад

    Maybe it’s just the sensor that came with my kit but my data in the monitor and plotter flickers everywhere. Especially when I tried measuring distance a couple videos ago it would shift between like 193 then 230. My plotter looks like a rectangular wavelength that repeats lol. Any advice on how to fix it Paul?

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

    How many more videos have you planned for this series

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

    Did I miss something here? In Tutorial 55 you talked about two lessons : one on dimensional analysis and one on using a low pass filter. Are they coming later? I was expecting them before this tutorial on plotting live data.

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

      I didn't see one. I decided to sample my readings 100 times and take an average. I did a for loop 100 times. I added the sensor value (initialize to 0 at the beginning of the void loop) to a variable on each pass. Then, once outside the loop, divide the variable by 100 and use that result to calculate the distance. The output seems much more stable like that. This is a math workaround to an electronics problem. I hope to see the low pass video soon.

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

    Sorry, I looked in the Arduino kit and I could not see any Sine Waves...and I went off on a Tangent, Cos. I don't know why.

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

    Paul, can you show us how to use the Infra Red module please

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

      Patience . . . it is coming in a future lesson.

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

    When I disable serial monitor and restart it, the arduino board reboots. Is there any way to avoid that?

  • @ajbalidio.01
    @ajbalidio.01 Год назад

    Can i apply it to RFID? serial plotter

  • @VinhPham-td1wm
    @VinhPham-td1wm 4 года назад

    Your tutorial is so awesome and so easy to understand and apply it in real life and pls recommend my comments about nrf24L01 module tutorial.

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

    "no sugar. none needed, it is refreshing enough as it is." and you're sweet enough as is.

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

    we have different result i will try again

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

    Sir, can you pls teach adafruit feather

  • @VinhPham-td1wm
    @VinhPham-td1wm 4 года назад

    Sir, can you pls make a video about nrf24L01 module tutorial? I look on the internet but i can't find good info that i could understand and write myself a code. So pls make a video about that. I would be really appreciated if you could make one for my friends and i.

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

    Hello sir.
    Thank you so much for the content you put on RUclips. You're a model here in Africa. Could you possibly do a project on an arduino based solar charge controller with LEDs that change color on the basis of batteries been charged, charging and low.
    Alternative energy is a major priority here and I want to build projects related to alternative energy. Thank you in anticipation of a response.

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

      Maybe you could use the voltage reading tutorial he did and then a series of if statements to light various leds based on the voltage. if reading >= 12 volts write greenLED High, if reading >11.5 && reading < 12 then yellowLED HIGH..... Of course you would probably need some pretty significant resistors to step down the voltage (see tutorial on that one) to get a voltage you could use with the Arduino. DISCLAIMER - I am not a professional coder or electrician, so check these ideas with someone who is. I'm just a middle school teacher.

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

    "The dog ate my homework"

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

    Is Serial Plotter not an option for Visual Studio Code? only in Arduino?

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

    Sir make the video on quad helicopter plz

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

    Seems like Lessons 57 - 68 are not available any idea on when they will be up ??

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

      Patience, grasshopper . . . videos are released one per week on Tuesdays. If you are locked down and not getting enough material, hop over to the Jetson Nano playlist on this channel and check it out.

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

      @@paulmcwhorter During the wait, I incorporated the LCD to lesson 55 but without a potentiometer.
      int trigPin = 12;
      int echoPin = 11;
      int deltime = 10;
      #include
      int Contrast = 75; // Setting the contrast to 75
      float pingTravel;
      float pingDistance;
      float distance;
      float velocity = .0134992; // inches/microseconds
      int longwait = 1000;
      int rs = 7; // The next 7 int were to set up LCD pins
      int en = 8;
      int vo = 44;
      int d4 = 2;
      int d5 = 3;
      int d6 = 4;
      int d7 = 5;
      LiquidCrystal lcd(rs, en, d4, d5, d6, d7); //Setup LCD Object
      void setup() {
      // put your setup code here, to run once:
      analogWrite(44, Contrast); // Writing Contrast to 44 (PWM pin)
      lcd.begin(16, 2);
      delay(longwait);
      Serial.begin(9600);
      pinMode(trigPin, OUTPUT);
      pinMode(echoPin, INPUT);
      }
      void loop() {
      // put your main code here, to run repeatedly:
      digitalWrite(trigPin, LOW);
      delayMicroseconds(deltime);
      digitalWrite(trigPin, HIGH);
      delayMicroseconds(deltime);
      digitalWrite(trigPin, LOW);
      pingTravel = pulseIn(echoPin, HIGH); // pingTravel is in Microseconds
      lcd.setCursor(0,0);
      lcd.print("Ping : ");
      lcd.print(pingTravel);
      pingDistance = (pingTravel / 2); // cutting travel by 2 to get point of deflection
      distance = (velocity * pingDistance);
      lcd.setCursor(0,1);
      lcd.print(distance);
      lcd.print(" Inches ");
      delay(longwait);
      }

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

    Paul. sorry I have to temporally stopping follow your lessons because of COVID-19.Unfortunately do not have my PC and all Arduino's KIts with me right now. Anyway, As I am thinking for the assignment of sine/cosine and my idea is graph which mirrored of function y = f(x) for sine and y=-y for cosine. From my old school Pi is better presentation for cycle of sine. 2Pi is whole cycle, Pi is half cycle and 1/4Pi, 1/2Pi, 3/4Pi and etc. As example, if max sine (y) as 10 then it is 1/2 of Pi, 1/4 of Pi equal y=5 or close, 3/4 of Pi is close to 5, then for next half cycle Pi+1/2Pi as max and etc. Thanks to refresh knowledge from 70 th.

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

    Please Sir..... Can you do a lesson on keypad...

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

    "Let me show you how to do a graph. First of all, you have to KILL-"

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

    Am I the only one getting negative numbers for the Ping Travel Time & Distance? I don't get how thats even possible lol

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

    can i get you coding sir ?

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

    Thanks Paul.

  • @Top-notchShorts
    @Top-notchShorts 4 года назад

    Great video