Тёмный

Ep.54 Analog Input Multiplexing with the 74HC4051 - 8 Sensors on 1 Pin 

EEEnthusiast
Подписаться 41 тыс.
Просмотров 156 тыс.
50% 1

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

 

11 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 197   
@tbyers31
@tbyers31 8 лет назад
This is very well done and super clear. The application I have experimented with that led me to your video is creating a multi-cell battery discharge tester. I would like to use the multiple analog inputs measure the voltages of a number of 18650 lithium cells (recycled from a laptop, e.g.) under load over time, all at once. The challenge with these old cells for ebike and electric vehicles is getting batteries of equal capacity. There are easy ways to measure the capacity of single cells but not many cells at once. A multiplexer solution would allow testing of the many cells needed in a shorter time frame. Thanks for the excellent video.
@okachobi
@okachobi 6 лет назад
Thank you for this video. The datasheet wasn't so clear for amateurs and this tutorial really helps.
@Ghost572
@Ghost572 4 года назад
This is a really good example of usage of a multiplexer. A lot of times when this is introduced its just introduced vaguely as "here is a multiplexer it has select lines and one output" instead of being given different applications like using it for driving LCD monitors, having multiple sensors etc. You can really appreciate the multiplexer in combination with microcontrollers.
@udithkumarv734
@udithkumarv734 4 года назад
"For whatever reason you have 20 potentiometers and you have to read them." exactly what i want it for😂😂
@melcrose
@melcrose 4 года назад
Only 20?
@udithkumarv734
@udithkumarv734 4 года назад
@Janna for making a glove which reads movement based on potentiometer readings
@KrotowX
@KrotowX 3 месяца назад
In my case there are output of 6 current sensors and diagnostic signals. But idea behind how to read them remains the same as guy in video explained..
@AlbertSvensson
@AlbertSvensson 2 года назад
Thank you, thank you, thank you. Finally got my project working. Just want to read one potentiometer at a time.
@klausnielsen1537
@klausnielsen1537 3 года назад
I know this is not what you do anymore and that you are somewhere else on your path But daym!! You have the best walkthrough-how to-show and tell videos out there for someone learning this stuff. I wish I had found your channel years ago M8 🙂. Btw: Usecase. Monitoring a plethora of temperature and pressure sensors in a air to water heat pump system.
@SolisPLC
@SolisPLC 3 года назад
Hey Klaus, thank you for the comment. I've actually started a new channel that's more in line with what I do now: industrial automation. I guess all those years spent in embedded systems paid off. Really appreciate the kind comments.
@robertosonzogni
@robertosonzogni 6 лет назад
I've watched several tutorials on this argument, none worked (at least for me) except this. Thank you.
@yorke1467
@yorke1467 Год назад
man, you just saved me I was about to give up figuring this out
@Impulse_Photography
@Impulse_Photography 10 месяцев назад
I could see where I could use this to control a relay board - each relay controls a high power motor or other device. Also, to control camera by selecting one camera at a time - but you can use many cameras around your property with only one Screen output. Love this video !!
@Sohave
@Sohave Год назад
Great stuff for an Arduino beginner such as me. I plan to use Multiplexing for a project where I want to re create a track control panel for a model railroad.
@vladstrulev
@vladstrulev 4 года назад
Vlad . Absolutely great lesson. Thank you very much for your time and knowledge sharing. Very appreciated.
@vladstrulev
@vladstrulev 8 лет назад
Thank you very much Vlad. Very nice tutorial and very nice explanation as always. Love your tutorials. Please make them coming.
@BenStoneking
@BenStoneking 7 лет назад
Excellent tutorial! Thank you for a perfectly clear explanation!
@tr3kn3rd
@tr3kn3rd 8 лет назад
Nice! Comes in really useful when you want to measure slower signals. From looking at the datasheet, the atmega328p can sample 15000 times per second at max 10 bit ADC resolution which can measure 1 x 7.5 KHz signal (good old Nyquist...should apparently sample slower than this to avoid aliasing but whatever.). Using your setup you can now instead measure 2 x 3.75 kHz signals, 3 x 2.5 KHz signals etc using only one pin! I would use this setup for a temperature measurement systems where you want to map the temperature at hundreds of different locations, for example to find where the heat is distributed in my apartment and find out where the heat is leaking out in winter :)
@EEEnthusiast
@EEEnthusiast 8 лет назад
+Michael Segev very good point mike! I haven't really gone through the drawbacks of this setup, but you can't have "everything". This would be adequate for 90% of analog applications; not for high speed ones.
@vladstrulev
@vladstrulev 5 лет назад
Thank you Vlad. Fantastic tutorial as always.
@Dr4wfox
@Dr4wfox 3 месяца назад
Thank you, I was trying to figure out why my multiplexers werent working. I didnt knew that pins 6 and 7 had to be grounded
@SimplySteel
@SimplySteel 7 лет назад
This is bloody good especially for a beginner as me
@pcantele
@pcantele Год назад
I was thinking of using this as part of an eight channel radio control transmitter. It should be easy enough.
@logancoats
@logancoats 3 года назад
tone step closer to my electronic drums! thanks alot!
@Enigma758
@Enigma758 3 года назад
If you use this for analog outputs, won't you run into problems since the output signal will float when it's not being selected?
@SolisPLC
@SolisPLC 3 года назад
Sure, but you can mitigate for that in software. In other words, only read the input when a selection is made.
@Enigma758
@Enigma758 3 года назад
@@SolisPLC Since he mentioned it near the end of his video, I was referring to using it for analog outputs, not inputs. If you're driving the analog device, you're only driving it momentarily.
@jj74qformerlyjailbreak3
@jj74qformerlyjailbreak3 8 месяцев назад
You earned a new Sub today.
@BilgeKaanAtay
@BilgeKaanAtay 8 лет назад
It's looks like Sam Tyrell knows about electronics.
@mysporelo
@mysporelo 7 лет назад
Bilge Kaan Atay all the readings were for something!
@av03
@av03 6 лет назад
do you mean Samwell Tarly?
@happyhippr
@happyhippr 7 лет назад
awesome video, great explanation of the concept
@jvictorpower
@jvictorpower 8 лет назад
This video help so much, man! Thanks a lot!
@itscrawford
@itscrawford 4 года назад
thanks! I really appreciate the in depth explaination in this video. Do you have a video which involves multiple multiplexers?
@PhotonCommander
@PhotonCommander 3 года назад
Bro wonderful. Thank you so much for this video.
@educationaltechnology8363
@educationaltechnology8363 2 года назад
very informative keep it up .me as a beginner I see a solution looking for a problem😆 I wish if you could make more examples of where to use such a chip thanks
@rimmersbryggeri
@rimmersbryggeri 6 лет назад
I was wondering. Can you use many resistive inputs on an arduino pin like for example for controlling the indicator function including left right and hazards on a vehicle?
@DancingTakosMonkey
@DancingTakosMonkey 4 года назад
just what i needed, very cool
@barbasbandas6665
@barbasbandas6665 6 лет назад
If you are using push buttons you could also tie one side of each button to ground with a different value resistor. That way each button will have a different analog read value so you can diferenciate them. And only uses one pin
@lilolail1582
@lilolail1582 2 года назад
Thanks a lot...really informative video
@Doile911
@Doile911 5 лет назад
Can you chain link more 8 channel multiplexers, or would you need a 16 channel multiplexer?
@nikanetique
@nikanetique 4 года назад
Exactly what i'm looking for. Tnx man!
@djberg3483
@djberg3483 5 лет назад
Great stuff, this just took me from 2 megas down to one, with a bit more PCB work. Next step for me is to figure out how to read 0-120v via an analog pin, once I can do that my project will be a go.
@CaddyBlue
@CaddyBlue 5 лет назад
I believe a normal voltage divider would suffice if you are only measuring the voltage (The power draw is basically voidable). With 2 resistors, 120v to 5 volt would be divided with 1 resistor being 24 times higher than the 2nd ( 120 / 5 = 24 ). Using www.ohmslawcalculator.com/voltage-divider-calculator 2 resistors with values 27 Ohm ( Closest to 24 and under 5v ) and 1 Ohm would give a reference voltage of 4.286V between the 2 resistors. This output would be linear to the input!
@tomevans1481
@tomevans1481 8 лет назад
I'm still learning Arduino programming and need to display the voltage in the serial monitor.
@haddow777
@haddow777 3 года назад
I see a number of pins are used to address which input is being read at which time. I am looking into a project that may need many analog inputs (basically 10+ temp sensors). Obviously the way this system works won't scale well as more and more pins will be consumed to specify input addresses. I was thinking that combining multiplexers with shift registers, where the shift registers will specify which analog address you are wanting to read would massively reduce the number of pins needed. What are your thoughts on this? I was hoping to avoid having to use multiple controllers having to talk to each other to get a bunch more analog inputs.
@chbonnici
@chbonnici 2 года назад
I wander if you can tell me how can you make this counter to count 0 to 15 with 15 dip switches . Let say dip switch 1 dual led shows 01 then add dip switch 2 and show 02 and so on. Every time add on dip switch so to read 15 all 15 dip switches must be on. Please help.
@jagannathkulkarni
@jagannathkulkarni Год назад
Thanks for this interesting tutorial. If you please I just want to know what happens if two or more buttons are pressed simultaneously ? does it still reads the values or not ??
@christinewurth5485
@christinewurth5485 6 лет назад
Great tutorial! Thanks so much! I have used the 74HC595N before for a series of digital outputs. With limited understanding of how they actually work. :D For a new project a need to read a series of analog inputs (where the 74HC4051 might come in handy). And also control a series of analog outputs (or digital with PWM). I am still struggling with the difference between mulitplexers like this and shift registers. How specific is their use? Could I use another one instead? Could I use this one for analog outputs, too? Or could I just the 74HC595N I already have for this job? Would be super greatful for any hints. THANKS!!!!
@pranjalverma4154
@pranjalverma4154 5 лет назад
i have the same question. did you manage to use the 74HC595 in the end?
@kingshahzad78
@kingshahzad78 5 лет назад
Hats off to your logic. Working perfectly but spent the whole day but did not understand " digitalWrite(pin_Out_S2, HIGH && (i & B00000100));"
@kingshahzad78
@kingshahzad78 4 года назад
@@jumbo999614 hahahahaha
@adamlauz
@adamlauz 3 года назад
you look at "i" in binary form. for example if i=5 in the loop then it will be: [1]*2^2 + [0]*2^1 + [1]*2^0 which is represented as 101 or B00000101 in binary. So the goal is to activate the 6th (0..7) analoug in order to get it's value and the way to do it is by sending the S0,S1,S2=HIGH,0,HIGH to the multiplexer. The code resolves the logical statements: 1) B00000101 & B00000001 = B00000001, 2) B00000101 & B00000010 = B00000000, 3) B00000101 & B00000101 & B00000100 = B00000100. HIGH is actually the boolean True (or integer other than zero) and LOW is the boolean False (or zero) so HIGH && B00000001 is actually HIGH\True\"Integer other than zero" and HIGH && B00000000 is LOW\False\zero
@beaconofwierd1883
@beaconofwierd1883 6 лет назад
I have a similar-ish setup, but I try to read really fast (38 KHz) and I’ve run into the problem that when I switch the input the first three to 8 readings (depenging on the impedance, using an impedence) becomes inaccurate (High spikes when switching). The strange thing is that it’s the first three readings no matter the read speed (9kHz up to 64 kHz) so I find it hard to believe that it’s the adc which needs time for charges to settle (since then it would take a fixed amount of time, not reads). Do you have any ideas what’s going on here?
@rickd.3112
@rickd.3112 5 лет назад
Very interesting, TKS! Is there a way to do the same for digital input/output as well?
@dmytroprystupa4114
@dmytroprystupa4114 2 года назад
Hey I was wondering if this sort of setup works with a differential signal like CAN signals?
@ClaytonAllenFP
@ClaytonAllenFP 8 лет назад
Very cool explanation. You mentioned flow in terms of sensing and analog input. So if I had an array of flow sensors how would this count each pulse and increment a flow value?
@EEEnthusiast
@EEEnthusiast 8 лет назад
+Clayton Allen If you have an array of analog sensors, you would get a reading from each one of them into the array. After that, you can use any of the values stored there for any purpose in your program.
@PAK_MARINE
@PAK_MARINE 6 лет назад
Sir I want 8 analog input and 8 digital output with this IC 74HC4051N or have some others IC
@msunrl8577
@msunrl8577 2 года назад
dude thank you!
@justgotravel6646
@justgotravel6646 4 года назад
With multible 16 channel multiplexer what is the maximum input (ie. Buttons) you can get on a audino board? Also do you need to consider extra power sources?
@themouseisinthehouse
@themouseisinthehouse 5 лет назад
nice clear tutorial! would there be any electrical implications if I use two back to back to achieve routing from multiple inputs to multiple output? like increase in resistance, a decrease in the signals amplitude or maybe a delay?
@lowrezable
@lowrezable 6 лет назад
REALLY GREAT !!! I'm building a controller for audio mixing...
@aleemuddinkhan1813
@aleemuddinkhan1813 3 года назад
Dear you shared an excellent approach can you please shored how we can use audio sensors to trigger any an event in Arduino ...........
@hayder.ismael
@hayder.ismael 3 года назад
Thank you for this video, it is really helpful. Just a question, can I see the value of analogue inputs at the same time, for example, if I press two bottoms simultaneously, will i see two values in the array?
@Oshroth
@Oshroth 2 года назад
Yes, each loop the code cycles through all 8 addresses in the multiplexer and grabs the current value so at the end/beginning of the loop you have an array with all of the values, so you will see a value for every button/input in the array
@stargazzn
@stargazzn 8 лет назад
I have a real world use for this circuit. I have about 15 strawberry planters that will freeze this winter on my balcony if I don't do something. Bringing them inside is not a good option. I want to measure the temp of all my planters with an LM35 and I want to use some resistors to give them just enough heat so as not to freeze. It will get down to -10'F. So if I can use perhaps 5 watts worth of 1/2 watt resistors and keep the temp to about 37'F. I should be okay. In summary I need to Mux 15 Analog inputs and 15 digital outputs to the tune of perhaps 5 watts.
@bilalnuru2959
@bilalnuru2959 4 года назад
Hey can i use the 4052 multiplexer ic instead of 4051? With this same code and connection please i need help i cant find the 4051 ic here
@raymccoy9105
@raymccoy9105 4 года назад
4052 has two banks of four inputs going to two output pins. (Or vice versa since the ins and outs are bidirectional.) You could read 8 values using two analog pins on the mC but that would require some wiring and code changes. While you would need two analog pins for input, it would require only two output pins for channel selection.
@haiaokuwa
@haiaokuwa 5 лет назад
Thanks for this. Very nice
@GapRecordingsNamibia
@GapRecordingsNamibia 4 года назад
Good day, I came across your video, and thank you for the information, I am new to Arduino had done one or two projects but mostly learn as I go. I would like to ask if it is possible that you could explain how the binary bit of the code works, I understand the incrementale part of the binary sets, what I am wondering is how are you writing the correct addresses for each input? Are you just cycling through the bits and the chip only responds to the correct addresses or is there another thing going on that the addressing is precise? I hope this makes sense? Kind regards.
@vladorlovsky6623
@vladorlovsky6623 7 лет назад
What happens when you push multiple buttons at the same time? Do you get a reading on multiple channels or just one?(whichever button was pushed first, last, etc)
@myinfo7114
@myinfo7114 5 лет назад
There is a new approach in science for reading an unlimited number of sensors in parallel. It is called the photon-pixel coupling method. Maybe you can do it with an Arduino.
@danielcorley3013
@danielcorley3013 8 лет назад
awesome job!...do you know of a way to use an arduino mega as a game controller? I didn't know enough and bought one not realizing they're not preprogrammed to emulate a controller like the teensy or the leonardo.
@cristiandarvich2713
@cristiandarvich2713 7 лет назад
It's possible to multiplexing a multiplexor?? I'm serching for the cheapest way to digitalice 577 analog inputs of LDR for a musical proyect. Thanks!
@mplenter9051
@mplenter9051 7 лет назад
could you explain me how works the following piece of code? High && ( i & B00000001)
@adrianstefanescu3535
@adrianstefanescu3535 7 лет назад
The answer to this would be helpful :). I'd subscribe for this answer :))
@doubleHLabs
@doubleHLabs 7 лет назад
this tells the 74HC4051 which channel you want to listen to. In this example its channel 1. Then the 74HC4051 sends the value for channel 1 to the arduino
@adamlauz
@adamlauz 3 года назад
you look at "i" in binary form. for example if i=5 in the loop then it will be: [1]*2^2 + [0]*2^1 + [1]*2^0 which is represented as 101 or B00000101 in binary. So the goal is to activate the 6th (0..7) analoug in order to get it's value and the way to do it is by sending the S0,S1,S2=HIGH,0,HIGH to the multiplexer. The code resolves the logical statements: 1) B00000101 & B00000001 = B00000001, 2) B00000101 & B00000010 = B00000000, 3) B00000101 & B00000101 & B00000100 = B00000100. HIGH is actually the boolean True (or integer other than zero) and LOW is the boolean False (or zero) so HIGH && B00000001 is actually HIGH\True\"Integer other than zero" and HIGH && B00000000 is LOW\False\zero
@sanjaybatra6593
@sanjaybatra6593 Год назад
how much minimum voltage can be read ? what is the resistance between input and output ( e.g Z and y0). why I asking this is as I want to interface multiple sensor to be read.
@gabrielhimelfarb5962
@gabrielhimelfarb5962 4 года назад
Just a quick question: I want to use the multiplexed for several moisture sensors, if I understand, the moisture sensors should be connected to the Y0-Y7, while S0-S3 to a digital pin each, Z to an Analog pin, and VCC to 5V pin?
@startobytes
@startobytes 4 года назад
yes, I guess so
@abdurrahmanumar8925
@abdurrahmanumar8925 7 лет назад
i tried the mulplexing using your codes on the same Arduiuno, the codes seem like your but it keeps bringing error can I have your help?
@subhadipghorui2216
@subhadipghorui2216 6 лет назад
can i read the value indivisuali from each pin ? i want to use multiple analog sensor but i have only 1 analoginput (Nodemcu esp8266).....want to extend ......................so thanks alot . can u make another tutorial on above topic ..............BIG HELLP if you do.
@Uniquelife_17
@Uniquelife_17 6 лет назад
very nice
@cristianchuquitarco3794
@cristianchuquitarco3794 3 года назад
It works if I connect two analog sensors to the same analog pin ?, excellent video
@johnadrianinfante7990
@johnadrianinfante7990 6 лет назад
SIr, what type of multiplexing does this project use FDM, WDM or TDM?
@itsgoubie
@itsgoubie 6 лет назад
i did something wrong because my pins never read 0 even with a pulldown/up resistor. my wiring is probably wrong, i'll redo it. as to functionality and/or code, all working great. thank you!
@CharlieGuitar87
@CharlieGuitar87 6 лет назад
Hello, I am looking to use an Arduino and a 74HC4051 to make the Switch of an RGB Scart between 8 Scart Inputs and 1 Scart output. Can you guide me on how to do this?
@maxr382
@maxr382 3 года назад
I am building a ckt to read and report various states (24VAC or 0) in a heat pump to an esp8266. Interesting chip. I am going to see what it's max input is. Maybe I can just rectify the single out to the esp.
@beee0330
@beee0330 6 лет назад
If i press all buttons at once (or even more buttons, lets say 50 buttons) will the arduino read them all correctly or there will be some kind of error?
@RoyAndrews82
@RoyAndrews82 6 лет назад
I need to read 13 LDR values. Can I do that with this?
@francoisdastardly4405
@francoisdastardly4405 4 года назад
Yes. You need another resistor for build a voltage divider with each one LDR.
@vijaybaleja6220
@vijaybaleja6220 4 года назад
great software
@tomevans1481
@tomevans1481 8 лет назад
Nice tutorial. Would you have a source for the breadboard pots? Thanks!
@cristiananastasoaie9798
@cristiananastasoaie9798 6 лет назад
nice video,is possible to put a pot were you have the swiches?
@factormarketing5652
@factormarketing5652 4 года назад
Thanks , It’s useful information :P
@bryghtfuture
@bryghtfuture 2 года назад
Hi, nice project and smooth presentation. Not sure you're still monitoring the comments on this video, but I try it anyway 🙂 What happens if you press 2 , 3, 4 buttons at the same time? if this works, what would be the maximum voltage you can receive? Thanks in advance for your answer
@SolisPLC
@SolisPLC 2 года назад
Hi Alexandre, it's me - Vlad! I'm onto a different channel that involved industrial automation instead of the hobbyist stuff I used to do. Pressing multiple buttons works, the drawback of this implementation is latency. In other words, you only read one sensor at a time, but you read them in sequence. So it's slower, but only uses a single pin on the Arduino. The voltage is 5VDC based on the Arduino, but I'm sure you can scale that if necessary.
@bryghtfuture
@bryghtfuture 2 года назад
@@SolisPLC Hi, thank you for your answer, I'll have a look at your other channel. I found some videos where the guys use registers shift modules, which allow for interesting multiplexing functions (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-nXl4fb_LbcI.html from Kevin Darrah). In my project, I'm looking for a solution to read the multiple voltages of a battery pack made of several 18650 cells. The challenge is to stay below that 5V limit.
@fahadnadeem6130
@fahadnadeem6130 3 года назад
I need to multiplex and demultiplex, positive and negative voltages, so can I use cd74hc4067 for this purpose
@jumbo999614
@jumbo999614 4 года назад
If you have both analog and digital sensors, then It's better to use analogRead() than digitalRead() because it covers both analog & digital right?
@BRINDEOFUTURO
@BRINDEOFUTURO 8 лет назад
Hello! How do I use two or three interconnected multiplexer, totaling 28 or 42 channels? Thanks in advance.
@EEEnthusiast
@EEEnthusiast 8 лет назад
You would need to connect the output of the mux to the input of another. This would split one of your mux inputs into 8.
@BRINDEOFUTURO
@BRINDEOFUTURO 8 лет назад
Ok. Thank you.
@nishitmistry2399
@nishitmistry2399 8 лет назад
And what about the code for that if i want to create any case for any particulate pin input ?
@SteveF153
@SteveF153 7 лет назад
I would be interested to see how to expand this, as well. Did you follow up on this?
@BenStoneking
@BenStoneking 7 лет назад
NISHIT MISTRY this would be a very interesting and potentially confusing block of code, I would imagine. Do you think it would require nesting multiple "for" loops to read the pins within series of mux?
@mikg2618
@mikg2618 4 года назад
Same MUX used on Akai Apc40 and my master fader is not working (only one). Try to find why is it so, cause a numbers of pots are connected to same mux that fader attached to..
@satrah101
@satrah101 7 лет назад
hi all. new to this. can i ask if this will be better for back ground noise or worse. and if its one pin will this work on atTiny 8 pin. Thanks in advance, great vid,
@alirezamoghaddam7389
@alirezamoghaddam7389 5 лет назад
hi nice tutorial is it possible to read analog values and put them seprately in a variable for uploading it to a iot cloud i am asking it for nodemcu cause it have just one analog pin
@grantwallen5246
@grantwallen5246 8 лет назад
I'm a new comer to arduino and I need a shield to help control 4 different items with various power for each. I need to supply 10W to a pair of speakers each needing 5W and another 6W to another set of speakers each needing 3W. I also need about 2.3V for my VU meter by Great Scott with just a little more power for my lcd screen by arduino. I'm also including TDA7492P 25W+25W Wireless Bluetooth 4.0 Audio Receiver Digital Amplifier Board. So I'd like to add this features together with 2 analog inputs and 3 digital for on and off of whole system, switching from radio to Bluetooth, and one to vary the on and off of the VU meter
@joashnaidoo8644
@joashnaidoo8644 6 лет назад
You cannot keep adding more sensors indefinitely. As you increase the sensor you increase the selector pins, which is basically your constraint on how many pins your micro-controller as. Just a side note there and to correct you.
@EEEnthusiast
@EEEnthusiast 6 лет назад
Although that is true, you can always multiplex those as well or use an I2C selector IC to toggle those inputs that way. Nothing is ever "infinite" and you will run into power issues, communication issues as well as timing issues as you increase the number of sensors. That being said, you can definitely make it work if you take care of those problems.
@firdadwisundari6104
@firdadwisundari6104 6 лет назад
how about reading 9 analog sensors if the 3 of them are voltage divider and the rest are acs712? as i know the voltage divider and acs712 have different codes in callibration? sorry, i'm just a beginner
@charnjit525
@charnjit525 4 года назад
If I want very fast response ,what is time between reading analog input pin of ...4067 and result happening?? In milliseconds???
@raymccoy9105
@raymccoy9105 4 года назад
With an Arduino Nano and a 4051 chip I was able to get 42 to 44 reads between 1ms interrupts. I had concerns about a potential error rate and dropped that back significantly for the final code.
@johngonsalves5268
@johngonsalves5268 7 лет назад
Nice job. Thank you kindly for upload. What happens when more than one button is pushed at a time?
@skrie
@skrie 6 лет назад
Answer this damn question OP.
@TheMetalMusicMachine
@TheMetalMusicMachine 8 лет назад
I was thinking in using an arduino with multiplexed pots and switches, but I'm not sure if this boards tracks quickly enough or if it can take several control signals simultaneously without going crazy or mistracking sliders or pots, or jumping around values... Is it powerful enough to handle at least 16 muxed analog inputs, and 16 digital signals? :/
@EEEnthusiast
@EEEnthusiast 8 лет назад
It is hard to answer the question without knowing what you will do with those signals. Obviously, the more inputs you have, the longer it will take the process. That being said, it's all about you application. You can be dimming lights with those pots and I can assure you that it will be fast enough. However, if you are trying to create a control system for a quadcopter for example, it may not be the optimal way. I'd say that you would need to try it to know for sure.
@TheMetalMusicMachine
@TheMetalMusicMachine 8 лет назад
Hehehe, nothing too complicated. I need to convert each analog signal into MIDI and those digital signals as switches. Every analog input should be downsampled from 1024 to 128 values and assign each of those signals to a CC value, which is a ID for each controller...
@GospodinJean
@GospodinJean 6 лет назад
Thanks a lot!
@kckc9245
@kckc9245 3 года назад
Nice .. 👍😎 How can i use this with 74HC595 ... With 16x outputs LEDs ... 16 Switchs... 16x input and 16x outputs. How can i turn off and on each Led ... I have 2 x. 74HC595. With 16x Running leds and 10x different FX. Can i use this to control each FX ? And Each LED.. ? Thank you.. In Advance..
@Skandawin78
@Skandawin78 7 лет назад
I'm not clear about how ur updateMux1 function works. for ex if I = 4 in the for loop, will S0 be set to 4 00000001 S1 -> 4 00000010 and S2 -> 4 00000100 sorry I'm a newbie and desperately want to know how multiplexer works with this code. can u pls explain?
@ЗахарСушко-э5й
@ЗахарСушко-э5й 7 лет назад
if the i = 4, in binary system it means, that i = B0000100 ( big letter B - means binary system), and when you doing this operation: 4 & B00000001 - it means you doing this operation: B0000100 & B00000001 and you get the answer: B0000101, that in decimal system = 5 - the 5th input in MUX. Read more about binary system and binary operations - it help you to understand more. I hope you'll undertand my answer, as you can see, my English level is not so good.
@wojciechrakszawski8935
@wojciechrakszawski8935 6 лет назад
Here it looks rather more like: 4 & B00000001 -> B0000100 & B00000001 -> B0000000 Mostly because '&' function leaves "1" only on bits where there was "1" in both numbers That way you get coding demanded by multiplexer like: S0 is 2^0 (so 0 or 1), S1 is 2^2 (so 0 or 2), and S3 is 2^2 (so 0 or 4) With that if you whant to get e.g. input 5 those operations will set S0 high, S1 low, and S2 high Hope it helps to understand
@XDCARLOS16XD
@XDCARLOS16XD 6 лет назад
Can i connect three 74hc4051 ic's inputs in parallel?. Or what can i do if i want to use more than 1 multiplexer?. Because i've 24 analog inputs, and i only have these ics.
@raymccoy9105
@raymccoy9105 4 года назад
Just did this. Drive the select pins on multiple 4051s from the same output pins then attach the output from each to separate analog inputs. For each increment of your select pins (0-7) read one channel from each of the multiplexer outputs. With 8 analog inputs on a Nano, I see no reason not to be able to read 64 analog inputs using the same methodology. Be sure to consider pull down resistors on the select pins. After several trial and error attempts, ended up with 330K resistors to pull the pin low yet still allow the pin do drive the select pins effectively.
@alexc7095
@alexc7095 5 лет назад
hello, great video,very inspiring, ...it gave me an idea. how can i control 8 Fotorezistors and log the lighting conditions over from each individual Fotorezistor(placed in different areas) using just arduino or just one raspberry pi ? basicaly i want to place 8 sensors around a small room and log the light intensity throughout a day. i'm thinking that neither arduino or raspberry pi has enough gpio pins... please help me understand how i could log data from 8 Fotorezistors at the same time placed in different areas.
@conquer-ai
@conquer-ai 8 лет назад
i am going to read 4 sensor analog values into pin A0 for web interface its should read 4 analog sensor values one after another ......i need know what's the method for this and what are the changes i need to make in Coding
@nishitmistry2399
@nishitmistry2399 8 лет назад
What if i want to press more than 1 button at the same time ? is there any code for that?
@santiagol365
@santiagol365 7 лет назад
Can this read multiple analog inputs at the same time? (Like for example pressing two buttons at once and reading both of those values at the same time)
@itsgoubie
@itsgoubie 6 лет назад
Santiago the Great I'm thinking yes, but not simultaneously. It has to cycle through the selection and it will send the data regarding the selected input, but it does that very fast, so it's almost like a simultaneous input
@chadmckean9026
@chadmckean9026 3 месяца назад
2:14 if you have pins 6,7,8 on ground why does the table show pin 7 as supply voltage
@TheDradge
@TheDradge 5 лет назад
Good video but you don't press buttons and/or the potentiometer at the same time to show that it really is reading multiple values at the same time. Would be more impressive to do that.
@ehonning
@ehonning 8 лет назад
Very nice. I am going to use this to put 54 thermistor into a beehive. I have bought 5x 12channel breakout, but after watching your video I wonder. Can i use 1 pin, connect to a 74HC4051 that connect to 8 74HC4051, that then each have 8 termisistor? I like to only use 1 pin on arduino :)
@EEEnthusiast
@EEEnthusiast 8 лет назад
+ehonning You could do that, but keep in mind that you will need to toggle the channels of each of those ICs, so you would also need to come up with a circuit for that. Shift registers or digital multiplexers could be an option.
Далее
Arduino MIDI Controller: Part 3 - Multiplexers
20:09
Просмотров 198 тыс.
Oops 😅
00:10
Просмотров 6 млн
КУШАТЬ ХОЧЕШЬ? #дистори
00:15
Просмотров 142 тыс.
Women's Defending + Men's 😮‍💨❌
00:20
Просмотров 1,6 млн
Why build an entire computer on breadboards?
28:43
Просмотров 3,1 млн
MegaMUX - 32 Channel Multiplexer Board and Tutorial
9:54
Op-Amps  - Using Operational Amplifiers
44:21
Просмотров 288 тыс.
Oops 😅
00:10
Просмотров 6 млн