Arduino Tutorial 24: Understanding Passive Buzzers

Sdílet
Vložit
  • čas přidán 3. 08. 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 you how to introduce sound into your Arduino project using a Passive Buzzer. The advantage of a passive buzzer is that you can control the tone by adjusting the rate at which you switch it on and off.
    You can get the kit I am using for this series at the following link:
    amzn.to/2I7N4Ek
    You can follow these lessons on our WEB site HERE:
    toptechboy.com/arduino-tutori...
    You can also follow there lessons at our WEB site. This lesson is HERE:
    toptechboy.com/arduino-tutori...
    [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
  • Věda a technologie

Komentáře • 401

  • @henderic0
    @henderic0 Před 3 lety +28

    Those beeping noises made my bird go absolutely bonkers 😅.

  • @borymcpherson9759
    @borymcpherson9759 Před 4 lety +141

    Boy I had a hard time with this session! I am 71 years old and about half deaf and I could just barely hear any of the tones from the passive buzzer. I just kinda had to take your word for this one. Hope I can do better on the next lesson. I am really enjoying have somethinge to do while being shut-up in my house, due to this virus. Thanks for your time and effort!

    • @BRP42
      @BRP42 Před 3 lety

      The pickup on the microphone wasn’t great.

    • @arlo4051
      @arlo4051 Před 3 lety +11

      Consider yourself lucky, with Tinnitus I get to hear the passive buzzer full volume, 24/7, with it turned off, in a drawer. As for the buzzer on the bread board can't get it loud enough to hear over the one in my head.

    • @ayushmanjain4008
      @ayushmanjain4008 Před 3 lety +3

      Just slightly touch the buzzer and do not cover the top. You would be able to feel the tone

    • @MaxRelativo
      @MaxRelativo Před 3 lety +2

      Congrats, Bory! I think most of the guys of your age should be so pro-active!

    • @frankswift5119
      @frankswift5119 Před 2 lety +2

      I'm in my seventy's and I cannot hear any of the sounds but my wife can.

  • @tashadurrahman
    @tashadurrahman Před 4 lety +27

    I did the the homework assignment and it went perfectly well! YAAYYYYY!

  • @m00se22
    @m00se22 Před 4 lety +25

    I was able to make a little alarm and authentication circuit depending on whether the user enters a correct password or not using the serial monitor. Thanks for putting this information out there! With what I've learned from you, I feel comfortable taking on my own projects more so than before with Arduino.

  • @dancorwin9232
    @dancorwin9232 Před 2 lety +9

    Hey paul! Really loving this series. I'm not sure if your musically inclined at all, but as a musician myself is trying to get into electrical engineering, the reason those first few buzzes you were making "sound like music notes" as you put it is because they actually ARE musical notes! When you were tinkering around with the delay time and setting it fro my 1ms to 2ms and 3ms and so on, you are actually creating what's called an Overtone Series of notes! It's one of the fundamental Bridges between sound waves and our modern understanding of music. You may have already known this, but I figured I would point it out as a shout out to any other musically inclined engineers!

  • @Sheredo
    @Sheredo Před 8 měsíci +7

    Hi Paul, great lesson as always!
    In case someone, like me, is watching only now, 2 things:
    1) Just to make sure I did the equation correctly, I printed the value of both my tone and my potval, exptecting that:
    -If potval=0, then tone=60.
    -if potval=1023, then tone=10.000
    Initially I had problems 'cause when potval was equal to 1023, my tone was something like 9.670
    Then I realized that I set the tone as an INT instead of a FLOAT!
    In the video you did the same, but withot the serial monitor I think you didn't realize this.
    Changing the tone into a FLOAT made everything right.
    2) Even though my math was correct, the tone I was hearing seemed a lot different than yours.
    I discovered that it was due the serial.print I put in the code.
    Reading the comments of this video, I discovered that I could keep the print if I changed the baud rate of the serial monitor into something higher! (1.000.000 was the minimum to not have distortion).

    • @simpjkee
      @simpjkee Před 3 měsíci

      I was having all these issues as well.

    • @simpjkee
      @simpjkee Před 3 měsíci

      I tried this again tonight. With the higher baud rate it sounds much better, but it still sounds very distorted for me. It sounds like something an experimental prog rock band would do like Pink Floyd or something. It's doesn't sound anything like a tone a flute or something would make.

    • @MarvelBi
      @MarvelBi Před 2 měsíci

      Dude thank you so much I thought it was just ne

  • @RahulMishra-ov4nr
    @RahulMishra-ov4nr Před 2 lety +3

    This is the first time I didn't do the project on my own but later realized I could've done it if I tried harder. Great videos keep up the good work.

  • @gilnasty82
    @gilnasty82 Před 2 lety +5

    Math has never been my strongest skill! But after playing with this circuit and tweaking the formula numerous times, I have a much better understanding of what's happening! Thanks Paul!!

  • @426F6F
    @426F6F Před rokem +3

    That formula took me like 10 mins to work out on my own 😅 I like this form of logical thinking though, it's good practice!

  • @octogintillion
    @octogintillion Před rokem +1

    I got the formula right, but I did it way less elegantly. 😅The way I thought it out is that you have to go from potVal=0 to tone=60, and the only way to do that is to add 60 to 0. Then if you would continue with the 10000/1023 like we did previously to get tone=10,000 for potVal=1023, you would actually end up with 10060 since you added 60 before. So I just subtracted 60 from 10,000 to get the value to divide by 1023.
    I love that you show the "right" way to solve problems like this! Keep up the great work.

  • @kananabdlyv
    @kananabdlyv Před rokem +8

    Mr.McWhorter I am very thankful that your channel popped up in my CZcams recommendations. I was looking for a good Arduino teacher, and in a short period of time I found you. Although I had a great experience with programming before learning Arduino, your videos really helped me to actually visualize the process happening behind my code. I carefully listen to your homeworks, and more importantly, do not cheat :) I especially liked this lesson's homework (very enjoyable). Thank you for everything so far.

    • @kananabdlyv
      @kananabdlyv Před rokem +1

      Also thanks for liking my comment 🙏

    • @S24W2
      @S24W2 Před rokem

      Me too 😊

  • @MrVacuumBrainBimbo
    @MrVacuumBrainBimbo Před 3 lety +1

    1:11 It's actually silicone dielectric potting and not black tape on the bottom of the active buzzer. Only pointing this out in case someone wants to know this; I'm not just being a pedantic jerk for the sake of it. Loving the series so far, I've learned so much.

  • @jstro-hobbytech
    @jstro-hobbytech Před 3 lety +5

    figured it out! most personally rewarding lesson yet. thank you so much Paul, you have no idea what these classes are doing for my mental health.

    • @paulmcwhorter
      @paulmcwhorter  Před 3 lety +19

      Actually, it is incredibly good for mental health to create something. Build something, grow something, cook something, make something. All incredibly healthy. I think a lot of people on lock down are binging on Netflix, silly cat videos, and inappropriate internet content, and really think it is driving people into depression and mental illness.

  • @Anonymous-yy5qr
    @Anonymous-yy5qr Před 3 lety +1

    The satisfaction that I get after doing your assignment without your help is immeasurable ❤️

  • @thesauceboss4502
    @thesauceboss4502 Před 2 lety

    This was my favorite lesson so far, I struggled trying to make sure that the delaytime never dropped below 60, but the coffee helped me get through it! Thank you so much for these videos, they make it so much easier for beginners like me to learn. I enjoy them so much I spent 8 hours watching your videos yesterday!

  • @damonbostrom6857
    @damonbostrom6857 Před 5 měsíci

    I'm really getting a lot out of this series! I've worked through each tutorial so far. Thank you for producing this class! I hope that you will cover midi compliance eventually.

  • @dubrocadidier4583
    @dubrocadidier4583 Před 2 lety

    This was fun . I had the mathematics right but was confused between the delay and delayMicroseconds. It is NOW clear from your explanations . Thanks Paul , you are a blessing .

  • @simontopley4771
    @simontopley4771 Před 8 měsíci +1

    Confess, i did struggle with this one somewhat, i get stuck on the maths, working out these formulae at my age isn't so easy.
    Thanks again.

  • @hasan-motam
    @hasan-motam Před rokem +1

    This assignment helped me to understand passive buzzers. Thanks Paul.

  • @randallg.bennett3695
    @randallg.bennett3695 Před 3 lety

    Hi again Paul, Thank you for the lesson, it made sense, and I did need your help (a bit) after the lesson and before the code writing, but it all made sense after I watched you perform the functions. Much appreciated!

  • @TMRu22311
    @TMRu22311 Před 2 lety

    This was a fun lesson, reminded me of the "Library Tormentor" project I did in high school many years ago (1986). I added a switch to the buzzer to turn it on/off and my cats thanked me for it :D

  • @jasonbrown2674
    @jasonbrown2674 Před 9 měsíci +1

    I got it! Amazed myself. Thanks Paul, great lesson 👍

  • @danwolfe7665
    @danwolfe7665 Před 3 lety +5

    Loved the homework assignment, really made me think and do a little math. I did it opposite mathmatically so my equation was Y=-9.7165(X)+10000

  • @robertnelson1802
    @robertnelson1802 Před 3 lety +2

    I used variable for buzzH, buzzL, potH & potL (all integers adn it still seemed to work) then used a variable based equation. I also put print statements in the loop but had to take them out as they were causing the tone generator to just click. Took me a little while to realise that it was the print statements that were doing that. Keep up the great work - loving the course.

    • @user-kg1jx5cw4f
      @user-kg1jx5cw4f Před 10 měsíci

      Wondering why with a delay after the print code (Serial.print(); with delay after creates only clicks?? Without delay, no clicks! delays of 500, and 1000 ms. the clicks occur.

  • @stefannilsson7692
    @stefannilsson7692 Před 5 měsíci

    Thanks for the good examples with different calculations. They help very well. Thank you very much for that

  • @rakowumusic5143
    @rakowumusic5143 Před 2 lety +3

    Such a great content. I have already learned so much about the circuits. For those who like to make music :)
    int outPin1 = 13;
    int c = 472;
    int d = 420;
    int e = 375;
    int f = 353;
    int g = 315;
    int a = 280;
    int b = 249;
    //delay
    int dt = 100;
    int minim = 2000;
    int crotchet = 1000;
    int quaver = 500;
    int semiquaver = 250;
    void setup() {
    pinMode(outPin1,OUTPUT);
    }
    void note(int duration,int note,int pause){
    for(int i=0;i

    • @rakowumusic5143
      @rakowumusic5143 Před 2 lety +1

      (I have also made pirates of the caribbean :D)

    • @XHuang-hv5cj
      @XHuang-hv5cj Před 2 lety

      Nice work! how long did this take you?

  • @paulrockwell9914
    @paulrockwell9914 Před 3 lety

    I'm an experienced software guy (dusting off some long-dormant C coding) making the foray into circuits and microcontrollers now that I'm retired. Nice progression from the relatively short lesson 23 to lesson 24 with the passive buzzer. Love it when lessons have a logical progression.

  • @theteenengineer7589
    @theteenengineer7589 Před 5 lety +2

    Great content Paul!

  • @njsk8rdan
    @njsk8rdan Před rokem

    I am having fun going along with these videos. When you said "that's annoying I am going to unplug it" I said "that's why I added a 'while(potVal>1000)' statement. Wanted to make sure I could get to somewhere on the potentiometer where it wouldn't make any sound. 🤣

  • @rexbarr_5783
    @rexbarr_5783 Před 4 lety +2

    These lessons are awesome!!!! You tha' man Paul!!

  • @stevemorgan3597
    @stevemorgan3597 Před 4 lety

    Hi Paul. I like the way you teach. Good explanations and visuals. I learned a long time ago in calculus courses to draw diagrams and graphs because it helps with the math. Once the formulas are determined, it makes the programming so much easier. Thanks for all you do.

  • @user-ys6bc7yh7z
    @user-ys6bc7yh7z Před 10 měsíci

    Thank you very much for the great lesson!
    I did the assignment using if statements in the beginning, and I am ashamed to admit, that I watched the beginning of the homework explanation before finishing it on my own. I will work on my math!
    Thank you very much again, you are a true inspiration, and I am so happy to learn from you.
    All the best!

  • @marcovichcamposilva4082

    Thank you very much mr. Paul.
    i`ve been watching your lessons the way i even dream about arduino,really.
    i failed in this homework, thats the path to knoledge.
    I wish the best for you and those who love you.

  • @samhat41
    @samhat41 Před 4 lety

    Very good lesson as always, keep up the great work!

  • @erikburman530
    @erikburman530 Před rokem

    Holy Moly! At 61 years of age this is the first time since high school algebra that I've truly understood how to apply the equation for a straight line. That sad little equation has been lying dormant in some cobwebbed recess of my mind until today.

  • @philnewman1110
    @philnewman1110 Před rokem

    Great video as always Paul, thanks!

  • @carlos2004
    @carlos2004 Před 4 lety +48

    for anyone doing the Serial.println(potVal) command, i think it messes up the timing for the tones. even when using numbers and not using the potVal, i couldn't get mine to work. but as soon as i deleted the println command, the tones worked perfectly with value, and the potVal.

    • @mengkin5836
      @mengkin5836 Před 4 lety +14

      heyy, i had this problem too and i found out its due to the baud rate, as you increase the baud rate the sound will get better, i was shocked too when i finally found out

    • @TheKverbeeck
      @TheKverbeeck Před 4 lety +5

      Thank you Meng and Carlos, that solved the issue i had. Printing more text (data) per line deforms the tones even more.
      String msg = "Delay (Tone) is: ";
      Serial.println(msg + buzzTimepot);
      So i changed the baudrate to 2000000 and now all is well.

    • @joeb.fromsydneyaustralia5313
      @joeb.fromsydneyaustralia5313 Před 4 lety +1

      I had the same problem... getting rid of the Serial fixed it.

    • @trakeC
      @trakeC Před 4 lety +12

      I had the same issue. And just fyi instead of deleting your code just go through and add // in front of the lines of code you are unsure about instead of deleting it. That will make it a note and not part of the process. This way you can verify an action before fully acting on it. It's a common practice in code troubleshooting. Other languages have different commands but in this case its //

    • @chrisjohnson6765
      @chrisjohnson6765 Před 3 lety

      A good debugging process for this is to use the // comment lines in front of the suspect line to test it without deleting it.

  • @CarolMartinYoutuable
    @CarolMartinYoutuable Před 2 lety

    Math has always been a weak point for me but thanks to your lessons, I've been able to do this. I was able to do the homework without any help other than the comments below when I didn't get the right tones because of the print statements in my code and the low baud rate. When I removed the print statements (or at least narrowed them to one print statement) it all worked beautifully. Thanks again Paul

  • @billcrow5403
    @billcrow5403 Před 4 lety +1

    Great video. I change the toneVal around and played with those

  • @nurgarciaterrassa8593

    Great lesson, thank you!

  • @michaeljenkins2345
    @michaeljenkins2345 Před 3 lety +1

    The Elego kit is a wonder in packing engineering and a physical paradox all in one! Items are packed so full of stuff and yet so neatly, but once you remove items, you'll never get them all back in the way it was. I have used a separate tool tray that is now full, as well as the Elego kit tray which is somehow still full! Mind blown!

  • @techbymo
    @techbymo Před 2 lety

    I hadn't done math in a long time and this homework assignment shook some rust off of my brain but glad I could do it on my own with some minor issues haha

  • @iandawkins2182
    @iandawkins2182 Před 5 lety

    Awesome, just keep leaning all the time thanks to your work on your channel. So understandable and yes I hold my breath when uploading a sketch and it does work ;-))

  • @Traxonen
    @Traxonen Před 2 lety

    Really interesting video. I'm lerning fast and easyly! Thanks a lot!

  • @shvideo1
    @shvideo1 Před 4 lety +3

    A. Very cool and fun project. Thank you for the math as well.

  • @user-cy3je1xd1c
    @user-cy3je1xd1c Před 4 lety

    Great lesson! Thanks, Paul for making them!
    P.S. I have done the assignment before watching you doing that

  • @robjameson7965
    @robjameson7965 Před 4 lety +1

    'Passive', the "BLUE LED" of the buzzer world! Todays a special day! : )

  • @muhammadrafiqulislamkhan6994

    Few day I busy with my room construction resetup that is why I can not attend your lesson but I am back. And would say you are a Messaih for me. I do not understand why I understand your all words so easily. What is the reason? I have tried another Arduino video but as you no one for me. You are a perfect teacher. Day after day overwhemingly I just watch and learn from you. You are such a kind teacher. Thanks for you. God bless you.

  • @Hino_55
    @Hino_55 Před 4 lety

    Thank You Sir Paul!

  • @persoonsaini4794
    @persoonsaini4794 Před 4 lety

    Plz keep doing the good work. You are absolutely amazing.

  • @georgeshaiffer2246
    @georgeshaiffer2246 Před 3 lety

    That worked! I finally heard one of these!

  • @ErlankBru
    @ErlankBru Před 4 měsíci

    This was a very cool assignment!🤠

  • @dannycollins5698
    @dannycollins5698 Před rokem +1

    Interesting sounds with this one.

  • @eurekaibanez3697
    @eurekaibanez3697 Před 3 lety

    Thank you sir only all your works I did successfully to be operational.

  • @batticha462
    @batticha462 Před 4 lety +18

    The hearing of high frequency tones depend on age, the younger the higher frequency to hear

    • @vitustillebeck4965
      @vitustillebeck4965 Před 3 lety

      yeah. thats why i heard all of em at 13. but thats just because im young.

    • @tedparker640
      @tedparker640 Před 2 lety +1

      I'm sorry, I can't hear you. can you please type louder?

  • @danielsaenz5570
    @danielsaenz5570 Před rokem

    Great lesson! I think I prefer using the tone() function though, I was able to make so much different music notes with it! It was awesome!

  • @johndavid360
    @johndavid360 Před 3 lety

    Even though I don’t have a passive buzzer I’m still going to watch this video for consistency!

  • @user-vf7fx2ff9d
    @user-vf7fx2ff9d Před rokem +2

    Hello Paul, I tried the excercise on my own, as you recommended....but got a difference in solving the excercise. You said....if you turn the potentiometer to the left, have a delay of 10.000 microseconds....to the right 60 microseconds? Right? If yes, to the potentiometer to the left will return a potValue of 0. So the combination of x and y will be: if the potValue will be zero, the delay should be 10.000 microseconds...and vice versa to the right....potValue 1023 will return a delay of 60. The equation will then be different: y=-9,7165+10.000.
    If I misunderstood your instructions....nonetheless a big thanks, because the result was: I LEARNED IT!! Best regards!

  • @Dieselfitter01
    @Dieselfitter01 Před 5 lety

    Fantastic lesson on the passive buzzer. So much can be the influence on the buzzer with this kit. Oh BTW my AI parts started to arrive today, through your links that is. Case with fan, Micro card, Jetson Nano, Pi Camera, 110 power supply and the WiFi. I am expecting the Webcam tomorrow. The wireless keyboard and mouse were too far off for me to wait for so I will try what I already have and if that fails I will hit the local store. This AI Project is something I think everyone here would be interested in. Great content as always and look foreword to whats in store next.

    • @paulmcwhorter
      @paulmcwhorter  Před 5 lety

      I will admit I have been pulling my hair out on the nano the last couple of weeks, and almost ready to give up, but think I got some stuff figured out today. Bleeding edge technology which means it is not all figured out yet. Really want to do a series on this now. I have gotten some pretty cool things going now.

  • @ianneill9188
    @ianneill9188 Před 4 lety

    Ok, I am a bit late to the game here, but I really enjoyed this lesson. I think the repeat line graph math refresher was super. Many thanks for your diligence and time.

  • @opalprestonshirley1700

    Enjoyed this project. Now I have something to annoy people with...LOL, seriously a fun project. Thanks Paul.

  • @ruslandubas472
    @ruslandubas472 Před 3 lety

    Great lesson! Boom!

  • @ijlie
    @ijlie Před 3 lety

    Hi Paul, combined tutorial 18 and this one to have the buzz time asked for in the serial monitor. Gave me fast interaction and saved some upload time.

  • @lloydbotway5930
    @lloydbotway5930 Před 3 lety

    This works quite well. More fun: check out the tone() function, which does much of this automatically.

  • @tameraziz2104
    @tameraziz2104 Před 4 lety

    Thanks Paul.

  • @erygion
    @erygion Před 4 lety +2

    Great video Mr. Mcwhorter. My wife ran away! She doesn't like piezo speakers at all, thank you.

    • @MrJohnjamesboyd
      @MrJohnjamesboyd Před 4 lety +1

      So did my wife, but with my industrial deafness I didn’t realise it was working lol

  • @fetchfooldin3252
    @fetchfooldin3252 Před 3 lety +2

    I've just learnt how to fuse between math and programs. I diiid the assignment before completing the video. But forgot +60 in the equation (-_-;)
    Thank you so muuuuch

  • @berlinjackson1847
    @berlinjackson1847 Před 2 měsíci

    I just turned 71 also. Im with you on that

  • @dannycollins5698
    @dannycollins5698 Před rokem +1

    Thank you!

  • @iocircuits
    @iocircuits Před 4 lety

    great work.

  • @richardstewart4135
    @richardstewart4135 Před 3 lety

    Another Great Video!! the homework was a bit challenging, but it was worth it to get that buzzer to make that terrible noise. Up there with squeaking chalk on a board. ;). Anyway, thanks again for the educational lesson and I look forward to the next

  • @sugumarprabhakaran3378

    Hi Paul! I'm loving your series - thank you so much!. I bought myself an ELEGOO kit and have been following along. Just one thought: i think it would be great if you could make a video on the physics behind how the passive buzzer works. Thanks again,

  • @syedibraheemzeeshan806
    @syedibraheemzeeshan806 Před 10 měsíci +3

    It is so heart breaking that as more and more we go deeper in lessons, Views are also getting shorter. Very little people are commited :(

  • @alanford7933
    @alanford7933 Před 3 lety

    Really good. I used Serial.println (with the good old trusty 9600 Baud rate) and realized that I was not starting at 60. Then went back and included it. Good to do the homework and pick up own mistakes.

  • @GraveGear
    @GraveGear Před 3 lety

    Completely forgot to plug everything into the equation after I found the slope. Was trying to convert with just "m"! Thanks for the video!

  • @prussianblue222
    @prussianblue222 Před 3 lety

    First, GREAT series. I am a hardware guy and learning to program is going well with your help. HOWEVER, it seems that timers in Arduino, maybe especially the older UNO (mine is 10 years old?) are really finicky. I was having lots of problems with this assignment and I had the serial monitor turned on so that I could see what was happening with all my values. Serial monitor seemed fine but the tones were jumping, not smooth. Was pulling my hair out until I turned off the serial monitor then Voila! It worked perfectly. Just something to watch for.

  • @jasonford1
    @jasonford1 Před 4 lety

    For extra credit, I looked up the tone() function and discovered it ranges from 31Hz to 4978Hz. I plotted tone on the y-axis and potentiometer values of 0 to 1023 on the x-axis. I then used y=mx+b to convert the potentiometer signal to a tone between 31Hz and 4978Hz with one exception. I made 31Hz == noTone(). Now my ears can rest! Time to pause having completed 19-24 and 48/49 today. It has been a great day of learning! I look forward to photoresistors and photodetectors next.

  • @yogeshasati6210
    @yogeshasati6210 Před 5 lety

    Love you Paul..

  • @hedgewicksattempts
    @hedgewicksattempts Před rokem

    Banging my head against the wall on this homework for a bit, just getting a clicking sound out of my buzzer. Ended up boosting the baud to 115200 and now it's working great! Time to unpause and see how you made this!

    • @hedgewicksattempts
      @hedgewicksattempts Před rokem

      Maybe it's because I was printing my values in the Serial Monitor at the same time?

    • @paulmcwhorter
      @paulmcwhorter  Před rokem +1

      Yes that will throw off the timing.

  • @mester.mechanic
    @mester.mechanic Před rokem

    love you paul

  • @charless704
    @charless704 Před 3 lety +1

    Paul, @ 9:45, you said when the potentiometer is turned to the left the delay is 10,000 microsecond delay, and when turned to the right it is a 60 microsecond delay. I believe your linear equation is flipped, if you will. Obviously, it still works, just with the tone changing backwards as originally described. Love the videos. Nice work

  • @michaeldrake2512
    @michaeldrake2512 Před 2 lety

    These buzzer ones I definitely hooked a switch up to reduce how much buzzing I actually had to endure haha. Hot tip for anyone else.

  • @theknottyworkshopgeoffjung529

    Paul, I believe that you ask that the 10,000 mS tome (lowest) be on the left and the 60 mS (highest ) be on the right. This would make the equation a negative 9940 or change the polarity of the pot.

    • @revupreview
      @revupreview Před 3 lety

      Yep, that's what he did. But I still got it working even though my formula is a bit different:
      potVal = analogRead(potPin); // Get potentiometer value.
      buzzVal = (1023.0 - potVal) * (9940.0 / 1023.0) + 60.0; // Calculate delay time in microseconds.
      soundTone(buzzVal); // Make a sound.
      (I wrote a simple soundTone function to make the sound.)

  • @aaronmilliman7685
    @aaronmilliman7685 Před 2 lety

    Great lesson, I'm off to work and will knock out another one later.

  • @hussambarodi8014
    @hussambarodi8014 Před 3 lety

    Very nice, very simple and very easy.
    Even I learned programming since 30 years, but I am ready to leave everything behind me and go forward for Arduino with Mr. Paul.
    Thank you Sir, and your students are really lucky.
    If you allow me to suggest, or maybe request, something. I am not sure if you keep the examples that you made saved in your computer or not, and if so, I hope if you can share them with us. It was my fault that I did not write since the first lesson, and now after I completed 24 lessons, I am unable to go back and check them all, why, because I am thirsty for more and more lessons

  • @InfectedCreations
    @InfectedCreations Před 3 lety

    If you try this don,t print anything to your serial monitor because this has influence on your tone. ✌👍 Another great tutorial. Boom.😊🤣

  • @iplayflute
    @iplayflute Před 2 lety

    Tip on how to boost the volume of your buzzer: tear out a piece of paper and place it above the buzzer, the larger diaphragm results in more vibration.

  • @krishamsub.subedichhetri5895

    I think instead of digital write if we analogwrite we can also use a potentiometer to vary the loudness of the buzzer, because the higher the voltage/Amplitude the louder the sound.

  • @johnk2743
    @johnk2743 Před 3 lety

    Today my "The Most Complete Starter Kit" arrived so finally I could use the buzzer! Up until now was able to use components that I already had. Great kit, should have bought this together with my first Arduino! Lot's of thing I collected earlier but this kit is something else!
    The icecoffee is not for me, I stick to the hot variant. No sugar, no cream and strong! My viewing binge from the first video up to this one was fun and very informative! The (hot) coffee, my impatience and holding my breath (and some shouting at the screen as well, I confess) made it an intesive journey. In these pandemic times it's fun to play around with this Arduino stuff (while learning as well) and the partial lockdown we're under (I'm from the Netherlands) makes it a great way to spend the time at home. Your coding standards I recognize from my early coding days with Clipper.
    Thanks a lot for your teaching, it's fun, informative and very well produced! I wonder what tools you use making your video's. Thank you so much Paul!

  • @jaytea23
    @jaytea23 Před rokem

    Great lesson as always! One minor thing, you switched the delay times from what you told us in the homework. So you wanted us to have a delay of 10,000 microseconds when potVal is 0, and 60 microseconds when potVal is 1023. So the equation would be a little different: y= (-9940/1023)x + 10,000

  • @zudzifudushzy
    @zudzifudushzy Před 2 lety

    That homework was super fun!
    I think you said 60 and 10000 in your assignment the other way around than in your solution, but that doesn't really matter :D
    I tried to work with as many variables as possible and added Serial.print with a high baudrate to have a look at the values. The high baudrate is to not mess up the timing of the tones.
    Here is my version of the homework:
    int buzzPin = 8;
    int buzzTime;
    float rightFreq = 60;
    float leftFreq = 10000;
    int potPin = A1;
    int potVal;
    void setup() {
    // put your setup code here, to run once:
    pinMode(buzzPin, OUTPUT);
    pinMode(potPin, INPUT);
    Serial.begin(2000000);
    }
    void loop() {
    // put your main code here, to run repeatedly:
    potVal = analogRead(potPin);
    buzzTime = ((rightFreq - leftFreq) / 1023 * potVal + leftFreq);
    Serial.print(potVal);
    Serial.print(" ");
    Serial.println(buzzTime);
    digitalWrite(buzzPin, HIGH);
    delayMicroseconds(buzzTime);
    digitalWrite(buzzPin, LOW);
    delayMicroseconds(buzzTime);
    }

  • @ion4497
    @ion4497 Před 3 měsíci

    great video

  • @alicewang6342
    @alicewang6342 Před 3 lety

    Paul, I love you demonstrate the math for us! I am in my 40’s with very limited math and physics foundation, it is important for me to understand where the numbers come from before I start coding! Btw, can I ask a very stupid question: how do you know 1023 (5V) is equal to 10000hz rather than other numbers?

  • @advancedperformance9721

    great thanks

  • @geralddrake4617
    @geralddrake4617 Před 3 lety

    another great lesson and yes, annoying tones😉😁

  • @michaeljenkins2345
    @michaeljenkins2345 Před 3 lety

    Well it seems I was at least part of the way through this lesson, but Im going to start back from scratch just to be thorough. Ive had 2 (two!) iced coffees today!

  • @user-vn7ce5ig1z
    @user-vn7ce5ig1z Před 5 lety +16

    0:24 - It looks pretty empty to me. Sometimes green-screen glitches are amusing.
    20:00 - The voice-recognition A.I. will demonetize this video for animal-cruelty.

  • @karelenmarritkruyswijk393

    Thank you very much. Reases the question if you can calculate this strait forwards to a tone in kHz.

  • @pierrick1705
    @pierrick1705 Před 3 lety

    i had to go get a refresh on Khan Academy about Algebra, Linear equations & graphs but im right back!

  • @fransvanenschot3286
    @fransvanenschot3286 Před 2 lety

    Hoi Paul,
    i like the way you explain everything from this tutorial step by step, so it is to following for everyone.
    aim already an experienced user, but i still like the way you explaining everything way.
    For a basic course it is the perfect way to learning, but maybe it is also a good idea to make also an tutorial with the arduino together with ethernet and HTML language, and build it up step by step.
    Another good idea is an step by step tutorial Arduino together with a big oled display what can used as HMI .
    I think this are tutorials were advanced users are waiting for, especially when you teach it in the same way as this tutorial, a few lessons for connecting the ethernet board , html for LEDS, html, for sliders, html for displaying, html for graphics, etc.
    thanks in advance, and go further with the good work.