Can the ARDUINO NANO handle 64 potentiometers?

Поделиться
HTML-код
  • Опубликовано: 14 июл 2024
  • In this video we will find out if a tiny Arduino Nano can become a 64 potentiometer Midi Controller!
    PARTS on Amazon
    Arduino Nano: amzn.to/3Kk5sez
    MIDI Jack: amzn.to/3JZ3ZJg
    Breadboard: amzn.to/3zmxgc0
    74HC4067 Mux: amzn.to/40vXXa4
    Download the Code: www.notesandvolts.com/2016/07...
    Check out my NEW music channel ‪@synthwavedave‬
    / @synthwavedave
    Want to purchase the gear I use? Check out my Amazon Influencer Page: www.amazon.com/shop/notesandv...
    TWITCH: / notesandvolts
    WEBSITE: www.notesandvolts.com
    DISCORD: / discord
    TWITTER: / notesandvolts
    INSTAGRAM: / notesandvolts
    PATREON: / notesandvolts
    MUSIC: tekbrane.bandcamp.com/album/s...
    Spotify - iTunes - RUclips Music: Tekbrane
    Intro: 0:00
    Details 1:00
    PCB 1:56
    Current Draw: 6:24
    Software 13:32
    Hardware 19:24
    Test 24:43
    Thanks! 25:56
  • ХоббиХобби

