How to use Pushbuttons with Arduino. Pull up vs Pull down resistors

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

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

  • @ionalexandru6388
    @ionalexandru6388 2 ปีที่แล้ว +14

    I haven't seen lately such a good tutorial describing things in general, congratulations! Everything is clear and explained in such a profesional way.

    • @marios_ideas
      @marios_ideas  2 ปีที่แล้ว +1

      Thanks:) Makes it all worthwhile:)

  • @alphamega3306
    @alphamega3306 5 หลายเดือนก่อน +4

    Excellent video. If only all the professors of whose lectures I’ve sat in could explain things so clearly. I swear that they always think it’s their students fault for being incapable of comprehending it, when in reality they overcomplicate and thereby mystify what are in reality basic concepts which anyone can understand-so long as someone like you explains it.

  • @Compuscience-Python-Prog-Exps
    @Compuscience-Python-Prog-Exps ปีที่แล้ว +7

    You have NO IDEA just how much you helped me see the difference.
    I have a Rasp Pi 4, for about a year and a half now, and awesome fun they
    are. I have to learn so much more. I watch you guys all the time to help me
    learn electronics in a later life. I'm in my late fifties and I'm learning this
    on my own, with help from you guys and internet sources always helped.
    Superb Thank you....👌👍

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

      Glad I can be off help:) Consider supporting my channal.

  • @prashashi
    @prashashi 10 หลายเดือนก่อน +1

    I was stuck with this confusion whole day
    you have no Idea how much you helped
    THANK YOU

  • @259Den3
    @259Den3 หลายเดือนก่อน

    Thank you, this is the only video I found that described 'floating pin' and the influence of EMI!

  • @salmonnortje1690
    @salmonnortje1690 11 หลายเดือนก่อน +1

    Best description of the concept I have found thus far. Thank you very much for making this video!

  • @FlokTheOne
    @FlokTheOne หลายเดือนก่อน

    Thank you dude, I have been trying and searching for a solution for more than a week til i came across your video

    • @marios_ideas
      @marios_ideas  หลายเดือนก่อน +1

      @@FlokTheOne great this content was useful. Consider supporting this channel. Also check my other tutorials . Maybe you can find some more useful information for you

  • @GerryWhatever
    @GerryWhatever 3 หลายเดือนก่อน

    Brother, you have no idea how much you have helped me, i've been for some days already trying to figure this out and you were able to explain it very clearly, thanks for your video.

    • @marios_ideas
      @marios_ideas  3 หลายเดือนก่อน

      Glad i was of help. Consider supporting my channel:)

  • @nerdblender69
    @nerdblender69 11 หลายเดือนก่อน

    Boom! just like that, my switch actually controls my relay! I'm a 4th year Mech Engg student making a conveyor sorting system for school, and I could not for the life of me figure out why in the off position my relays would go nuts. Thank you, Mario. You saved me from a lot of frustration!

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

    One of the clearest explanations I've watched. Thanks a lot!

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

      You are too kind:) Please consider supporting my channal.

  • @mingosutu
    @mingosutu 10 หลายเดือนก่อน

    NIIIIIICE JOB!! At last, pull-up, pull-down, pull-left, pull-right all understood. Thanks, man.

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

    I've been working on making a buzzer controlled by a PWM signal for close to a week now. I've been troubleshooting my code since the beginning thinking the mistake was in there. After this video I solved my problem in less that 5 minutes. Great video!

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

      Great it was helpful. Consider supporting my channel:)

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

    Thank you so much mate.
    I'm doing a quiet big project for swimming pools, to control the filter pump, booster pump, chlorinator, heater, valve actuators, variable speed pumps etc, my project was working fine on protoboard, I printed the PCB and the button interferences show up on butons inside the MENU screen, now I'm using pullup method using the ESP32 internal resistors, and voilà it's working fine again. Many thanks for your time to make and post this video, I'm really gratefull. Cheers.

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

      Glad my content was of help to you. Consider supporting my channal

  • @catmeow2633
    @catmeow2633 3 หลายเดือนก่อน

    Thank you so much, I've been puzzed a lot seeing Arduino docs, not knowing what on earth pull-up/down resistor and built-in pull-up resistor are, now I know it clearly.

  • @TrippyElectronics-yn4fh
    @TrippyElectronics-yn4fh 21 วันที่ผ่านมา

    Finally someone explains it well! Thank you.

    • @marios_ideas
      @marios_ideas  19 วันที่ผ่านมา

      Glad you think so!

  • @TerryHughes-u4m
    @TerryHughes-u4m ปีที่แล้ว

    Very nicely done, and thanks for mentioning the on-board resistors.

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

    You have been reading my mind lately. You are posting videos on topics I am researching haha

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

      I have not been called a mind reader before:) Like the video if it was what you were looking for

  • @egbekunleshalom577
    @egbekunleshalom577 7 หลายเดือนก่อน

    Simplest tutorial i have seen so far, Thank you

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

    Best Video concerning Pullups so far, thank you very much!

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

    Thanks for going to such great lengths animating all of this. Great work!

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

    Not to much talking. Proof of everything with mathematical language which everyone understands, very good job, kydos to you.

  • @followinglove777
    @followinglove777 11 หลายเดือนก่อน +1

    Sir how do you calculate the resistor value (10k) ? Please help me...🥺. Thank you so much for this video😊.

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

    Really well explained! Thanks so much. This will help me a bunch with a current project.

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

    Wow it's really a great explanation and the illustrations are simple and awesome

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

    This is so good. OMG - you are such a great teacher. I am so impressed - Thank you!!!!

  • @prov_s195
    @prov_s195 10 หลายเดือนก่อน

    Questo è un video fantastico e spiegato da dio! grazie Mario

  • @Quilonis
    @Quilonis 11 หลายเดือนก่อน

    As newbie i can say , i've got same mistake(i realized that after whole day of thinking). Im really glad , that im not the only one who did that mistake😅

  • @AJANTHAMEENA.S
    @AJANTHAMEENA.S 7 หลายเดือนก่อน

    Clear explanation with example, Thank you sir

  • @tensor131
    @tensor131 2 ปีที่แล้ว +1

    brilliant! thank you so much - so clear and logical.

    • @marios_ideas
      @marios_ideas  2 ปีที่แล้ว

      THX:) Like the video if you enjoyed it. You support my channel this way

  • @steverileyretired
    @steverileyretired 2 ปีที่แล้ว

    Great Video, love the first old bit, very cool, have subscribed

    • @marios_ideas
      @marios_ideas  2 ปีที่แล้ว +1

      I am glad you liked it. Had lots of fun making that intro:)

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

    great. Thanks. I didn't know that a pullup was already in Arduino. thanks

  • @Brewsterblock
    @Brewsterblock 10 หลายเดือนก่อน

    Wow! Best explanation yet! Perfect mix of theory and circuitry and how they work! Thanks. Still one puzzle. The original problem was due to noise voltage in the open or loose wire going to A0. In your diagram for pull down, that same wire is still there with the OPEN switch. Why isn't that same noise still present? Indeed it is now connected to ground via a resistor making the current flow for this very tiny voltage difficult. So why doesn't the original noise voltage still flow to A0?

    • @marios_ideas
      @marios_ideas  10 หลายเดือนก่อน

      Not being very electronic profficient I also had a problem to get my head around it. But in summary. Voltage doesn't from current does. If flows from positive voltage to ground. And through pulldown resistor and the use of voltage divider we set ground at the pin. Arduino detects the voltage value not the flowing current.

  • @way5063
    @way5063 7 หลายเดือนก่อน

    very clear presentation👍

  • @ashishmajithiya8215
    @ashishmajithiya8215 9 หลายเดือนก่อน

    Best tutorial. Thousand Thanks, Brother.

  • @KW-ei3pi
    @KW-ei3pi ปีที่แล้ว +1

    Thanks Mario. Excellent explanation. For this button/LED set up, is it necessary to use and Analog pin, or will the set up also work with a digital pin? Thanks

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

      All pins have built in pull up resistors. I just chose to use Analog pin

  • @swainscheps
    @swainscheps 7 หลายเดือนก่อน

    Something about 6:45 to 7:30 I just am not understanding. Why would it read high with a big fat resistor in the circuit?
    …i mean I get that I need to add a pull up / pull down resistor - but I can’t follow the logic of where/how the electricity is flowing.
    It’s strictly a ‘me’ problem…

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

    Thank u so much! it helped so much on my task from Senac xD

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

      Glad I could be off help. Consider supporting my channel.

  • @mrstevennewmanEDU
    @mrstevennewmanEDU 2 ปีที่แล้ว

    A very good explanation!

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

      My pleasure:) like the video and subscribe to my channal. Also consider supporting it.

  • @elektron2kim666
    @elektron2kim666 2 หลายเดือนก่อน

    It's not a practical micro controller project when you can eliminate the micro controller, but it's good for training and I still have to think when making a button or two for something. My code is on some kind of game level in comparison. You will need buttons or a button to set a number or have modes in the project - many, many times. Text is much worse, but we have all sorts of displays to show a little keyboard setup and use 2 buttons for moving a cursor and a third for enter and I2C keyboards and clever people showing how to do it. Most is a study problem, if you can't. Touch functionality is just "buttons" in another way and it's the same principles.

  • @PinoyTechTutorials
    @PinoyTechTutorials หลายเดือนก่อน

    Thank you sir! you mind sharing what online course I can get to do those animations you do?

    • @marios_ideas
      @marios_ideas  หลายเดือนก่อน +1

      All my animations are done in Powerpoint.

    • @PinoyTechTutorials
      @PinoyTechTutorials หลายเดือนก่อน

      @@marios_ideas haha! really? amazing! I thought I need to learn a new skill for it! thank you sir!

    • @marios_ideas
      @marios_ideas  หลายเดือนก่อน

      @@PinoyTechTutorials I used PowerPoint at work. I do not think there are courses on just animations in powerpoint

  • @pedrotorchio
    @pedrotorchio 11 หลายเดือนก่อน

    Nicely done. Thank you.

  • @lucca2419
    @lucca2419 2 ปีที่แล้ว

    Ty, u save my time i have same problem and now i know how to fix it.

    • @marios_ideas
      @marios_ideas  2 ปีที่แล้ว +1

      Give video a like if you enjoyed it. Subscribe if you want to see similar content in the future:)

  • @КалёнаяСталь
    @КалёнаяСталь 2 ปีที่แล้ว

    Perfect explanation, thank you

  • @tobalkamal5723
    @tobalkamal5723 4 หลายเดือนก่อน

    Thanks, very clear!

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

    Great Video!

  • @TheBinklemNetwork
    @TheBinklemNetwork หลายเดือนก่อน

    that was a creative intro

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

    In pull-up configuration, why do we have all 5V when the button is not pressed ? Normally, shouldn't we have much less than that because of the big resistor of 10k ohms that will decrease those 5V ?

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

      Have you watched the video carefully. There is an explanation using voltage divider circuit to show how this works

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

      @@marios_ideas Actually he was not asking about the voltage divider when the circuit is closed, but why when the circuit is open the 5V goes through a 10k resistor to A0 but still remains 5V instead of decreasing for e.g. to 2V?
      I didn't understand this too.

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

      A push button is a mechanical switch that consists of two states: pressed and unpressed. When unpressed, the button effectively disconnects the digital pin from ground, so the pull-up resistor is the only component in the circuit connected to the pin. Since the resistor has a high value (10k ohms), it limits the current flow to a very low level, and the voltage at the pin remains close to 5V.@@SebVEVO

    • @Markus-fw4px
      @Markus-fw4px 8 หลายเดือนก่อน

      Since there is no current-flow when the button is not pressed, just use U=R×I to understand. Without current there is no voltage drop after an resistor.

  • @petztech
    @petztech 10 หลายเดือนก่อน

    Just Thank you sir, just thank you

  • @fastview79
    @fastview79 3 ปีที่แล้ว

    instead of pinMode (9,OUTPUT) is it possible to declare SDA(A4) or SCL(A5) as output to switch on an oled to show time for 5 seconds in a night clock project and a capacitive proximity sensor instead of a button?

    • @marios_ideas
      @marios_ideas  3 ปีที่แล้ว

      Yes. You can do any other action. Led is just an example.

  • @0124akash
    @0124akash ปีที่แล้ว

    Can I write
    pinMode(A0, input_pulldown)
    When I put the up signal then pin no 9 is up otherwise low.

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

      No . There are only pull-up resistors build in. You have to adjust the code to take this revers behavior into account

  • @belaidbelaidi1712
    @belaidbelaidi1712 10 หลายเดือนก่อน

    thank you dear you helped me a lot

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

    Thank you, sir.

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

    Why does it not blink when we haven't pushed the button one time yet ? Why does it start to blink only when we do push the button and release it for the first time ? Does it ??

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

      You mean when we have a floating pin situation? It is completly random

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

      ok, thanks

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

    why would I want to use external resistors when I can let the arduinos internal resistor handle it?

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

      I guess only if you do not want to have the Pullup logic and want to stick to pulldown. For small project adding a resistor is not a big deal. but for more complex ones if you create custom PCB minimmising number of conponents is super important. A lot of people do not also realise that those pullup resistors are available:)

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

      @@marios_ideas alr, thank you for the response (-;

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

    Thank you 🙏

  • @PostalPete
    @PostalPete 7 หลายเดือนก่อน

    Which one is better pull up or pull down?

    • @marios_ideas
      @marios_ideas  7 หลายเดือนก่อน +1

      There is virtually no difference. Internal Pull up wins, as you can use build in pull up resistors so then you do not have to use external resistors.

  • @snowglider400
    @snowglider400 3 ปีที่แล้ว

    best explanation

    • @marios_ideas
      @marios_ideas  2 ปีที่แล้ว

      Give video a like. Would help me a lot:)

  • @drmlnr5872
    @drmlnr5872 5 หลายเดือนก่อน

    helped so much thanks

  • @wizdumb420
    @wizdumb420 3 ปีที่แล้ว

    thank you. concise.

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

      Give video a like if you enjoyed it

  • @samithetechsavvy6485
    @samithetechsavvy6485 4 หลายเดือนก่อน

    thank you very much

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

    My question here: Why 10k resistor, why to put a resistor ?

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

      Maybe so that current only flows through the switch

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

      Because when you press the button power will flow from 5v to ground directly and resulting short circuit

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

    Useful!

  • @danielgrapas3309
    @danielgrapas3309 2 หลายเดือนก่อน

    ty

  • @ethanmakes8308
    @ethanmakes8308 หลายเดือนก่อน

    guys here from class 7

  • @subtocamythebanana1649
    @subtocamythebanana1649 2 ปีที่แล้ว

    🤓

  • @fench1234567
    @fench1234567 11 หลายเดือนก่อน

    555th like... lol!

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

    Thank you!