Тёмный
No video :(

PWM in Arduino-Pulse Width Modulation 

BINARYUPDATES
Подписаться 39 тыс.
Просмотров 205 тыс.
50% 1

PWM in Arduino is a cool technique in which we can Generate Analog Result means Analog Voltage by Digital Input. We can use PWM in several projects say for example dimming of an LED, speed control and power regulator. The Arduino's programming language makes PWM easy to use. Arduino supports function called analogWrite(pin, dutyCycle). Where Duty Cycles value will be between 0 to 255 and Pin will be one of the PWM pins (3, 5, 6, 9, 10, or 11)on Arduino Uno board.

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 81   
@kameleonvkci
@kameleonvkci 5 лет назад
Short video and straight to the point. No necessary intros explaining history of PWM. Thank you for great explanation.
@johnm8342
@johnm8342 Год назад
Sure, there are many ways to code this, but your video is short and to the point. Excellent presentation and kudos for including multiple screens.
@BINARYUPDATES
@BINARYUPDATES Год назад
Hi John, thank you for such a wonderful words!
@qiangli1578
@qiangli1578 Год назад
The arduino is really easy to use with your clear explanation and software.
@BINARYUPDATES
@BINARYUPDATES Год назад
Glad it was helpful!
@matyasfiedor1802
@matyasfiedor1802 4 года назад
FINALLY! A video that is worth wathcing !!
@wikoamilah5740
@wikoamilah5740 3 года назад
i am learning arduino yesterday from youtube.. and got 1 good lesson from u
@BINARYUPDATES
@BINARYUPDATES 3 года назад
Hi Wiko, Glad to hear that you started your Arduino Learning Journey to become one of future Embedded Engineer. Good luck and best wishes Umesh Lokhande
@yaaro713
@yaaro713 9 месяцев назад
This was one of the best explanation!!!😊
@BINARYUPDATES
@BINARYUPDATES 8 месяцев назад
Thank you so much for your kind words. Best wishes!
@christophdittmer5331
@christophdittmer5331 Год назад
Great Video. Short and straight to the point!
@BINARYUPDATES
@BINARYUPDATES Год назад
Hi Christoph, Glad you liked this PWM with Arduino tutorial. Have a good day Best wishes!
@muhammadhuzaifa6627
@muhammadhuzaifa6627 4 года назад
my heart pray for you you clear all my confusion within the flash of time thank you Allah bless you thanks alot sir
@chrisa.9864
@chrisa.9864 3 года назад
thats wholesome :) god bless you too, my man
@SchwanaCARDHUT
@SchwanaCARDHUT 3 года назад
thank U very much . from France
@BINARYUPDATES
@BINARYUPDATES 3 года назад
Schwana, You are welcome!
@paknbagn9917
@paknbagn9917 2 года назад
so easy explained , excellent ya habibi , booos
@jebalimazen1809
@jebalimazen1809 2 года назад
that was quite simple & useful, thx for the video
@shsftech3792
@shsftech3792 4 года назад
Very straight to the point explanation thank you!
@DawidSwakowski
@DawidSwakowski 7 месяцев назад
Great video. Btw I made much smoother solution: #define LED_A 9 //LED_A is a LED name and 9 is number of used pin void smoothlight(int value) { analogWrite(LED_A, value); delay(2); //number 2 is time between smooth steps (in ms)- 2 is ok } //then your setup void setup() { pinMode(LED_A, OUTPUT); } //then loop void loop() { for (int i = 0; i = 0; i -= 1) { smoothlight(i); //number 1 is number of brightness steps. 255 is brightness range } }
@BINARYUPDATES
@BINARYUPDATES 7 месяцев назад
Great, thank you! I appreciate your share to make PWM program more robust. Have a beautiful day!
@serkanozkan8793
@serkanozkan8793 5 лет назад
Thank you very much. very useful contents.
@JakeRobb
@JakeRobb 8 месяцев назад
This is an interesting, if accidental, demonstration that 50% duty cycle does not equal 50% perceived brightness. :)
@roshnivaldar2746
@roshnivaldar2746 3 года назад
u Great Video, Well done & thank you
@BINARYUPDATES
@BINARYUPDATES 3 года назад
Thanks Roshni
@disassooriyarachchi9655
@disassooriyarachchi9655 3 года назад
Made my life easy. Thank you 🙏
@BINARYUPDATES
@BINARYUPDATES 3 года назад
Glad to hear that! Thanks
@alyaaahmed4462
@alyaaahmed4462 2 года назад
great short explaination , thanks
@ArifKhan-ux2yj
@ArifKhan-ux2yj 4 года назад
thanks alot sir for this video keep makig these videos
@BINARYUPDATES
@BINARYUPDATES 4 года назад
Keep watching Arif, Thanks for comment
@2023noone
@2023noone 10 месяцев назад
when you say duty cycle is 255, is that right way to say it? should it not be 100%, 50% or any other percentage. The value between 0-255 is the byte value, not the duty cycle. Please correct me if I am wrong.
@BINARYUPDATES
@BINARYUPDATES 10 месяцев назад
Hi, you're right the value 255 corresponds to 100% duty cycle and 128 will be 50% duty cycle and so on. You got it right this concept of Pulse width modulation my friend. Good luck and best wishes to all your upcoming events.
@joseantonioschannel
@joseantonioschannel 3 года назад
Thank you for the video, very helpful. How would I control this led using an RC remote controller? what would the connections look like between the receiver and the Arduino UNO r3
@ThisHandIelsTaken
@ThisHandIelsTaken 3 года назад
thumbs up...thank you sir
@BINARYUPDATES
@BINARYUPDATES 3 года назад
You are welcome Mr J Y
@sugreevukartheek9826
@sugreevukartheek9826 3 года назад
Will write code for following requirement? Build the following circuit with an Arduino, a potentiometer, an LED, a resistor, a voltmeter and an oscilloscope in Tinkercad:  Write a Program that lets the LED blink with a frequency between 1 Hz and 10 Hz adjustable by the potentiometer (if turned fully left 1Hz, if turned fully right 10 Hz). Check the frequency with the oscilloscope.
@osamaabraheem2797
@osamaabraheem2797 3 года назад
Hello Thank you for the great information you provide I wish you to live with pleasure can I ask a question the question is Can I get the 15 Hz frequency directly from the Arduino?
@BINARYUPDATES
@BINARYUPDATES 3 года назад
Yes you can
@osamaabraheem2797
@osamaabraheem2797 3 года назад
@@BINARYUPDATES how i can
@p.b.7861
@p.b.7861 Год назад
I am interested in changing of a different frequency over time. Do you know each PWM output Pin has a different Frequency, if yes What and which are they. I plan to use in Desulfator an old lead acid 12 volts battery
@BINARYUPDATES
@BINARYUPDATES Год назад
Hi P.B, you need oscilloscope to measure PWM Frequency. in Arduino Uno, pins 5 and 6 have a frequency of approximately 980 Hz. But its always advisable to measure through equipment while generating varying frequency over time as per your requirement of application. I hope this may help you. Good luck and best wishes!
@sauravsingh-oi3fm
@sauravsingh-oi3fm 4 года назад
Sir! I didn't understand the programming of pwm system. So, may you explain programming again? Other wise we love you a lot. Thanks!
@moreon5163
@moreon5163 3 года назад
So you generate a digital signal on the PWM pin. But this signal is a square signal which means the high part of the signal means 5 volts the low part means 0 volts. So you have a period of 2 miliseconds of which the number next to the pin number declares how much time of the 2ms period the signal is set as high (5v). So number 0 means 0% of the period, 255 means 100% of the time and that way you generate a voltage on the pin. 0 = 0 volts and 255 = 5 volts.
@benfree_man
@benfree_man 4 года назад
Super helpful
@Miluluskii
@Miluluskii 18 часов назад
No entendí 3 caranchos pero igual sirve 😜
@zunairahmed959
@zunairahmed959 4 года назад
well explained
@imadeivan7226
@imadeivan7226 5 лет назад
sir please upload a tutorial for pump 6v PWM
@nerisajanu2054
@nerisajanu2054 4 года назад
How can we use two pins at a time to produce PWM???
@dawoodips
@dawoodips 3 года назад
Sir I want run the buzzer only for 10 seconds then it should turn off Automatic . Acutely IAM doing this for water level controller if the water level reaches high level it should beel for 10 seconds . I tried but the buzzer is not stoping plz help me .
@firdausburhanuddin4816
@firdausburhanuddin4816 2 года назад
Hello sir. Can you help me in programing how to count encoder pulse and display ok if complete 1rev using mega?
@aaryanpakhrani2578
@aaryanpakhrani2578 6 лет назад
Sir please upload a tutorial for controlling leds with Amazon Alexa
@BINARYUPDATES
@BINARYUPDATES 6 лет назад
Hi Aaryan, I will upload Amazon Alexa tutorial soon. Thanks for your Patience.
@contactATashleygriffin
@contactATashleygriffin 2 года назад
Do not see dimming of the LED once the program was run !
@BINARYUPDATES
@BINARYUPDATES 2 года назад
Usually because of an exposure of Camera, its hard to capture changes in video recordings. So better you can try on your own Arduino with same code. And see brightness changes with PWM Signal Note: May need more attention while observation!
@kkcsynzx6250
@kkcsynzx6250 Год назад
Can you control The duty cycle with a Potentiometer I dont need a delay On If pot is 25 % the duty cycle is 64 If it’s at 50 If it’s at 75 And if it’s at 100 the duty cycle is 255 I don’t need to turn it off Can you help me Sir please 🥺🥺
@carlotheatheist
@carlotheatheist 2 года назад
hey was it possible to make a code for high rpm fan controller? you know. i want to reach 7,000 rpm.
@BINARYUPDATES
@BINARYUPDATES 2 года назад
Hi Carlo, the rpm means a speed completely depends on motor of a FAN. You can check in manufacturers documentation. In general, arduino is capable of driving any speed you wish. I hope this may help you. Good luck!
@ragulsk5372
@ragulsk5372 5 лет назад
sir can the value of duty cycle be in decimal no.
@kolhatkarchinmay
@kolhatkarchinmay 6 лет назад
Try using for loop to get perfect PWM dimming effect. Put each of ur statement of analog write in For loop let say for 50 time runing loop with analog value of 45 with again loop containing delay in usec or mSec
@kolhatkarchinmay
@kolhatkarchinmay 6 лет назад
Or the simplest method is to us some static variable along with for loop to avoid writing numer of statement. Also try using Internel timers of atmega328 with CCP capture compare to get exact effects on LEDs
@BINARYUPDATES
@BINARYUPDATES 6 лет назад
Hi Chinmay, I have already made that video to control brightness of LED using analogWrite function with for loop. By the way thanks for your comment.
@firewater365
@firewater365 2 года назад
In what order what i put the code if I used a pushbutton to make the LED dim at those values?
@BINARYUPDATES
@BINARYUPDATES 2 года назад
Its hard to write code in comment section but you can use input of pushbutton and connect to any digital pin of Arduino and then in switch case statement along with analogWrite() function to generate PWM signal with different duty cycle to control brightness of an LED. I hope this may help you. I'll try to make similar video in future. Good luck!
@aroosababar4613
@aroosababar4613 2 года назад
Plz can you generate the two pulses of 50% duty cycle and frequency of Mhz. Where one pulse is the inversion of other?
@BINARYUPDATES
@BINARYUPDATES 2 года назад
Yes Aroosa, you can generate two PWM Pulses. I think in your case it would be good to take two pwm pins on Arduino to generate pwm signal with one pulse inverted
@aavesh.bagwan
@aavesh.bagwan 2 года назад
How do we control the brightness of ac bulb
@BINARYUPDATES
@BINARYUPDATES 2 года назад
Hi Aavej, you can use Dimmer Module with Arduino which uses TRIAC circuit. There are several of such module you can buy online and precisely control the dimming of an AC Light Bulb and Control the Speed of FAN. Good luck for your project Best wishes Umesh
@aavesh.bagwan
@aavesh.bagwan 2 года назад
@@BINARYUPDATES thank you 👍🏻
@taumorake725
@taumorake725 3 года назад
whats the name of the app you use to create / make this videos?
@BINARYUPDATES
@BINARYUPDATES 3 года назад
I used iSpring FreeCam for shooting
@taumorake725
@taumorake725 3 года назад
@@BINARYUPDATES ok thanks, I need your help with something. How can i conduct you?
@nilfarkhan
@nilfarkhan 3 года назад
Hai how to light up LED from 0 and pause at 255 .
@BINARYUPDATES
@BINARYUPDATES 3 года назад
Hi Nilfar, the PWM feature in Arduino uses 8-bit Timer. And hence the range it will count from 0 to 255 to change the brightness through generating pulse width modulation signal
@paramgandhi5768
@paramgandhi5768 4 года назад
Can you make a video on analog read,write and digital read,write?
@BINARYUPDATES
@BINARYUPDATES 4 года назад
Hi Param You can check LM35 with Arduino Uno Video on BINARYUPDATES YT Channel to learn about analogRead, And PIR Motion Sensor with Arduino video for digitalRead. I hope this two videos will help you how to use more arduino fucntions in rel live projects. Thanks
@133surjeetsinghgour8
@133surjeetsinghgour8 2 года назад
Nice
@danielmoraes9637
@danielmoraes9637 5 лет назад
thanks
@electronicsideas1361
@electronicsideas1361 3 года назад
NNED CODE
@milespeterson5049
@milespeterson5049 Год назад
Please share code ):
@BINARYUPDATES
@BINARYUPDATES 11 месяцев назад
Hi Miles, the code for generating PWM Signal is here void setup() { } void loop() { analogWrite(9, 64); delay(1000); analogWrite(9, 127); delay(1000); analogWrite(9, 191); delay(1000); analogWrite(9, 255); delay(1000); analogWrite(9, 0); delay(1000); }
Далее
Секрет фокусника! #shorts
00:15
Просмотров 44 млн
ЛОВИМ НОВЫХ МОНСТРОВ В LETHAL COMPANY
2:42:22
PID control on arduino
11:02
Просмотров 336 тыс.
Understanding Pulse Width Modulation
13:45
Просмотров 18 тыс.
Control Large Gearmotors with PWM & Arduino
34:34
Просмотров 260 тыс.
Converting an Arduino PWM Output to a DAC Output
18:48
Просмотров 109 тыс.
Pulse Width Modulation (PWM) - Electronics Basics 23
7:28
How to Turn an LED On
17:00
Просмотров 1,5 млн
Секрет фокусника! #shorts
00:15
Просмотров 44 млн