Raspberry Pi LESSON 9: Using GPIO Pins for PWM to Simulate Analog Output (Pulse Width Modulation)

Поделиться
HTML-код
  • Опубликовано: 19 авг 2024

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

  • @Bob-tu9jq
    @Bob-tu9jq 2 года назад +1

    The way you explained the PWM concept is probably the BEST. Nobody else explained it that way.

  • @timothydemyers7520
    @timothydemyers7520 11 месяцев назад +1

    thanks to Jesus Christ for allowing this learning platform through paul.
    man your videos had helped me out of, a lot of holes

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

    Love watching this series
    Even tho I'm not doing it
    One day I shall learn from this and will be glad to achive such
    Anyway. I followed all you arduino and have learnt so much
    And will try this next step of tuts. As such good details as always
    You do an amazing tutorials

  • @qzorn4440
    @qzorn4440 18 дней назад

    The old days 60 hertz was great information. 😎 Thank you Paul.

    • @palokubik5374
      @palokubik5374 3 дня назад

      60 Hz has lower loses then 50 Hz in grid. In euroe there is 50 Hz because when is start design network in europe german engineers make decesion 50 Hz for better calculatio transformers.

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

    I AM LEGEND! It is great to have near-analog output from the Pi. Lookout nuclear reactors, we McWhorter aficionados are coming for you! Thanks for more of your most excellent lessons Paul.

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

    I am legend. I did include 0% and 100% in the code. I don't have an oscilloscope, but I checked it with a multimeter and the voltages were as expected. I'm not set up to make a video, but I can add the code as a comment if you wish.

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

    Hey Paul, great lesson! The oscilloscope was a great visual aid to actually see what the pin was outputting. I was thinking about getting one but I’m saving my coin for a 3d printer. Can’t wait for those lessons to start.

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

      If I had to choose between oscilliscope and 3D printer, I would choose 3D printer.

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

    I really like these leasons. One thing I would love knowing by the end of this is how to send data over network. I want to monitor my vacation homes basement via the raspberry pi and it would be really handy to see the numbers at home.
    Another this I think you should mension is how to do VNC. Sometimes ssh isnt the best option. I am currently using VNC and it is great.

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

    Let's build a Function Generator.OK, OK it would take a bit more but I can dream can't I. I always love the PWM lessons. Thanks, Paul.

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

    I got 30 seconds in and I just knew I'm in the right place haha

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

    Another fun project. as I was listening to your video here. I created a simple program that blinks with a longer delay between each blink. I as well, added PWM to count from 0 to 50 and back down again in a loop. fun and games. :)

  • @AO-ek9qw
    @AO-ek9qw 2 года назад +2

    highly suggest you follow along and apply the homeworks! they do help you understand the content of these tutorials better, watching only is forgettable ;)
    get your hands dirty!

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

    Tip:Python RPi.GPIO use only soft PWM.
    So your testing codes are all soft PWM, not H/W PWM.
    So you can use any GPIO pins for soft PWM.

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

      i dont get it. what does soft and H/W mean? And in what engineering major and the course name do you learn this??

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

    Thank you so much Paul Happy New YEAR! my best wished to you and your family!

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

    i done set around and watch cat videos. i watch your videos

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

    Here's my video (and code in description) for the original version - ruclips.net/video/Kp66aTLpJNU/видео.html
    Here's my video (and code in description) for the Pico version - ruclips.net/video/z3aFYkSY75g/видео.html

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

    Great stuff, always useful and very well explained! as usual thank you for your time and effort in sharing your knowledge! looking forward to more!

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

    Good lecture also you showed how to use Oscilloscope in the circuit. Also I have ordered the Oscilloscope.

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

    Thank you for the video,
    I am testing this on my side and I notice something unexpected, when I set the frequency to 100hz I only get 98.Hz, however this difference increase with higher frequencies like 1KHz I get only 860Hz, do you know what is the reason for this ?

  • @doccinator
    @doccinator 8 месяцев назад

    This is a very nice tutorial about the difference in Frequency and Duty Cycle so thank you.
    If the LED is a Motor, it is hard to start or stop a motor at 100Hz and 50% duty cycle, is there a way to ramp up the duty cycle from 0 to 100? I have been struggling to find how to do it.
    Thank you again.

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

    How we can control the current in multimeter means increasing the current in multimeter through PWM

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

    The comment that setting 0 or 100% duty cycle MAY not be conclusive -- there would not be a trigger point with DC3.3 or DC0 volts. It would be interesting to check that out further!

  • @PrabudhGoel-x6i
    @PrabudhGoel-x6i Месяц назад

    Hi Paul, thanks for the lesson. The LED in my circuit does not dim when I reduce duty cycle, and it does not blink when I reduce frequency. There is absolutely no change from the state of 'ON',or 'OFF' based on the gpio output code. I don't have an oscilloscope so can't test what's going on. Any suggestions on what may be happening here, other than getting an oscilloscope :) ?. The code and circuit are the same as your video, triple checked. Thanks again!

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

    Your camera was perceiving the blink at 100Hz for a little while. @29:35. The frame rate and frequency were in sync or something.

  • @md.monirmostafiz
    @md.monirmostafiz 4 месяца назад

    sir what is the difference between pwm.start and pwm.ChangeDutyCycle? Both are used to change the duty cycle right?

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

    excellent as usual.

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

    hello i have jetson jetson xavier nx 2 with camarray has (uc-512). and camarray has is included at i2c 0. how can i show the both camera that are included at camarray has in parallel in separate window. without switching between the both camera. in python whne i type sensor id= 0 he show poth cammera in one window. i want to show both camera in seperat windos

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

    I am on the 64-bit edition of Raspbian, and I am noticing that the Python command opens up Python 3.9.2 and the same goes for the python3 command. I am thinking that this version does not come with the older version, but I am unsure of the command that shows all of the versions of Python I have installed.

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

    Thanks!

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

    Hint: Could use a more available PI 400 kit which is available for $99 . sunfounder kit has the t adapter.

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

      Yes, just not sure about connecting the camera.

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

      I replied to your comment and it disappeared😿Someone told me that the CSI camera connector might be hidden inside the Pi 400. I just had a look. They were lying!!
      So you have to use a USB camera. I am pretty sure that my Logitech one will work. I'm going on holiday tomorrow morning for 10 days but I can try it out when I get back if you want. $99 is a lot of money and I find that it is actually easier to use SSH or VNC from a PC rather than using the Pi 400 directly when doing Paul's tutorials. I don't know whether you may have noticed my comments about using a Pico. I have managed to do all the homework so far on my Pico and I've put videos (with the code in the description) using my Pi 4 and the Pico on my RUclips channel in case you're interested.
      A Pico costs under $4 (or $6 for pre-soldered headers) and you can get a camera that will work with a Pico, an Arduino and also a 'real' Pi - thepihut.com/products/5mp-ov5642-mini-spi-camera-module-for-arduino

  • @keneflucas937
    @keneflucas937 4 месяца назад

    I need help. When I lower my Hz the LED does not blink it remains solid. I decreased the Hz all the way down to 1 and it is still solid. I even tried .01....no blinking, remains solid.....

    • @keneflucas937
      @keneflucas937 4 месяца назад

      I had to change my duty cycle to anything less 100 and more than 0.

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

    I am legend. Thank you.

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

    Frequency is the number of cycles per second and duty cycle is the ratio of the ON and OFF time within that cycle. As long as the frequency is below 60 cycles per second, human eye can perceive the blinking of the LED. How about we have a duty cycle of 10% and comparing with a duty cycle of 90%? Will it be easier for the human eye to detect the stronger light (90%) against a weaker light (10%)?

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

      I did an experiment on that, with a frequency of 50, compared to a duty cycle of 10% and a duty cycle of 90%. The higher the duty cycle, the brighter is the LED, it diminishes the blinking effect of the LED. In order to see the blinking effect, it requires a lower frequency and a smaller duty cycle.

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

    Hey Paul, will you be teaching us to run the Mediapipe model on the RPi, towards the end of this series?

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

    What is the name of the microphone that you have in your videos?
    It sounds really nice and I would like to know the name of the model.
    Thank you!

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

    can show how to condrol wipermotor

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

    I have a (wierd) habit of sweeping my eyes across a light source to see if it is flickering.

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

      I do too, lol. With Christmas lights especially

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

      I do it with automobile tail lights.

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

    Trying to "up my game" on my video making skills ... still have a ways to go 🙂! Here are my two solutions for the homework. I did one program to change the brightness level in distinct steps (one step for each button press) : ruclips.net/video/skY2OpUWd3Q/видео.html Here is the other program that allows "Press and Hold" functionality: ruclips.net/video/41phDuLxVg0/видео.html

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

    I am legend!

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

    Takk!

  • @Bob-tu9jq
    @Bob-tu9jq 2 года назад

    I have a question about using your microphone. Usually, people need to speak By the microphone, in order to have a great audio result. However, I have noticed that you are quite far away from your microphone, yet your audio quality is pretty good and loud. Why? Would you please explain? Did you configure your microphone in such a way that it can work for a longer distance?

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

      I am not an audiofile, so really dont know. I just set it up, and shoot for 'good enough'. A kind viewer did write me that for these microphones you talk into the side, not the end of the microphone, and that improved things greatly. Things could be improved if I put the microphone on a boom, as with the present setup, the microphone picks up any bumps on the desk, like my I put my hand on the desk and the microphone hears it.

    • @Bob-tu9jq
      @Bob-tu9jq 2 года назад

      @@paulmcwhorter I just tried and talked to the side of my microphone and the result seems slightly better and loudt. Never knew that. Thanks.

    • @Bob-tu9jq
      @Bob-tu9jq 2 года назад

      louder, I meant.

  • @nikitapolyakov2259
    @nikitapolyakov2259 8 дней назад

    I am legend

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

    Here's some move on my homework results. Obtained O-scope output and a video at ruclips.net/video/qQWaTiLg4yA/видео.html

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

    This is my (I think) 3rd go at this. But it works - YaY!
    I am LEGEND (well somewhat)
    I just know there is a better way using logarithms but it is more than 50 years since I opened a log book or lifted a slide rule ruclips.net/video/DxM1U9VlrMU/видео.html
    Next - have a peek at Lesson 10 - Bet Paul knows about logs

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

    I am legend. I thought I had posted this comment, but it didn't show up. I have completed the homework and posted the code in a google doc at: docs.google.com/document/d/1W6oB29olqEOuFMsTqxSrknRwvVUPQGjTbrsxR5Gublw/edit?usp=sharing
    The video showing the working circuit running the code in Thonny can be seen at: ruclips.net/video/lvXMMjkT21c/видео.html The circuit is easy to see in the video and the pins used are 12, 16, 22 as well as +3v and gnd from the board at whichever pins you find convenient.

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

    My solution.
    Would make a bunch of changes if I did it again, or at least actually fix my hold-dimmer bug, but here it is anyway.
    ruclips.net/video/cXjuEXepyF8/видео.html

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

    Thank you Paul ! I recorded the same manipulations with my own scope, as a note for later (ruclips.net/video/L06OYfdH7GE/видео.html). Homework is coming soon !

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

    Extraordinary less.

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

    Homework ruclips.net/user/shortsMj2sC7xcfng?feature=share
    ruclips.net/video/yJdN6LmGqvc/видео.html

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

    my homework: ruclips.net/video/ha7oXv4sI8E/видео.html

  • @Bob-tu9jq
    @Bob-tu9jq 2 года назад

    ah, I always wanted to ask a question, but always forgot to do so. Do you regret not doing a PhD degree in the past? I guess it would be super easy for you to achieve it. But I was wondering if you ever wanted it or not. I respect PhD's.

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

    hello i have jetson jetson xavier nx 2 with camarray has (uc-512). and camarray has is included at i2c 0. how can i show the both camera that are included at camarray has in parallel in separate window. without switching between the both camera. in python whne i type sensor id= 0 he show poth cammera in one window. i want to show both camera in seperat windos

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

    Thanks!