Комментарии • 137

  • @BlackDuke235
    @BlackDuke235 Год назад +42

    This project has so much potential.

  • @TomAlmy
    @TomAlmy Год назад +8

    As long as the leakage currents aren't too great, you can connect the 4 COM outputs together and to a single analog pin on the Nano. And then use the Enable inputs of the four multiplexers to enable a single multiplexer at a time. Then you can have the 64 pots on a single analog pin. With 8 pins (and 8 of the lots-o-pots boards) you could have 512 pots!

  • @thepcman
    @thepcman Год назад +9

    You should check the linearity of the cc outputs. The analog mux does not cut the line completely but its disconnected pins become "Hi Z", making its connection to the COM ın the order of Megaohms. On the other hand adc input is low impedance, loading the source. If you use high resistance pots, it is possible that combination of pot positions may affech each other.
    Solution 1: use 10k or lower potentiometer, add a 4 to 16 decoder and connect same select signals to decoder input. Feed each output to the corresponding pot and energize only the pot that is being read.
    Solution 2: add buffer amplifier to mux output so that it can drive the adc without impedance effect.

    • @NotesAndVolts
      @NotesAndVolts  Год назад +1

      Thanks for this info! I'll look into it.

    • @har234908234
      @har234908234 Год назад

      Any idea why I thought 74HC were buffered?

  • @GAMWTOAPOERL
    @GAMWTOAPOERL Год назад +4

    😮 Omg thats the project i am on to right now. Just finished the design of the pcb yesterday. You just made my day watching this work. Keep up the good work. Really good videos.

    • @NotesAndVolts
      @NotesAndVolts  Год назад

      Thanks so much marios!

    • @DanTechGA
      @DanTechGA 4 месяца назад

      How did you design the PCB? Do you have a file you would be willing to share?

  • @BingoBongoBengo
    @BingoBongoBengo Год назад +3

    Really information rich, great video!

  • @jungleb
    @jungleb Год назад +2

    you are amazing. i learnt so much in this video

  • @gonzinigonz
    @gonzinigonz Год назад +2

    Love this channel, very inspiring :)

  • @Krzychu-bh4rl
    @Krzychu-bh4rl Год назад +3

    Nice video! Personally I struggled with unstable pots readings, but finally I was able to write class for handling potentiometer, which used hysteresis to get rid of bad readings. Moreover, I added callbacks to be able to react to a certain events (e.g. value change, going up, going down etc.)

  • @markgreco1962
    @markgreco1962 Год назад

    Nice work pal Dave. Like that multiplexer chip.

  • @juliev123
    @juliev123 Год назад

    Great video thanks Dave!

  • @djgathox
    @djgathox Год назад +1

    the resistor part of this video blow my mind , thanks

  • @goochtwain
    @goochtwain Год назад

    Good stuff! Thanks!

  • @col8981
    @col8981 Год назад +2

    Super job, however @thepcman is correct 10k pots @ 30mA is a better choice, the lower the source impedance the better, I think100k might be a bit high depending on the difference between 2 successive ADC samples. The ADC in the Atmel 328P uses an 8 channel multiplexer with a sample and hold capacitor so, with a high impedance source (100K worst case ) there might not be enough time to charge/discharge the the S/H capacitor properly, possibly leading to some strange readings. Below is a extract from the 328P datasheet page 212:
    "The ADC is optimized for analog signals with an output impedance of approximately 10k or less. If such a source is used,
    the sampling time will be negligible. If a source with higher impedance is used, the sampling time will depend on how long
    time the source needs to charge the S/H capacitor, with can vary widely. The user is recommended to only use low
    impedance sources with slowly varying signals, since this minimizes the required charge transfer to the S/H capacitor"

    • @NotesAndVolts
      @NotesAndVolts  Год назад +1

      Thanks for the info! I'll didn't notice any ill effects but I'll definitely look into it.

    • @chrisw1462
      @chrisw1462 Год назад

      A trick used by ADC circuit designers is to use diodes to drop the voltage across the variable resistor. You'd have less usable ADC range, but could lower the value of the pots without excessive current draw. Two diodes would still give over 3/4 of the 1024 range. Since the voltage drop across diodes doesn't change, current draw won't affect your readings. A bonus is that if your ADC has non-linearity issues, you can put one diode on the + side and one on the ground, and the range ends (usually where non-linearity is worst) won't even be used.

  • @justinejacks0n
    @justinejacks0n Год назад +1

    You're a legend, Dave!

    • @NotesAndVolts
      @NotesAndVolts  11 месяцев назад

      Thank you!

    • @whatamievendoing
      @whatamievendoing 6 месяцев назад

      ​​@@NotesAndVolts have you ever done anything on the Arduino with DMX? Would love to see how to wire an analog 5-pin and/or 3-pin DMX port to an Arduino. I presume it's similar to the way you wired the MIDI port here?

  • @els1f
    @els1f Год назад +1

    That traffic flow analogy is maybe the best one I've heard lol

  • @pileofstuff
    @pileofstuff Год назад

    I do like an overkill project.
    Now to map all the pots to different things in your rig!

    • @NotesAndVolts
      @NotesAndVolts  Год назад +1

      Imagine mixing a 64 track song on this. LoL!

  • @starlevelmusic1599
    @starlevelmusic1599 10 месяцев назад

    To find the resistance in a situation like this where you have the same resistor in parallel, you just need to take the resistance of the resistor (100K) and divide it by the number of resistors (64). The answer would be 1.5, but that would be 1.5K, so if you times that by 1000 you get just the ohm amount.

  • @beachsidetech
    @beachsidetech Год назад +2

    Shortcut calc for identical parallel resistors is value divided by number of resistors. 👍

  • @LungsMcGee
    @LungsMcGee Год назад

    Did a double take on the intro. It's your pal Dave somehow became it's Chappelle Dave.🤣🤣 Nice channel, good job.

  • @skrie
    @skrie 4 месяца назад

    You are a prince amongst men.

  • @tde04014
    @tde04014 Год назад

    all depends on what refresh rate you want, the ATmega328p datasheet specifies the adc max rate to 15000 reads/sec, so if u only need a refresh rate of for example 30 you just divide 15000/30=500 so the number of pots you can connect in that case is 500, to do this you can cascade the 16to1 analog mux with 16 others witch would give 16x16 = 256 and then use two analog inputs of the nano for a max number of inputs to 512

  • @reverend11-dmeow89
    @reverend11-dmeow89 2 месяца назад

    Thank You for 'doing the math' on this territory.

  • @HazeAnderson
    @HazeAnderson Год назад +2

    One really needs to get about 31 friends so everyone can grab two pots and twist at the same time ...

  • @michaelgraff6978
    @michaelgraff6978 Год назад +3

    Or, you can just use 5 / 100000 * 64 to find the current directly.

  • @smert_okupantam
    @smert_okupantam 2 месяца назад

    6:45 64x 10k pots have common resistance of 156.25 Ohms, at 5 volts current will be 32 mA; total power = 0.16W. Plus consumption of 4 multiplexers of course.

    • @smert_okupantam
      @smert_okupantam 2 месяца назад

      this will drawn from +5V line, not from arduino.

  • @dralikg6885
    @dralikg6885 Год назад

    Thanks for the awesome videos, which Arduino is capable of handling MIDI usb also with LCD and sd card? I am doing a midi controller project that open MIDI file from SD, play it back on MIDI usb out, while receiving some controls from MIDI in and shows some info on LCD, what do you suggest for hardware/software?

  • @dexterslab_23
    @dexterslab_23 Год назад

    Great Midi controller for Ableton Live!

  • @patrickd9551
    @patrickd9551 6 месяцев назад

    The nano actually has 8 analog inputs :) A6 and A7 are analog only pins, as where A0-A5 are multi use.
    Most tutorials ignore these pins because they have extra rules if it where.
    Anyway. I would say not 96, but 128 pots without resorting to other tricks like multiplexing the multiplexers with chip select pins.

  • @pascaljean2333
    @pascaljean2333 Месяц назад

    Thanks man, some folks want to charge big bucks for this info

  • @DannyMote-dg9ue
    @DannyMote-dg9ue 4 месяца назад

    Would you ve able to provide a list of what footprints you used for each component? Noob to KiCad and could use some direction on selecting the right components.

  • @arnolduk123
    @arnolduk123 10 месяцев назад

    I think you should add a 1K bleed resistor from each pot ground pin to ground to prevent excessive current from being drawn through the pot when turned to it's minimum position, fails or shorts etc.. I = V/R so if one of those pots is turned low and the resistance is 1 ohm....that's 5V pushing 5A and smokey smokey time :) Tying the middle wiper to the outer wiper pin at ground will prevent this but the pots resistance will be affected.

    • @NotesAndVolts
      @NotesAndVolts  10 месяцев назад

      If the wiper was connected directly to ground this would be true. But it is connected to the analog input of the arduino which has a high resistance. Think of it as connecting a large resistor between the wiper and ground.

    • @arnolduk123
      @arnolduk123 10 месяцев назад

      @@NotesAndVoltsYeah you are right, I'm thinking from a pot failure point of view, some el cheapo pots have a nasty habit of shorting quickly.

  • @kavtech_midi
    @kavtech_midi Год назад

    how about reliability handle analog input with multiplexer, is there any problem or is as good as using direct analog pin (A0,A1...etc)

  • @Marc_Wolfe
    @Marc_Wolfe 5 месяцев назад

    And I thought he'd be extra smart about it and just setup a key matrix. 8 analog inputs, 8 strobed outputs.

  • @jmatonis
    @jmatonis 3 месяца назад

    Thank you for this awesome video! I am trying to build an interface for the BP synth and thought I use the code from this for a midi controller to the BP synth. I notice there is a difference between the code you supply in the notes and on the video. Would it be possible to get version 1.4? Thanks again for the great videos.

    • @hastyman
      @hastyman 6 дней назад

      Ive adapted his sketch for a BP synth based on the controls I'd want to use (32 potentiometers and 6 switches). Just trying to figure out the best way to insert it between my serial MIDI keyboard and the BP synth. Not sure if I can include a MIDI.read statement or possibly a MIDI thru to the existing sketch from this video, or if I need to build a separate MIDI host/hub that will accept two MIDI in and one MIDI out.

  • @angelovintelservis
    @angelovintelservis Год назад

    Hello! Where can I download - gerber files - for this wonderful project of yours, so that I can collect it from your Video?

  • @Likeaudio
    @Likeaudio 3 месяца назад

    Very very cool

  • @Baxton_USA
    @Baxton_USA 8 месяцев назад

    Can you make customize sound on this?

  • @charlottewilliamcover3568
    @charlottewilliamcover3568 Год назад

    Hello. The link to the code shows a file with description to be V1.2 only arduino uno. Is it still OK with Pro micro ?

  • @cheetahkid
    @cheetahkid Год назад +2

    you can add another 64 pots because there is 8 anolog inputs on the nano. Mind blows.

  • @dundizzle93
    @dundizzle93 5 месяцев назад

    The code you linked goes to an older blog post that contains V1.2 of the controller - in this video you're using V1.4. Is there a difference when using the Nano? The code in V1.2 says it is for the UNO only. Thanks.

  • @GAMWTOAPOERL
    @GAMWTOAPOERL Год назад

    Just made one with 32 pots. One of the 2 mux circuits behaves as it should. The other its very strange and unstable. When you turn a pot the pots next to it get voltage change whith result erratic midi signals...cant find solution yet. Maybe bad pcb design? 😢

  • @TehSyneS
    @TehSyneS 11 месяцев назад

    how many knobs can you use at the same time?

  • @JonMcPhalen
    @JonMcPhalen Год назад

    When parallel resistors are the same size, you can simply divide a single resistor value by the number of parallel resistors. Again, this only works when all resistors are the same size.

  • @TehSyneS
    @TehSyneS 6 месяцев назад

    Im still curious how many knobs can you use at the same time? Amazing project thanks for sharing!

    • @MoritzLuzner
      @MoritzLuzner 3 месяца назад

      i want to know this too!

    • @rolab280
      @rolab280 3 месяца назад +1

      Since it is a multiplexer you should be able to use all 64 pots at the same time. They are read in succession, not on interrupt. BUT: the bottleneck would be the transmission speed of the MIDI signals, which is 31.25 b/s. The MIDI packets are 8 bits. That means you can send 31250/8 =3906.25 messages per second on one MIDI channel. That is about 61 cc msg/knob 🙂.In theory.
      I bet there are other factors that I don't know about or did take into calculation. But roughly it should be in the right ballpark at least 🙂
      OR! It is a trick question... He can only use two knobs since he only have two hands? ;-)

  • @marinkojukic6498
    @marinkojukic6498 Месяц назад

    Would all this muxing work with FSRs? and what about latency? Is it possible to avoid it and have real time readings and conversion to midi?
    I am planning on building fsr matrix with around 64 inputs, converting it to midi. So far i've bought arduino and make 5 of fsr work on analog inputs. Struggled as it is my first project ever, but it was a good day!

  • @KristerNielsen
    @KristerNielsen 5 месяцев назад

    There are so many Nano versions so I don't understand which one to get? Live in Sweden.

  • @riksteen4933
    @riksteen4933 Год назад

    Is everything the same wire and code when using faders instead of pot meters. Thank you

  • @ynschannel_
    @ynschannel_ Год назад +1

    How many pots (message) of them can you use at the same time?

  • @gabrielrojas8911
    @gabrielrojas8911 6 месяцев назад

    I came for a midi controller and I'm leaving with a time machine

  • @11219tt
    @11219tt Месяц назад

    I am under the impression you can only read one pot at a time with a mux. This means you can't turn two pots at the same time and get them to send data. Is this correct?

  • @nikilvernongoveas8371
    @nikilvernongoveas8371 Год назад

    how do i convert serial to midi .Hairless midi isn't available for windows 10 anymore does anyone know how to make a midi controller using a nano ,uno or a mega. (i have these lying around . too broke to buy zero, due or leonardo🥺)

  • @user-mw6xw6wt9y
    @user-mw6xw6wt9y Год назад

    I get this error:
    Compilation error: 'POTS' was not declared in this scope
    Any help?

  • @Sound-Sight-Sense
    @Sound-Sight-Sense 4 месяца назад

    Interesting 🤔What happens when 2 or more pots are adjusted at the same time? Which gets preference? Does it work as a polyphonic input?

    • @MoritzLuzner
      @MoritzLuzner 4 месяца назад

      i want to know this too

    • @dubsnip1636
      @dubsnip1636 3 месяца назад

      @@MoritzLuznerthe Messages are send so fast that you won’t notice they are processed sequentially. It always works like that with midi streams. 1 by 1 at blazing speed

    • @MoritzLuzner
      @MoritzLuzner 3 месяца назад

      ok thank you!

  • @reverend11-dmeow89
    @reverend11-dmeow89 2 месяца назад

    just curious. What is the overhead time in case I grow 64 pairs of fingers and twiddle all of them at once? ;-)
    also, how difficult would it be to have some sort of 'learning patterns of behaviour' algorithms built-on in order to match certain POB so the individual pot has the appearance of being there all the time by the controlee?
    Thanks!

    • @NotesAndVolts
      @NotesAndVolts  2 месяца назад

      On all controllers, the pots are read one at a time. The microcontroller can scan them so quickly that it seems like they are all active at once.

    • @gguitarwilly
      @gguitarwilly 19 дней назад

      @@NotesAndVolts does that mean that if I'd substitute the pots with pressure sensitive resistors I'd have a 64 key keyboard with velocity and aftertouch capability? that would be something!

  • @rivitheadlab2523
    @rivitheadlab2523 Год назад +2

    Do you have the code for that? I am using an Arduino Micro with four 74HC40512 Multiplexers. It's USB MIDI compliant. So I don't have to use the MIDI Din adapter. I have followed you since the first controller video. I appreciate all you do!

    • @edwinnieuwenhuis1930
      @edwinnieuwenhuis1930 Год назад

      yeah me to i want the code for usbmidi plaese

    • @NotesAndVolts
      @NotesAndVolts  Год назад +1

      The code link is in the video description. This program uses direct port mapping for the Uno/Nano so it would need modification for other models. Plus you would need to replace the Midi library code with the USBMidi library.

    • @rivitheadlab2523
      @rivitheadlab2523 Год назад

      @@NotesAndVolts Thank you very much. I am working on it today. :)

    • @dubsnip1636
      @dubsnip1636 3 месяца назад +1

      I have built a midicontoller a couple of years back based on this code (already with 4 multiplexers on a Uno) Im planning to migrate it to USB midi coming weeks with some code adjustments.

    • @MoritzLuzner
      @MoritzLuzner 3 месяца назад

      Hey guys, I have an arduino micro here and I would love to do the same stuff with USB MIDI. Can you please let me know, when you have some code? I am quite new to this and would very much appreciate some code I can learn from!

  • @ArchetypalCat
    @ArchetypalCat Год назад +2

    Thank goodness, the nano didn't create a local black hole and suck in the universe!

    • @NotesAndVolts
      @NotesAndVolts  Год назад +1

      Yet...

    • @ArchetypalCat
      @ArchetypalCat Год назад +2

      @@NotesAndVolts "OMG! Why are things spiraling in towards the nano?! "
      Breaking News: Notes and Volts' lab creates the first electronic singularity ...

  • @iamdigilog
    @iamdigilog 6 месяцев назад +1

    Can arduino read multiple pots at the same time? i.e. if you turn 2 at the same time will the DAW get signal from all at the same time or one after the other?

    • @whatamievendoing
      @whatamievendoing 6 месяцев назад +1

      This is what I was wondering! What happens if you turn two or more pots on the same multiplexer? I might have to build this thing to see

    • @romeolz
      @romeolz 2 месяца назад +1

      I haven't seen the code to kkow for sure, but the midi signals can't be sent concurrently anyway because there's only one data wire, but the time difference is practically nonexistent

    • @iamdigilog
      @iamdigilog 2 месяца назад

      @@romeolz thanks for that. This is interesting, so technically the signal would go one after another and not simultaneously, but the time between them would be a fraction of a second (or millisecond) and almost unnoticable if I understand correctly?

    • @romeolz
      @romeolz 2 месяца назад +1

      @@iamdigilog the arduino runs so quickly that the time difference could be in the microsecond range, midi messages are only a few bytes

  • @genzomamaja
    @genzomamaja Год назад

    Godd! Thanks!
    (But the I= U/R )😉

  • @smert_okupantam
    @smert_okupantam 2 месяца назад

    13:16 wrong. if you not powers Lots-o-Pots 5V from output pins of µC you will not exceed 200mA limitation. You project is powered from USB or from AC/DC adapter, so Atmega chip limitation is not involved at all.

  • @ixilom
    @ixilom 2 месяца назад

    But.... did any of the chickens get hurt?

  • @MrCompdan
    @MrCompdan 3 месяца назад

    Does anyone know how this is possible without using MUX? Wanting to be able to turn multiple pots at once

    • @NotesAndVolts
      @NotesAndVolts  3 месяца назад +1

      The mux doesn't matter. The Arduino only ever reads one input at a time. It just does it so fast that it seems like it is reading all the pots at once.

    • @MrCompdan
      @MrCompdan 3 месяца назад

      @@NotesAndVolts Thank you mate! I'm a complete beiginner - realised this a couple days after commenting. Thanks buddy:)

  • @edwinnieuwenhuis1930
    @edwinnieuwenhuis1930 Год назад +1

    can you make this with a pro micro atmega 32u4

    • @NotesAndVolts
      @NotesAndVolts  Год назад +1

      You can, but the program I use for this example uses direct port mapping to speed up the mux pin changes. This works on the Uno/Nano but might need to be modified for other models.

    • @edwinnieuwenhuis1930
      @edwinnieuwenhuis1930 Год назад +1

      @@NotesAndVolts can you write the code for midiusb please

    • @edwinnieuwenhuis1930
      @edwinnieuwenhuis1930 Год назад

      @@NotesAndVolts but can you White the program voor midiusb please

    • @kaki33a
      @kaki33a Год назад +1

      @@edwinnieuwenhuis1930 I asked Chat GPT and he wrote me the code, but it needs to be corrected :))

  • @skrie
    @skrie 3 месяца назад

    I've done the math as you taught it (but for 50K pots), and I ended with a total of 781.2 Ohm of resistance (for 64x 50K pots) , which would result in a total current draw of 0.0064A.
    But... did I do the calculations right? I got no one around me to ask. (I couldn't find the 100K faders I liked. But there's nice 50K faders on Alie-express)

    • @NotesAndVolts
      @NotesAndVolts  2 месяца назад +1

      Your calculation is correct at 6.4mA of current. 50K pots will work fine.

    • @skrie
      @skrie 2 месяца назад

      @@NotesAndVolts Thank you so much.

  • @Goo2869
    @Goo2869 11 дней назад

    64 pots 1 cup

  • @smert_okupantam
    @smert_okupantam 2 месяца назад

    2:12 WRONG! Arduino Nano has 8 analog input pins.

  • @reverend11-dmeow89
    @reverend11-dmeow89 2 месяца назад

    Are any of the "dual axis rotary encoders" my search patterns have managed to generate for me on some of the sales sites actually real?
    64 of these from Alpine Alps is going to run me almo0st a thousand bucks from Digikey or Mouser, but maybe that is just the reality I dove into.
    64 pots is not far behind for long-lasting ones.
    it is for a matrix mixer project, thanks
    I am thinking 1/10th of that budget into a redesign using touch screen may be the ticket out, but (conjuring the "I Like Turtles" kid.
    "I LIKE FONDLING KNOBS" ;0

    • @NotesAndVolts
      @NotesAndVolts  2 месяца назад

      This won't work with rotary encoders, only potentiometers. And you shouldn't be paying more than $64 for 64 pots! You can get them cheaper.

  • @davidh1187
    @davidh1187 Год назад +3

    Problem - if all pots are set to minimum you get almost a short and will likely blow the Arduino. Solution - 1 x 270ohm Resistor in series to ensure no more than 20mA flows regardless of pot settings.

    • @NotesAndVolts
      @NotesAndVolts  Год назад +4

      Sorry this is not true. The wipers of the pots are connected to the Arduinos analog inputs which have a high resistance. They will never be grounded.

  • @andrejladislavsmith
    @andrejladislavsmith Год назад

    17:50 there is a better way to create 64 potentiometer array...

  • @DanTechGA
    @DanTechGA 4 месяца назад

    I could use your help! I entered this code into the IDE and keep getting an error message. Any Idea?
    ERROR:
    error: 'MP01' was not declared in this scope
    Pot *MUXPOTS[] {&MP01, &MP02, &MP03, &MP04, &MP05, &MP06, &MP07, &MP08, &MP09, &MP010, &MP011, &MP012, &MP013, &MP014, &MP015, &MP016, &MP017, &MP018, &MP019, &MP020, &MP021, &MP022, &MP023,&MP024, &MP025, &MP026, &MP027, &MP028, &MP029, &MP030, &MP031, &MP032, &MP033, &MP034, &MP035, &MP036, &MP037, &MP038, &MP039, &MP040, &MP041, &MP042, &MP043, &MP044, &MP045, &MP046, &MP047, &MP048, &MP049, &MP050, &MP051, &MP052, &MP053, &MP054, &MP055, &MP056, &MP057, &MP058, &MP059, &MP060, &MP061, &MP062, &MP063, &MP064
    ^~~~
    This something about a suggested alternative. Any help would be appreciated greatly!