MEC DER
MEC DER
  • 6
  • 19 588
How connect multiple switches to one pin: Part 2
In this video, I show to use python to help with the resistance calculations for the circuit described in the last video, in particular, the repetitive nature of the calculations.
Hopefully, this will help with this circuit, but more importantly with other calculations, where python may be of great use in removing the repetitive hand calculations.
มุมมอง: 277

วีดีโอ

How connect multiple switches to one pin, Arduino?
มุมมอง 17K4 ปีที่แล้ว
In this video, I show the circuit needed to connect multiple buttons to one pin (an analog pin) on the Arduino. I explain the circuit and how to design it. This circuit displays the power and usefulness of resistors and the potential divider.
Why Steel Corrodes And Aluminium Doesn't
มุมมอง 1.6K4 ปีที่แล้ว
Here I discuss why aluminum doesn't suffer from the same level of corrosion as steel. mecder.design/rust-and-corrosion
Bike pannier clips design mould fault
มุมมอง 1264 ปีที่แล้ว
Bike pannier clips design mould fault - there is a mould line in the same place as the area of the highest stress, this makes the part un-necessarily weak.
3D Printed Adjustable GoPro Stand- Friction Joints.
มุมมอง 2554 ปีที่แล้ว
In this video, I talk about an adjustable stand I've designed for my GoPro with some points of interest that will hopefully help you in your projects. My Website: www.mecder.design/ My Instagram: mec_der_?hl=en I will be adding this to my Thingiverse when I've printed a few and I am fully happy with it. I will put the link here when it is on there, I will also put links to the bi...
Need It, Make It, Got It- Renault Trafic Clips
มุมมอง 1404 ปีที่แล้ว
In this video, we replace the clips on a Renault Trafic van, but instead of buying them, we make them from scratch. using CAD and a 3D printer. I show the workflow of how this kind of project is undertaken. I hope you enjoyed and gained value from the video. It appears that these clips are also used on, Renault Master, Renault Kangoo, Iveco Daily, Nissan Primastar, and the Opel Vivaro. The Link...

ความคิดเห็น

  • @tetraquark2402
    @tetraquark2402 15 วันที่ผ่านมา

    Nice! takes me back to when I studied electronics 40 years ago but then switched to programming mainly because I found the maths hard to do

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

    Can this be done with rotary encoder?

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

    This is a ladder resistor I've just done this on 1 of my projects it's fine as long as you don't need to press more than 1 button at a time

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

    Or you can spend $1 and use an expander and cut the code by about 90%. Debounce would be a nightmare and multi-press will cause a number of issues.

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

      By expander do you mmean a multiplexer or something else?

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

    Issue is dirty switch contacts as they age causing errors.

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

    💖💖💖💖

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

    Or, for N push=buttons, connect N+1 of all the same resistor value (doesn't really matter, just chose the sum to give maybe 0.1-10mA through the lot) and then use the switches to select a tap on the chain to the ADC input. No complex math, no problematic values. If the ADC is not reading the rail (put a big puller to one of the rails) then a switch is pressed, the voltage read tells you which.

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

    Ironically I have an alarm clock that uses this principle. The only problem is sometimes pressing the time set button changes the alarm time. Turning the alarm on/off is a button clicking concerto in the morning.

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

    You could also put the resistors from each switch in parallel and determine the resulting resistance to know if multiple switches were pressed at the same time

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

    Great idea. I wasn't sure why you needed to add Rg (until later when you said it was to minimize current flow). So technically you could make it simpler without it.

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

    So to use multiple switches at once, we can separate out the resistance to modulate the voltage output by 2^Rx, we can undo the math on the other end of the equation to essentially figure out which switches are closed, right?

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

    Does this work with toggle switches or will they flicker on/off?

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

    Great pair of videos. Thank yo! Do you think you'll get around to doing the next one you mentioned with regards a different circuit?

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

    Thank you!

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

    Fantastic, Thank you.

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

    Super helpful

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

    Fantastic explanation. Thank you!

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

    Nicely explained, thank you 🙂

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

    Noice

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

    could have added the voltage you're looking for too, would be hand when writing up a program Thanks for the video.

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

    cool! great idea did you use software to de-bounce the switches? it seems like if you carefully selected the resistors you could have values for multiple button press signals? too bad the esp8266 only has one adc, guess you would need a ADS1115 in that case if you needed the adc for other sensors

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

      About multiple buttons pressed at the same time: Since his values' distribution is linear (you add 0.083V each time (14:55 or this times 5 idk)) he cannot. This is an efficient way to distribute values for single presses while leaving lots of room for imperfect physical resistors' values. However, as you noticed, there is a way- make the distribution exponential (you multiply by 2 each time). By choosing the base to be 2, you can easily implement it in the binary system on the software side (Divide all values by the 1st increment and represent the resulting number as a binary number- each consecutive bit is the state of each consecutive button.). The downside would be less buttons that you could theoretically use, since the increment at the lowest values could be too small (in the case of too many buttons) for the Arduino to notice. Idk what the smallest safe increment is (would require a little bit of testing), but it determines the maximum amount of buttons you can use. About de-bouncing: These are standard buttons, so if anything he had to de-bounce them in the software. There exist expensive buttons that don't bounce when pressing and releasing. You don't always need to debounce, but for logic or other sensitive purposes you absolutely have to. You can do it by either adding a delay (with 'millis()' preferably) or by making a bunch of x previous measurements into an array and either counting whether there is more high or low states or by taking an average of those x measurements and comparing it to 0.5 (less than 0.5 would be low and more than 0.5 would be high (0.5 itself can be high or low, depending on your personal preference), since in Arduino Reference LOW==0 and HIGH==1). This comment is mainly for future adventurers, however if you check it out after those 2 years and find it still helpful, I'd be glad. lol cheers, mate

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

      What I did on my ladder resistor was use 16 samples I also used a capacitor. So you press the button and it gives you the average value over 16 loops

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

      @@shokdj1 What should be the value of the capacitor when using it? I made a 16 button system. Which capacitor should I use?

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

      @@ertugrulbt .1uf

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

      @@ertugrulbt I’d like to add I’m no expert but that seemed to help for me

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

    Really nice video! Very well explained. I'll be using the math for a rotary switch that just so happens to be 12 position so the example is perfect!

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

    Nice project india👌

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

    This quenched my late night thirst for knowledge

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

    Very informative. Thank you.