Creating A Variable Voltage Analog Signal WIth PWM And Variable Duty Cycle - Simply Put

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • A normal microporcessor (like what the Arcduino Uno uses) can't put out an analog voltage: The 'analogWrite' function is how you set a pin to PWM output mode, making it one of the most asinine function names in the history of software engineering. We can fix the mistake, though: A simple low-pass filter in the form of a resistor and a capacitor can smooth it out to an actual variable voltage, varying from low rail to high rail by varing the duty cycle from 0% to 100%.
    Arduino Uno Playlist: • Arduino Uno
    Tips And Tricks Playlist: • Tips And Tricks
    Signal Processing and Filtering Playlist: • Signal Processing and ...
    You can join me on Discord as well! -- / discord
  • Наука та технологія

КОМЕНТАРІ • 38

  • @mkhmkh1266
    @mkhmkh1266 Рік тому +2

    I watched a bunch of your videos a while ago. I am now in a place where I need to speed control a DC 2 wire fan, and reports are that PWM makes them whine, and I don't want to waste power heating a resistor. I may actually design something that uses a couple of your videos worth of shared knowledge. Thanks.

  • @joulesparlour5443
    @joulesparlour5443 Рік тому +3

    This is just what I needed. I can't say how much this helped. Thank you. Thank you. Thank you.

  • @keithking1985
    @keithking1985 4 роки тому +4

    filtering is just one of those things that we learners find class because of the fact we can see and hear the changes we can do with signals.. so id say that's why your video is so popular. cos it lets us see that we are learning.. : )

  • @JackLe1127
    @JackLe1127 Рік тому +1

    I absolutely love your headphones

  • @filipstojanovicmechanicale9265
    @filipstojanovicmechanicale9265 2 роки тому +1

    Excellent video sir, very simple and entertaining video, good explanation even for my hollow pumpkin head. Keep up the great work !

  • @SkibidiWaPaPaPaPa
    @SkibidiWaPaPaPaPa 2 роки тому +1

    Boom, subscribed! You're great at explaining and teaching. Thank you

  • @ianbaxter3905
    @ianbaxter3905 Рік тому

    Great vid and brilliantly explained. Thank you. Got me out of a jam using Arduino PWM to control an LED-LDR 'vactrol' to replace a pot for pitch control on a homemade synth. The PWM was giving me unwanted frequency modulation but a 4.7uf / 100k filter sorted it. NPN as voltage follower to drive the LED.

  • @Flyrip
    @Flyrip 2 роки тому

    Excellent stuff :) Your way of explaining is fenomenal 👍

  • @theoceansucks
    @theoceansucks 2 роки тому

    where have you been all my life? that was flippin' great!

  • @miketony2069
    @miketony2069 4 роки тому +5

    This was so awesome! Exactly what I was looking for. I basically have 16v LED flood light that I’d like to control from an micro controller (esp8266). Now using a mosfet to turn on and off is easy , I wanted to add dimming capability. I tried pwm the pin going to the get and it kinda worked. Was very klunky in the transition. Using your approach of an extra filter as I put to the gate should allow me to smoothly adjust gate voltage which should vary the drain source current to the led.

    • @abelemiliano4067
      @abelemiliano4067 2 роки тому

      you prolly dont care but does someone know of a tool to log back into an Instagram account??
      I somehow lost the account password. I would love any help you can offer me

    • @alaricdayton7958
      @alaricdayton7958 2 роки тому

      @Abel Emiliano Instablaster =)

  • @parapos
    @parapos 4 роки тому +1

    great explanation, thank you.

  • @Haamedtm
    @Haamedtm 3 роки тому

    I really like your explanation, you deliver the details to the audience very clearly.
    I think your channel will be more successful if you have a working PCB of your projects (those which can be made into a PCB).
    The majority of the EE audience don't care about the details (though the minority like myself love it), they just want a brief explanation and a pre-built PCB to copy and build.
    Channels like greatscout, electronoob etc targeted those audience and they are very successful.

  • @bogdanbokalo6737
    @bogdanbokalo6737 2 роки тому

    Competent lecture, thank you

  • @brandonoh777
    @brandonoh777 3 роки тому

    I have come across several of your videos on similar topics when i have been researching/thinking about how to do this little interesting task i am trying to accomplish. Basically i have a non-limiting grid tie inverter that i want to be able to throttle. I have read that the limiting (grid tie inverter w/ limiter) the ones that have the CT on the mains utility lines to measure total demand and then limit there AC production not to exceed that value, do this limiting/throttling by shifting the MPPT function to a less efficient area to limit the total power output....i should have noted that both types of inverters have (or at least say they have) MPPT function on the DC input side. I have considered DC-DC CC-CV converters, DC motor controllers but i think the problem there is those use PWM to do the DC-DC converting AND the MPPT functions on the DC side of the inverters also use PWM so i would be feeding a PWM signal into another PWM. This is where i got to thinking if the PWM was filtered down to a more pure DC signal. Currently theses inverters just have the PV panels plugged directly into the MPPT function of the DC side of the inverter. Getting into the MPPT calculations to make them purposely less efficient is probably way above my head electrically But i see this whole little project as a challenge and learning process more then being a long term piratical solution...that would be just buy the more $$ inverters with limiting :) ...so my questions are 1. what might be the best way to throttle/limit theses types of inverters form the DC side 2. With the voltages/current i am dealing with what types of R and C values might be good to try to filter the output form the DC-DC converter before it feeds into the MPPT of the inverter? 20-40 VDC and maybe a max of 25-30 amps incoming to the inverter...Thanks for any insight or ideas you may have..Brandon

  • @engineereuler1762
    @engineereuler1762 4 роки тому +3

    I salute you, sir. What you're putting in your videos is what most other EE video producers are failing to touch most probably because they don't even understand...you make simple with no differential equations and advanced math. I learned most of this in grad school 20 years ago in a course that used the books of the great Van Valkenburg "Modern Network Synthesis" and "Analog Filter Design" and that was before the dumbing down using hyped marketing terms got us where we are now (Arduino, IoT, electronics named after fruits, ...etc...ideocracy the movie). Here's a suggestion for a future video, add opamp buffers between the three RC segments in your previous video that has a popularity that bothers you. Two quick recommendations, 1st, please do quickly mention the formula for choosing the values of R and C even if you try to avoid any kind of math, and second, this silence-cutting video editing tool is very confusing and is beneath your REAL content...it makes me view your videos at 0.75 the speed. I'm sharing your work everywhere, God(s) bless.

    • @engineereuler1762
      @engineereuler1762 4 роки тому +1

      Is there a way that I can call you or send you an email?

  • @yahoobolt
    @yahoobolt 2 роки тому

    he is a genius

  • @mkhmkh1266
    @mkhmkh1266 2 роки тому

    I really liked this, like how you think and explain things- Can you show how to turn an arduino pwm output to get a 0-12volt constant current output? I am looking to drive a Peltier or two and put a closed loop on it to keep it from freezing. I bought a darlington pair 10A chip to drive it- but it's been 25 years since I last built or debugged an electronics circuit.

  • @ExatasDistribuidas
    @ExatasDistribuidas 2 роки тому

    Vídeo muito bom

  • @braveheart5280
    @braveheart5280 2 роки тому

    How about using 2 smaller caps equal to the single cap to speed up conversion ? GREAT VIDEO.

  • @deaddoomed2380
    @deaddoomed2380 3 роки тому +1

    How can you take off the dc offset from that triangle wave filtered from the square one?
    I was been struggling with that since 1 week and I'm starting to get crazy
    Greetings from Chile!

  • @NoToPCBS
    @NoToPCBS 2 роки тому

    I have a 3000w - 6000w peek generator that is produces a 240v modified sign. Is there a device that i can buy off of ebay / amazon that i can feed this source into that will output something close to a pure sign wave? Thanks

  • @Neptunium
    @Neptunium 2 роки тому

    Good explanation and visual aid .. especially for an idiot like me . Maybe you could help me with a project ? I am trying to drive a DC motor from the variable analog output of a data acquisition module (DAQ) but the current is just too weak to drive even a small motor. basically I need a variable relay and instead of a knob changing the speed, the small current would . the output is variable from -10 to +10V DC... have I made myself clear enough ? do you know of a such a device ? Sorry if I am way off here!

  • @shitheadjohnson2797
    @shitheadjohnson2797 2 роки тому

    I was going to suggest the exact same circuit for a different reason. yep - I guess that this is fully tested and prooven? captech!

  • @gkdresden
    @gkdresden Рік тому

    PWM is in general an analog signal, because the duty cycle can have each value between 0 and 1. Digitally created PWM of course is not, because also the duty cycle has fixed values.

  • @zeroumashi2947
    @zeroumashi2947 Рік тому

    Does this mean "arduino uno" can turn a variable voltage to pwm?
    I'd like to know, because if that's the case i might be able to use it to power third party fans on my mac pro.

  • @alchemy1
    @alchemy1 2 роки тому

    Is that correct to say that a capacitor does not charge nor discharge in two values? If that be the case, a capacitor perhaps is an analogue device.

  • @ryancui3326
    @ryancui3326 Рік тому

    But how do you determine the values?

  • @DrGeta666
    @DrGeta666 2 роки тому

    lol that bare headphone side is so off putting. i just focused on questions why instead of listening hahah, good explanation anyway :)

  • @abdussamed107
    @abdussamed107 4 роки тому

    Can you make a video on how to make a homemade 12v dc to 230 v ac converter the simplest way, since you have a clue about waves and electronics. From start to end

    • @simplyput2796
      @simplyput2796  4 роки тому +2

      Working with voltages that big is not for the faint of heart, and also not for the amateur. Increasing voltage is the work of a transformer, but trying to drive any sort of powerful load (which I assume is what you want to do, because I doubt you're asking for 230V AC for a couple milliamps) demands an actual professional device like a power inverter. A casual search is returning results ranging from 30$US to 220$US, and those devices are much less likely to result in either of us dying.

    • @abdussamed107
      @abdussamed107 4 роки тому

      @@simplyput2796 I am sure you can make one which is capable of doing at least a couple hundred watts. When you think its too complicated how about a teardown?

  • @shitheadjohnson2797
    @shitheadjohnson2797 2 роки тому

    if you made a capacitor analogue computer, the capacitor timing will probably dictate the performance...

  • @funkyjug2107
    @funkyjug2107 2 роки тому

    Is it just me or does the title say WIth? The I is capital.

  • @alchemy1
    @alchemy1 2 роки тому

    I feel that the bright line that represents 0 volts on the oscilloscope is good just for convenience only. Actual 0 volts in my world means no volts. Unless no volts is even less than 0 volts. A true 0 volts would be nothing just a blank space. And that is what I have to say about that.
    This does not mean I am arguing with you. I enjoy every one of your videos. I just feel you go a little too fast for me.... but that is not you. I am getting too dam old. :-)

  • @jimannothe
    @jimannothe Рік тому

    What's with your headphone? xD Great video BTW