Это видео недоступно.
Сожалеем об этом.

PWM on the Raspberry Pi Pico with MicroPython

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • In this video we will define what a Pulse Width Modulation or PWM signal is, build a circuit that controls the output of an LED via a potentiometer, and we will write the code to produce a varying PWM signal mapped to the ADC’s integer output.
    00:00​ Intro
    00:33 PWM Background Information
    01:52 Pico Hardware Description
    02:32 PWM Groups
    02:40 Circuit Build
    03:19 Programming
    03:44 Choosing 1000 Hz
    04:29 Recap
    The parts you will need to follow along with this video are:
    1x Raspberry Pi Pico
    1x Micro USB Cable
    1x Breadboard
    1x 10k Potentiometer
    6x Jumper Wires
    1x LED
    1x 150 Ohm Resistor
    Hardware Links:
    Elegoo Electronics Kit: amzn.to/3aKWJA7​​
    Breadboard: amzn.to/2Npu9f5​​
    www.adafruit.com
    www.sparkfun.com
    Helpful Links:
    www.raspberryp...
    www.raspberryp...
    micropython.or...
    thonny.org/​​

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

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

    Nicely explained. For people who don’t know what the anode or kathode of a LED is, the kathode is the shortest leg. Also the kathode is the side where the led’s base is straight while the rest is rounds as the LED itself.

  • @sampetri4887
    @sampetri4887 3 года назад +3

    Very clear speaker. Well done. Thank you. You'll have more subscribers soon.

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

      I appreciate that.

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

    Useful information and tutorial. Keep creating such amazing project with Raspberry pi pico in micropython programming. Thanks for sharing 👌👌

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

      Thank you, I will

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

    Nicely done... Thanks.... What is the highest freq Pico can go... ? And how do u provide a delay in bw two PWM signals

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

    Nice job, new subscriber, keep doing videos like that bro

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

      Thanks. I'm on business travel at the moment, so it may be a few weeks before I can get back at it.

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

    Very clear explanation

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

    Great video, very clear, I wanted to know how many PWM you can use at the same time, and question answered. What frequency have you tried it up to? As you need over 20,000hz for pwm to not show on camera, roughly

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

      Thanks. I haven't tried to much with PWM on the Pico. It is still a new board to me.

  • @Helloworld-dq7hi
    @Helloworld-dq7hi 2 года назад

    Hi. Very easy to follow and remember. I wanted to ask how u you used the pico without being connected to a computer. Did you save as boot file?

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

    great job!

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

    One question: How much Frequency should we set in case of robot's motor application? Thank you

  • @user-nn5wf3fk4g
    @user-nn5wf3fk4g 6 месяцев назад

    I have a dso with a frequency of 100 MHz, and I use Thonny IDE and Micro Python with a Rp2040 system clock of 125 MHz. I also know the pwm frequency, which is 62.5 MHz.
    I have to make a pwm in an RP2040 at 50 MHz, thus here's my code:
    from machine import Pin, PWM
    import time
    pwm_pin = 0
    pwm = PWM(pwm_pin)
    pwm.freq(1000000) # Set PWM frequency in Hz
    # Set fixed duty cycle
    pwm.duty_u16(32768) # 50% duty cycle (32768 out of 65535)
    I want a square wave, however the PWM produced noises and ripples with this code.
    Thus, how can I lessen the noise and ripples? help me sir

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

    Hello Brad. I have been hacking at programming the Ardunio Nano into a sine wave inverter using the PWM outputs. Have you had any experience using a 10kHz clock to create the PWM of a 60 Hz sine wave? I have this project in Ardunio IDE and I’d like to convert from Ardunio IDE to Python for the PI Pico but I new to programming Ardunio IDE. Your thoughts are welcome.

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

    one BIG issue with PWM on Raspberry is: when you want to use it as a dimmer for LED, when you are close to OFF (very dimmed), it usually flickers/blinks. Irrespective of the frequency. Any idea how to solve it? Most of the tutorials only show the "school example" of dimming - not the real life applications.

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

      I'll have to look into it more. My first guess would be a limitation of the MicroPython frame work.

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

      @@hensonblSimilar issue with python on Raspberry Pi 4 - only when I moved to pigpio library it started being OK. But the cost is pigpiod running in the background.