37. Arduino for Production! How to Use or Create a PWM (Pulse Width Modulation) Signal

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 2024

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

  • @Maddhung1
    @Maddhung1 10 ปีที่แล้ว +13

    Thank you very much Patrick!! I am just getting started with the Arduino, and I have to say a lot of other tutorial's on PWM had me stupified and frustrated to where I had to just turn the video off and walk away pissed....but your way of explaining it really hit home and I look forward to watching more of your classes. Thanks again...

  • @WeTravel2023
    @WeTravel2023 4 ปีที่แล้ว +1

    I don't normally comment ...but today I have to ...." Ur every single video is awesome "

  • @simond5484
    @simond5484 9 ปีที่แล้ว +3

    Im a German student, and my english is well not the best, but it is easy to understand for me with your methode. Well its one of the best learn Video which i saw on youtube.
    well thx
    Vielen Dank, u are a REAL teacher=)
    regrads from a German student

  • @andrewphillips8198
    @andrewphillips8198 9 ปีที่แล้ว

    WOW! Seeing this makes so much sense. I'm a newbie and going through a online Arduino course and this helps me understand PWM. I'm one of those folks who doesn't move forward until I understand each new thing and this really helps.
    Thanks Patrick!!!! Keep up the good work

  • @aj.k.j
    @aj.k.j 11 ปีที่แล้ว

    Sick man sick!! Took me 5 months and £500 to know about PWM and interrputs and pre scaler ... etc etc. But now I have learnt more than what I spent hours on in under quarter of one lessons' time at university. lol

  • @jarelimpadul2989
    @jarelimpadul2989 12 ปีที่แล้ว

    Sir, I really appreciate your tutorials very much. I migrated from using PIC to Atmel. I was really confused on how PWM works, not until i watched this video. We are currently making our thesis, which is on Industrial Automation (Just a Prototype) Automated Coconut Processing Machine . From cutting, grating to extraction. I am a Computer Engineering student from the Philippines (Systems Technology Institute). More Power to You!

  • @muppelmuh1445
    @muppelmuh1445 5 ปีที่แล้ว

    Thank you very much for this video. I am a total newbie to programming and microcontrollers. Your video happened to be one of the very first I stumbled upon trying to make an LED dim. It matters so much how information is passed to me, teaching really is an art. Especially as a newbie, the way information is presented is crucial. I love your tutorials: Structured, logical, precise and putting it into context. I spent 28 minutes and understood not only PWM but in between the lines also loads more about what actually is a microcontroller. I had huge fun because you make learning fun. Thank you.

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

    Best PWM explanation I have ever seen. Many Thanks Patrick!!!!

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    You are welcome. Enjoy the sounds.

  • @cetincat1642
    @cetincat1642 9 ปีที่แล้ว +20

    Thank you Sir! Your explanation of pwm and timers was way better than that from my prof!

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  9 ปีที่แล้ว

      Cetin Cat Thanks!

    • @marcellustone
      @marcellustone 7 ปีที่แล้ว +1

      Cetin Cat How dare you disrespecting me!! I will report you to the board. You really think, that u can hide behind your nick name? You are kevin. I will see you tomorrow in class, and you better come in time. And by the way, if you wouldnt been constantly chatin with Jasmin, the girl behind you, then you shure would have picked up more of my lesson.

  • @SJFrzrbrn
    @SJFrzrbrn 12 ปีที่แล้ว

    I really enjoy watching videos like yours while working on my projects. I am sometimes not actively watching but I'm always listening and soaking up information. Thanks for making the videos.

  • @1973jdmc
    @1973jdmc 5 ปีที่แล้ว +3

    Stumbling across your video is like being stuck in a desert and finding an oasis- YOU ARE OFFICIALLY A SUPERHERO -

  • @seal3081
    @seal3081 10 ปีที่แล้ว +1

    reading a book about arduino. It game me 2-3 sentences on it for now in the project. This really helped thx

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

    What a brilliant video! I found your introduction to OCR/IVR for faster PWM very insightful - thank you very much.
    Just wanted to pick you up on something you said @7:59 were you say 'This would be a 50% duty cycle because it is happening right in the middle of the period'. I found this slightly confusing and ambiguous since you had just previously showed us a 50% 'phase corrected' cycle wave starting at a 1/4 way through your period.
    Of course, this all became clear in your subsequent examples, that the duty cycle refers to the percentage of the period where the pulse is high and not where the pulse starts.

  • @fatmachinistfataman5360
    @fatmachinistfataman5360 9 ปีที่แล้ว

    im gonna show this video to my professor and tell him, why don't you lecture just like this Mr Pro. and thanks for knowledge sharing.

  • @sufiansiddiquee
    @sufiansiddiquee 11 ปีที่แล้ว

    Thank you so much sir. That was an awsome explanation. I was stucked on my project for 5-6 months, i watched so many vedios about pwm, but now i am clearly undetstand that after watching yours. Your vedio was full of information, nice and clear. Keep helping us please.

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    This depends on how you are doing the PWM. The period is determined by the ICR value. It's like a prescaler.

  • @sirfinthetube
    @sirfinthetube 11 ปีที่แล้ว

    Thank you for producing this video. Benjamin Franklin would applaud you.

  • @p.z.8355
    @p.z.8355 6 ปีที่แล้ว

    How do you end up with the staircase form in 14:20, when pwm is just individual pulses firing at a certain time in the period ?

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    Right. When you see me actually connect a motor directly to the uC, I will use a diode across the coil. If there is something else needed, let me know.

  • @traplover7341
    @traplover7341 8 ปีที่แล้ว

    Pure quality. Thank you for being alive and sharing your knowledge.

  • @erickim3710
    @erickim3710 11 ปีที่แล้ว

    His explanation is just fantastic.

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  13 ปีที่แล้ว

    @TheDemaggi Thanks. These are the features of most microcontrollers and why I love using them.

  • @enredao_electronico2737
    @enredao_electronico2737 11 ปีที่แล้ว +5

    Absolutely brilliant explanation of PWM

  • @kapilagunawardena356
    @kapilagunawardena356 8 ปีที่แล้ว +6

    Very well explained. One of the best tutorials evrer.

  • @wanher33
    @wanher33 11 ปีที่แล้ว

    Who in the world would dislike these tutorials . . . Smh

  • @pcontreras521
    @pcontreras521 9 ปีที่แล้ว

    Excellent video! I agree this video explained it better than any professor I ever had. Great job and keep up the excellent work.

  • @behailut9933
    @behailut9933 11 ปีที่แล้ว

    You are really a professor, I have never understood it for long time, but now. Thank you very much!!!

  • @bikersoncall
    @bikersoncall 10 ปีที่แล้ว

    How does this improve tork of a motor or does it, what are the advantages of
    pwm over pots if you are not needing to use digital signals as control ?

  • @SamDru
    @SamDru 6 ปีที่แล้ว

    This explains a lot than our professor and my project group show this to him and he approved this

  • @hassanomer7777
    @hassanomer7777 11 ปีที่แล้ว

    that was really very useful .
    Can I use amplifier with PWM because I have a motor with 12V so can I amplifiy the signal that come from the microcontroller

  • @jasonsweet228
    @jasonsweet228 12 ปีที่แล้ว

    do we hand it a delay before turning on the pin? Having trouble with the mathematics here. CPU clock speed / samples per second = the period, but how do we balance out the integer value + the delay needed per interval?

  • @sm1thy94
    @sm1thy94 9 ปีที่แล้ว

    Much better than my lecture material, thanks very much!

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    Great. I can't wait to see the progress.

  • @jasonsweet228
    @jasonsweet228 12 ปีที่แล้ว

    Thanks. I finally got mine to work but I'm not sure what the method is called by setting 0-8 pins high depending on what the byte number is from 0-255.

  • @Me-tuber
    @Me-tuber 10 ปีที่แล้ว +2

    If you already know how PWM works, just jump to "...with servos..." 14:33

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    You might wat to check out my earlier videos where I explain bit conversions to decimal and vice versa.

  • @imranaalam
    @imranaalam 5 ปีที่แล้ว

    explained like a guru

  • @agumonkey
    @agumonkey 11 ปีที่แล้ว

    I'm curious about your Cam/Mic setup. Do you talk about it in a previous video ?

  • @BartCee
    @BartCee 11 ปีที่แล้ว

    I hope you're a teacher, if not, you should be one. Now I'm getting somewhere with this. Thank you so much.

  • @jasonsweet228
    @jasonsweet228 12 ปีที่แล้ว

    You have a great tutorial. More information than others can explain, but its a complicated subject for sure.

  • @thegoodhen
    @thegoodhen 12 ปีที่แล้ว

    I love those series very much! I just wanted to state that it is not a good idea to connect an inductive load such as motor directly to a microcontroller. Just nitpicking, I know, but I kinda thought it might be good to mention when talking about motors and pwm.

  • @drezabek94
    @drezabek94 11 ปีที่แล้ว

    This video was very informative and easy to understand! Thank you for putting it up! Your other videos on microcontrollers are good too, keep up the great work!

  • @lukelucky7681
    @lukelucky7681 9 ปีที่แล้ว

    Hey, I'm from Germany and my english is not the best ;)
    But you have a very nice dialect, so I understood everything!
    Thank you very much.

  • @music4life402
    @music4life402 10 ปีที่แล้ว

    Man you saved my life ...You are brilliant

    • @NewbiehackNew
      @NewbiehackNew 10 ปีที่แล้ว

      Thanks.

    • @music4life402
      @music4life402 10 ปีที่แล้ว

      Welcome. Is there a way to contact you.. I am building a program but I need someone to help ...I have no exp... When you free can you contact me . Thanks

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว +1

    Thanks. I would love to see your project when completed.

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

    Thank you very much for sharing your valuable time to explain PWM in detail.

  • @ilhamsaidjafar3607
    @ilhamsaidjafar3607 11 ปีที่แล้ว

    brilliant explanation of PWM

  • @haithamhashim8966
    @haithamhashim8966 10 ปีที่แล้ว +1

    Mr Patrick Hood,Thanks for the explanation for Pwm,how can i follow up with you

  • @Rodfraeser
    @Rodfraeser 10 ปีที่แล้ว

    Nice vid.
    I wonder if the moter gets more amp´s with PWM than with the potentiometer.

  • @aliceiceberg581
    @aliceiceberg581 6 ปีที่แล้ว +4

    Your videos are really worth watching. Thank you. But background noise and voices disturbed me.

  • @moonbug71
    @moonbug71 10 ปีที่แล้ว

    I'm revising all my basics to prepare me for interviews, this was really easy to follow, thanks, looking for more by you now :-)

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  13 ปีที่แล้ว

    @anajonesr I may address PPM when I do tutorials on wireless remote control.

  • @tam1381
    @tam1381 9 ปีที่แล้ว

    Hi Patrick well explained best tutorial I have seen on this.Thanks Tam.

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    @YoureGuilty You are so welcome!!

  • @sidibaliout5991
    @sidibaliout5991 8 ปีที่แล้ว +1

    So AMAZING!!!! You made this topic look easy. Wow

  • @footballh3
    @footballh3 8 ปีที่แล้ว

    Brilliant description!

  • @thedevo01
    @thedevo01 11 ปีที่แล้ว

    Great explanation! I really like it how to-the-point it is.
    Would this mean that a monitor with PWM doesn't actually dim the backlight as you take it down, it just flickers less or more? That sounds terrible.

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    You are welcome.

  • @dextersese5095
    @dextersese5095 12 ปีที่แล้ว

    Hi Anajonesr, this is a awesome video, i like it very much. is there a video of you that explain sinewave generator in pwm out? i am so confuse how to make it.

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

    Your explanation was beautiful.

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

    You can make a DC motor go in reverse with PWM? How would you go about doing that?

    • @MrTHEORIGINALICEMAN
      @MrTHEORIGINALICEMAN 11 ปีที่แล้ว

      You would use 2 PWMs from one microcontroller driving an H-Bridge. Just Google it, it is not rocket science.

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

    That was incredibly great

  • @anthonyvolkman2338
    @anthonyvolkman2338 10 ปีที่แล้ว

    Really helpful for my pwm that I'm using for my Tesla coils, thanks man

  • @HonorableMolins
    @HonorableMolins 10 ปีที่แล้ว

    Now I understand PWM!
    Thanks

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  13 ปีที่แล้ว

    @marieomagpie I can do a tutorial on PPM, but I first need to determine a good application for it.

  • @TheDemaggi
    @TheDemaggi 13 ปีที่แล้ว

    Great videos. Is there anything that chip cant do?

  • @ashkrish7537
    @ashkrish7537 11 ปีที่แล้ว

    adjusting ICR according to your wish is modulation, right ???

  • @mathurash2013
    @mathurash2013 8 ปีที่แล้ว

    You get motor controllers in the market like (Talon, jaguars etc) which take one signal and based on that you can control the direction and speed of a motor. The direction is dependent on the pulse width of the signal, so each motor controller has min, neutral and max width and if you send a signal between the min - neutral ( usually 1.5 ms) the motor turns CCW and CW if between 1.5 ms - max width. This doesn't make sense to me. Does the motor controller have a separate circuitery to determine the pulse width and based on that it actuates certain switches?

  • @monamohan5334
    @monamohan5334 11 ปีที่แล้ว

    Excellen tutorial patrick on PWM. its an eyeopener !

  • @hrysp
    @hrysp 13 ปีที่แล้ว

    Thank you so much! Will this be posted on newbiehack as well?

  • @kannagadu420
    @kannagadu420 11 ปีที่แล้ว

    do you have any video to connect bluetoorh with microcontroller

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว

    My pleasure

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

    i forgot to mention that i also liked your pen,with appreciation

  • @jasonsweet228
    @jasonsweet228 12 ปีที่แล้ว

    I'm going to try something on an Atmel UC3 32 bit, but take it 8 bit at first to see what I can come up with. I might have to think on it about a day as usual to plan out the approach. I'm going to try pcm wave mono audio at first to get the hang of it. Might even be able to find a way for volume control by subtracting from the data. The frequency would be samples per second. My Atmel goes up to 66MHz so should have no trouble playing 441khz if I can get it working all the way. PWM video next

  • @Cambria399
    @Cambria399 11 ปีที่แล้ว

    Good clear instruction. I have wanted to understand this for a long time and because of your disciplined use of units and good penmanship the whole lesson is understandable. thanks very much. On my way to check newbiehack now

  • @vaibhavsingh228
    @vaibhavsingh228 12 ปีที่แล้ว

    Excellent video Patrick!! Keep sharing the knowledge like this.. Cheers!!!

  • @jamest.5001
    @jamest.5001 8 ปีที่แล้ว

    I have been trying to get the parts together to build a DC to AC pure sine wave inverter. I haven't got any electronics yet. I have some very large heat sinks. and 8x 22000uF 75 volt caps. I would like to build the largest inverter I can. well in the kW range. like at least 4,000 to 6,000 watts. from 24-48v. I need it to power my home. and been thinking I may as well make it a split phase. for 110/220v 60Hz. I can use all the help I can get. I am self taught. I learned what I know about the electronics. from reading and videos like yours. and thanks for the effort you put in these great videos. if you can help with my project. I can use some schematics. most of the ones on TH-cam are in a foreign language or have a heavy accent that is hard to understand. and its hard to read the circuits they have drawn out. I thought about getting a sine wave driver board that is for a inverter from eBay. and try to use it to drive some FETs and a boost circuit. and what ever. but like I said I need help! thanks either way.

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

    Hell of a breakdown.

  • @bikefarmtaiwan1800
    @bikefarmtaiwan1800 8 ปีที่แล้ว

    Super clear and interesting! Thnaks for sharing your knowledge.

  • @Flankymanga
    @Flankymanga 13 ปีที่แล้ว

    Man i love your videos about microcontrollers!!!! Keep up the good work!!!!

  • @jeysonsantosrocha
    @jeysonsantosrocha 11 ปีที่แล้ว

    Patrick, thanks for your great explanation. You are the master!

  • @Scholarship_Bridge
    @Scholarship_Bridge 11 ปีที่แล้ว

    This is a well explanatory presentation.

  • @andrewphillips8198
    @andrewphillips8198 9 ปีที่แล้ว

    One question: Why would the battery short if you touched the two leads together?

    • @AbrarShaikh2741
      @AbrarShaikh2741 9 ปีที่แล้ว +1

      When you connect to leads directly without any passive element in between then there is little to no resistance for the current flow. Current = Voltage ÷ Resistance (Here R is very very small since lead wires of battery have resistance in milli Ohms or less). Therefore, battery current will follow this very very less resistance (almost = 0) path also known as Short path because whenever you connect any element in parallel to the short path no matter what... current will take this short path and drain out the battery in few seconds. You can try it out with 1.5 V battery. Just connect a single wire joining both terminals and after some time the battery will stop working.

  • @Alimaxim1
    @Alimaxim1 12 ปีที่แล้ว

    really nice explaination hopefully now i can do well in exams

  • @walterhynson2898
    @walterhynson2898 9 ปีที่แล้ว

    Sir ,also please explain ohms law with regard to the motor example because you put a voltage across a resistor(the pot)and you get a current through the motor which makes the motor spin,you get more or less CURRENT depending on the rotor position of the pot.I=E/R (OHMS LAW)

  • @abmecha
    @abmecha 12 ปีที่แล้ว

    Great job, and many examples!

  • @marieomagpie
    @marieomagpie 13 ปีที่แล้ว

    What about the difference between pulse position mod and pulse width mod.

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

    You putting stuff like this on YT, I don't see my grand children taking the so called formal education at all. You and other serious contributors are making YT a VIRTUAL UNIVERSITY.
    Philanthropist should take a note of this and help create a seamless system of the world class knowledge, for free, for the needy. Tons of thanks!

  • @allthatremains1609
    @allthatremains1609 11 ปีที่แล้ว

    Hi Patrick this is Victor!!! i´ve seen some of your tutorial and i had some troubles with the PWM i tested your code with a POT and an osciloscope to see if i was getting the right, but i got nothing i´m using an ATmega 328P is any different configuration to do with this Chip? Thanks i´ve already understand almost all the instructions! but it´s only one left. OCR1A??? i think it´s associated with the output but i can´t find tyhe description for that register
    Thanks again
    Regards

  • @kunalsonone4523
    @kunalsonone4523 4 ปีที่แล้ว +1

    Great explanation, Thank you.

  • @matheoml
    @matheoml 8 ปีที่แล้ว

    Thanks a lot for all these video. They are really well done and very helpful.

  • @digitalrew
    @digitalrew 11 ปีที่แล้ว

    Great explanation, I really need it. You should do more of these. Thanks a lot. Great job you did.

  • @rajudasar6268
    @rajudasar6268 8 ปีที่แล้ว +7

    Awesome explaination

  • @riteshmalpani9945
    @riteshmalpani9945 8 ปีที่แล้ว

    This was quite helpful, I was wondering if u knew how to control the speed of a vibration motor but rather than physically having to turn the dial, the motor connects to the computer and u can adjust the speed using the computer

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  12 ปีที่แล้ว +1

    These videos will not help you with Arduino. These videos will teach you how to program the microcontroller and get ready for developing at the PCB and circuit design level. Arduino is best for one-off projects rather than product development for manufacturing.

  • @Serdar.hajali
    @Serdar.hajali 12 ปีที่แล้ว

    Thank you so much for making this so easy for me to understand...ooh I feel like a wanna to cry...you are the best

  • @Kratasish
    @Kratasish 9 ปีที่แล้ว

    I love the sounds in the background when you speed up your video :-D

  • @shezijalal1774
    @shezijalal1774 8 ปีที่แล้ว

    Hi Sir, I have a question about PWM. In a very simple understanding the duty cycle is basically to cut down the voltage with respect to the reference voltage and to maintain it with using a capacitor. So like refVoltage = 5 and dutyCycle = 50% we will be having a 2.5V DC. But as in this tutorial the motor dataSheet says that we should have a frequency of 50KHz, what is the advantage or usage of the pulse resolution i.e. 50 cycles/sec. Meaning if we vary the pulse resolutions what will happened ? I am confused...
    And once again many many thanks for sharing these all videos :-)

  • @baturmankarakoc1614
    @baturmankarakoc1614 8 ปีที่แล้ว +3

    ı am gonna watch all of your vıdeos .Awesome tutorial.Thank you a thousand times.