Without any added delay, how quickly can it cycle through? I know the ADC on the Arduino takes at least a bit of time to read a value, so eventually that has to limit the sampling rate you can do with lots of sensors, right?
Yes, there will be a delay, anything requiring synchronous readings won't work well with this. Not sure what the actual sampling rate limit would be, but it would be different for different mCUs depending on how their ADC works.
If you separate the 16 values with a comma on one line the serial plotter will draw each value with a different line, hope this helps :) Great video really useful
Could just split it in half - 3 pins for addressing, 4 pins for data. 3^2 == 8, and 8*4 == 32. That way in 1 cycle you could read/write from/to 4 pins at once. The I/O pins are just registers anyway so you wire it up right and it's literally just like using variables. (you'd need 1 shift but that's about it).
If you want to reduce the pin load even more then sure! You could use a smaller MCu! But if you have the pins available, its less complicated to do it the way I showed.
This is more that I haven't tried it... with multiple of these chips can the CS and EN pins be shared to common pins on the microprocessor? I am looking at a project that would need 3 of these chips and if I can regain 4 pins that is awesome.
Really cool! I'm pretty sure you could simplify your pinSelect a bit by just writing pinnum to a given IO register, then hook up the mux to said register. It would be a whole lot faster, not only because it wouldn't require a for loop, but would not use digitalWrite() which is slow.
No, I mean you can connect the mux to pins 0 through 4, then replace pinSelect(i); with PORTD = i; or connect from 9 to 13 and use PORTB. (www.arduino.cc/en/Reference/PortManipulation)
I want to control 128 relays (12 volt). I am thinking about connecting 8 of the "16CH Analog Digital Multiplexer Breakout Board Module CD74HC4067" all to one Arduino Mega. Do you think this would work? Would it max out the processor? What did you use as a control board for your 500 LED project?
I'm curious what kinds of errors a MUX like this creates. I've been meaning to look into the characteristics of different MUX devices and technologies for creating variable analogue feedback networks. I haven't come across these types of practical details about multiplexers and demultiplexer circuits. Most video tutorials and demonstrations I have found while searching do not go into the nitty gritty details of practical analogue applications for these devices. I don't imagine you want to upload a long grinding video about device characterization, but perhaps you could mention why you chose this chip as it relates to an error budget, linearity, and accuracy/precision. At least that is something I would find helpful. Just as a couple of quick and easy potential ideas, something as simple as a channel to channel comparison of readings connected to a shunt reference voltage rail would show the practical variables in a simple dirty circuit, or you could show the linearity if you added a single value precision resistor between each channel to create a 31 step digital potentiometer...just ideas Thanks for the upload, and for the chip reference. It's worth adding to my notes playlist for future reference ;) -Jake
There are some excellent ideas there. Most of my projects on the level of "hobby" and not "precision", since they are mostly designed to create something fun, and maybe learn some knowledge along the way. I mainly chose this chip because it will greatly simplify my next project, but I generally don't spend a lot of time searching for components. So if I find something that looks like it will work, I pretty much stop the search there(otherwise I lose too much time). For the future project I need to mux 500 sensors on an upcoming board, so I will be using these in a matrix pattern to measure a voltage from each one, so that is the main reason for selecting this one. I like your idea with experimenting with some precision resistors, it could be fun! I like doing that kind of stuff. Except I'm not great at filming or explaining it in a good way(really technical videos aren't my thing...). I could alway post a google sheets doc or something like that too and just put it in the description. Ill try to get around to it. Thanks for your ideas!
The only drawback to MUX would be caused by too slow of a sampling rate. It's no issue to deal with controlling/watching many things one-at-a-time as long as we are scrolling through them fast enough not to miss any significant changes. Multiplexing has been used on cell phone audio and Nintendo controllers for years. It can get a little screwy to adjust to the world of nanoseconds , but once I did I realized that I was much more concern with the MUX getting bored than it making errors.
How and where can i get a board? I want to control a Minimoog synthesizer with 28 potentiometers and buttons. Now i'm using 2 analog mux, but it doesn't work with the arduino at A0 and A1. The buttons are easy, but the analog not!
hey sean ! i stumbeled across this video in search of a way to modiy an analog 24 channel mixboard to a midi controller , would this chip in combination with an arduino make that idea possible ?
Hi - I have this MegaMUX. I have couple of ADG731. Can I use this MegaMUX with ADG731. I know ADG731 & ADG732 handles input control bits differently. But my question is if this MegaMUX will exactly fit for ADG731 and give me access to all its pins? Also on the MegaMUX PCB there are 2 Capacitors marked as C1 & C2. Which one is 0.1uF and 1uF? Thanks
I think the ADG731 has two outputs right? I think you will only have access to one output with my board. C1 and C2 can be either 0.1 or 1, switching them will not affect the board.
Thanks for your input. Both ADG731 and ADG732 have the same number of pins. I understand your board does connect to all the pins, correct? If so, I can interpret the pins as ADG731.
So the pcb you created is able to connect to more of them serially? How do you go from this video to reading 500 sensors? I ask because I’m trying to do something similar but with IR reflective sensors.
Since this chip has 32 selectable outputs, I attach 32 to one side of the light sensor, and another 32 to the other side of the light sensor(two multiplexer ICs), so that will give you 1024 selectable sensors.
Hi Sean, I am a first time viewer and have subbed due to your easy to follow manner and presentation. I am currently learning about the Aduino and was wondering if this Mux would read 18650 Li-ion battery volage in a 20 bay battery unit I am currently trying to cobble together? Thanks for any advice you can assist with. Mike.
This IC? I got mine from Digikey - www.digikey.ca/product-detail/en/analog-devices-inc/ADG732BSUZ-REEL/ADG732BSUZ-REELCT-ND/4907711 - a little expensive, so you might be able to find it somewhere cheaper. The board can be purchased from PCBWay, if you use this link to order I get 10% of the order I think. bit.ly/2szBXgs or you can download the gerbs if you want to get the board elsewhere.
Hey Sean, I'm new to the glories of multiplexing so this might sound stupid, but could this be used for routing analog signals? Basically, I'm building a eurorack synthesizer (already have the oscillators and midi control done) and I'm trying to digitally control the paths of all the cool patch cables. After I work this part out I'll be able to make some websockets and APIs to control it all :)
For doing a lane select yes! But most of the bigger channel MUX's have a single signal out. Now it goes bidirectional so you could effectively rotate one signal over 32 channels or 32 channels into 1! For what you are describing, I would most certainly suggest using some smaller MUX's but more of them!
Hi, thats a great demo regarding the use of a multiplexer with Arduino. As the inputs are being read sequentially, does this ever cause any problems with the slight delays between readings? Especially when using sensors as inputs to a control system? The reason I ask is that I am currently designing a HVAC controller for my house whereby I am using an Arduino Mega - but the 16 analog inputs are not enough, so I am having to use 2 x 16-way multiplexers on 2 analog input pins. Not tried it yet, but I was wondering if you've ever encountered any issues, and can share your experience on this matter. Hopefully I'm just over thinking it, but due to the nature of project, i want to make sure I have all bases covered!
Random musings yes, there will be some areas of delay, but it will be very small! Basically even using the ADC on 16 different inputs right on the mega is going to have a small offset of time from the first to the last. So if you introduce a multiplexer you will just add a smaller delay between each reading. Typically with something like temperature these delays are not an issue because the rate of temperature change is much much slower than any delay in temperature readings. So even if it took one second between 30 sensors, it’s unlikely that the 30 seconds from the first reading to the last is going to give you any sort of issue. If you were doing some really precisely timed readings for research or critical applications then it would be a different case, but for you there should be no problem.
@@SeanHodgins Cool as I thought, as the majority of my readings will be from PT100 sensors, which are resistance based there the read rate should be faster than the sensor response time. Likewise the media being sensed will be water so shouldn't react too quickly! Thank you for your prompt response! Earned a subscriber here! Great channel btw.
They're decoupling caps so 0.1uF and 1uF on either pad. Size is 0805. Probably could get away with just a single 0.1uF. Nothing mentioned in the Datasheet, so I just put them in as you would for any IC.
Thank you for a great video. I am new to microcontrollers, analog multiplexers, and Arduino. I am trying to replace the classic switches with this new technology. My application is a box with about 20 female 1/4 jacks, where 2 loopers (Boomerang, Boss RC-3), one that has memory but simple, and the other nice 4 tracks but can record the session, are plugged. Also a Volume pedal and a Reverb. So, I made this box where with two switches 4 poles and some other switches I can alter the order of the signal path. So I can place the Boomerang before or after the Boss RC-3, and have the Volume pedal before the Guitar or after the loopers, etc. I was trying to imagine. how to port this analog circuit to a more complete one using multiplexers. With the lack of knowledge on the subject I though that to have all possibilities open for about 20 1/4 jacks of I/O, I would need 20 chips of 20 channels (I know they are made of 4, 8, 16, 32 channels) so that any desired combination could be achieved, I believe must be a better way of thinking this out. Could you just drop me a line or two to put me in the correct direction to research how to achieve my goal? Thank you so much for your time. All the best
Hi. I'd like to use a MUX the other way around : analog to digital. What I'd like is the "Sparkfun Qwiic MP3 Trigger" to play 10 different sounds, triggered by a 10 position rotary switch. This MP3 Trigger comes with 4 triggers pins which play MP3 files named accordingly on the SD card : For example, pulling pins 2 and 4 low at the same time will play track T006.mp3 Hence, in the same example, I need a thing that triggers those 2 pins when triggered itself by the rotary switch 6th position. I think the "SparkFun Analog/Digital MUX Breakout" can do the job. But I can't figure out how to connect those 3 objects together. Rotary Switch 10 positions :arrow: MUX 16-channel :arrow: Qwiic MP3 Trigger :arrow: 10 mp3 files - Does thes MUX need power ? - What are the pins SIG and EN on the MUX ? I'd be really gratefull if someone could help me a bit. Thanks, Victor
Hi Sean. I don't know what's your exact requirements for your project, but maybe this is an alternative which is cheaper, includes an ADC and not requiring any select pin, so less wiring thanks to I2C: tindie.com/products/FERCSA/32-channel-adc-wi2c-for-arduino-and-raspberry-pi/ My goal is here not self promoting, but if you gonna go down on the multiplexer path without I2C you'll need a lot of select pin for 500 sensors, plus the analog ones ofc.
Pretty cool device, thanks for sharing! Unfortunately this would actually be a little more complicated for what I'm going to do(since I'm making my own PCB and all sensors will be surface mount). With the MUX select pins, you can stack multiple multiplexers on the same pins, and the ADC I'm collecting only require two pins, so I will only need two ADG732 ICs for what I'm doing, 32x32 will give me access to 1024 sensors. If I was wiring it by hand I would definitely consider your device.
So the capacitor for C1 is 0.1uF and C2 is 1uF type SMD:C_0805 capacitor.
If you just wrote the adress number to the output register of the Arduino you could replace all the subroutines with a single line of code
You look a very productive Younger, your channel will be between the bigger ones of electronics role in UA-cam.
Without any added delay, how quickly can it cycle through? I know the ADC on the Arduino takes at least a bit of time to read a value, so eventually that has to limit the sampling rate you can do with lots of sensors, right?
Yes, there will be a delay, anything requiring synchronous readings won't work well with this. Not sure what the actual sampling rate limit would be, but it would be different for different mCUs depending on how their ADC works.
If you separate the 16 values with a comma on one line the serial plotter will draw each value with a different line, hope this helps :) Great video really useful
GREAT WORK AND I WANT TO KNOW WHY YOU CONECT THE ANALOG PINS
ANY REASON ?
A small step towards a bigger project!
SeanHodgins love it keep it up
Thanks!
About that link to PCBWay, its not clear what's included. Is it just for the bare pcb, or would the componants be presoldered to the pcb?
Could just split it in half - 3 pins for addressing, 4 pins for data.
3^2 == 8, and 8*4 == 32.
That way in 1 cycle you could read/write from/to 4 pins at once. The I/O pins are just registers anyway so you wire it up right and it's literally just like using variables. (you'd need 1 shift but that's about it).
Would a shift register work for the "pin select" cutting down the arduino pins you use
If you want to reduce the pin load even more then sure! You could use a smaller MCu! But if you have the pins available, its less complicated to do it the way I showed.
This is more that I haven't tried it... with multiple of these chips can the CS and EN pins be shared to common pins on the microprocessor? I am looking at a project that would need 3 of these chips and if I can regain 4 pins that is awesome.
can these be used with toggle switches or will they go open all the time?
Really cool! I'm pretty sure you could simplify your pinSelect a bit by just writing pinnum to a given IO register, then hook up the mux to said register. It would be a whole lot faster, not only because it wouldn't require a for loop, but would not use digitalWrite() which is slow.
Like a shift register? Yeah it would be faster definitely!
No, I mean you can connect the mux to pins 0 through 4, then replace pinSelect(i); with PORTD = i; or connect from 9 to 13 and use PORTB. (www.arduino.cc/en/Reference/PortManipulation)
this needs an update with a shift register for those 8 pins
I want to control 128 relays (12 volt). I am thinking about connecting 8 of the "16CH Analog Digital Multiplexer Breakout Board Module CD74HC4067" all to one Arduino Mega. Do you think this would work? Would it max out the processor? What did you use as a control board for your 500 LED project?
This video is great! I could use this for my project. Thank you very much!
can i use multiplexer to measure voltages of a battery pack connected in series
I'm curious what kinds of errors a MUX like this creates. I've been meaning to look into the characteristics of different MUX devices and technologies for creating variable analogue feedback networks. I haven't come across these types of practical details about multiplexers and demultiplexer circuits. Most video tutorials and demonstrations I have found while searching do not go into the nitty gritty details of practical analogue applications for these devices. I don't imagine you want to upload a long grinding video about device characterization, but perhaps you could mention why you chose this chip as it relates to an error budget, linearity, and accuracy/precision. At least that is something I would find helpful.
Just as a couple of quick and easy potential ideas, something as simple as a channel to channel comparison of readings connected to a shunt reference voltage rail would show the practical variables in a simple dirty circuit, or you could show the linearity if you added a single value precision resistor between each channel to create a 31 step digital potentiometer...just ideas
Thanks for the upload, and for the chip reference. It's worth adding to my notes playlist for future reference ;)
-Jake
There are some excellent ideas there. Most of my projects on the level of "hobby" and not "precision", since they are mostly designed to create something fun, and maybe learn some knowledge along the way. I mainly chose this chip because it will greatly simplify my next project, but I generally don't spend a lot of time searching for components. So if I find something that looks like it will work, I pretty much stop the search there(otherwise I lose too much time). For the future project I need to mux 500 sensors on an upcoming board, so I will be using these in a matrix pattern to measure a voltage from each one, so that is the main reason for selecting this one. I like your idea with experimenting with some precision resistors, it could be fun! I like doing that kind of stuff. Except I'm not great at filming or explaining it in a good way(really technical videos aren't my thing...). I could alway post a google sheets doc or something like that too and just put it in the description. Ill try to get around to it.
Thanks for your ideas!
The only drawback to MUX would be caused by too slow of a sampling rate. It's no issue to deal with controlling/watching many things one-at-a-time as long as we are scrolling through them fast enough not to miss any significant changes. Multiplexing has been used on cell phone audio and Nintendo controllers for years. It can get a little screwy to adjust to the world of nanoseconds , but once I did I realized that I was much more concern with the MUX getting bored than it making errors.
is there a scheme for connecting it to arduino-pro micro? can it be used as analogue inputs for potentiometers?
How and where can i get a board? I want to control a Minimoog synthesizer with 28 potentiometers and buttons. Now i'm using 2 analog mux, but it doesn't work with the arduino at A0 and A1. The buttons are easy, but the analog not!
That's pretty cool!
Bro your videos are very useful
Help with the schematic of the pcb please
Maybe add a 74HC595 shift register to handle all Megamux related controls, ie..chip enable, addressing, etc..??
hey sean ! i stumbeled across this video in search of a way to modiy an analog 24 channel mixboard to a midi controller , would this chip in combination with an arduino make that idea possible ?
Hi - I have this MegaMUX. I have couple of ADG731. Can I use this MegaMUX with ADG731. I know ADG731 & ADG732 handles input control bits differently. But my question is if this MegaMUX will exactly fit for ADG731 and give me access to all its pins? Also on the MegaMUX PCB there are 2 Capacitors marked as C1 & C2. Which one is 0.1uF and 1uF? Thanks
I think the ADG731 has two outputs right? I think you will only have access to one output with my board. C1 and C2 can be either 0.1 or 1, switching them will not affect the board.
Thanks for your input. Both ADG731 and ADG732 have the same number of pins. I understand your board does connect to all the pins, correct? If so, I can interpret the pins as ADG731.
@@SeanHodgins What size are those caps? 0603?
@@brandondombrowski1497 0805
@@SanjayGupta-gv6vb I am looking to use this for ADG731s. Did this board work as-is for your use of the ADG731?
So the pcb you created is able to connect to more of them serially? How do you go from this video to reading 500 sensors? I ask because I’m trying to do something similar but with IR reflective sensors.
Since this chip has 32 selectable outputs, I attach 32 to one side of the light sensor, and another 32 to the other side of the light sensor(two multiplexer ICs), so that will give you 1024 selectable sensors.
@@SeanHodgins Does that essentially become just a mux tree/matrix? Where you are using one mux to select a row, and another to read a column?
@@wackyboy42 Exactly. Then it feeds into an op-amp to get the reading to the Arduino.
@@SeanHodgins Would that be a driver like a ULN2008APG?
Would love to see a cascade of these
Hi Sean, I am a first time viewer and have subbed due to your easy to follow manner and presentation. I am currently learning about the Aduino and was wondering if this Mux would read 18650 Li-ion battery volage in a 20 bay battery unit I am currently trying to cobble together? Thanks for any advice you can assist with. Mike.
do you have a good link to the multiplexer?
This IC? I got mine from Digikey - www.digikey.ca/product-detail/en/analog-devices-inc/ADG732BSUZ-REEL/ADG732BSUZ-REELCT-ND/4907711 - a little expensive, so you might be able to find it somewhere cheaper.
The board can be purchased from PCBWay, if you use this link to order I get 10% of the order I think. bit.ly/2szBXgs or you can download the gerbs if you want to get the board elsewhere.
I bought the board through your link. Going to try smb for the first time. You make it look easy.
chris Bruner check out my video on SMD soldering. You’ll get the hang of it in no time.
I asked a lot but one more thing, can I use this in my video and credit you?
Yeah definitely!
Hey Sean, I'm new to the glories of multiplexing so this might sound stupid, but could this be used for routing analog signals?
Basically, I'm building a eurorack synthesizer (already have the oscillators and midi control done) and I'm trying to digitally control the paths of all the cool patch cables.
After I work this part out I'll be able to make some websockets and APIs to control it all :)
For doing a lane select yes!
But most of the bigger channel MUX's have a single signal out. Now it goes bidirectional so you could effectively rotate one signal over 32 channels or 32 channels into 1!
For what you are describing, I would most certainly suggest using some smaller MUX's but more of them!
Thanks Sean for this cooool stuff....
Brilliant! Thank you!
hope u do " learning " video in the future 😁
Hi, thats a great demo regarding the use of a multiplexer with Arduino. As the inputs are being read sequentially, does this ever cause any problems with the slight delays between readings? Especially when using sensors as inputs to a control system? The reason I ask is that I am currently designing a HVAC controller for my house whereby I am using an Arduino Mega - but the 16 analog inputs are not enough, so I am having to use 2 x 16-way multiplexers on 2 analog input pins. Not tried it yet, but I was wondering if you've ever encountered any issues, and can share your experience on this matter. Hopefully I'm just over thinking it, but due to the nature of project, i want to make sure I have all bases covered!
Random musings yes, there will be some areas of delay, but it will be very small! Basically even using the ADC on 16 different inputs right on the mega is going to have a small offset of time from the first to the last. So if you introduce a multiplexer you will just add a smaller delay between each reading. Typically with something like temperature these delays are not an issue because the rate of temperature change is much much slower than any delay in temperature readings. So even if it took one second between 30 sensors, it’s unlikely that the 30 seconds from the first reading to the last is going to give you any sort of issue. If you were doing some really precisely timed readings for research or critical applications then it would be a different case, but for you there should be no problem.
@@SeanHodgins Cool as I thought, as the majority of my readings will be from PT100 sensors, which are resistance based there the read rate should be faster than the sensor response time. Likewise the media being sensed will be water so shouldn't react too quickly! Thank you for your prompt response! Earned a subscriber here! Great channel btw.
I've just bought the pcb on PCBWay. What are the specs for the two capacitors on the board? What surface mounting size and what capacitance?
They're decoupling caps so 0.1uF and 1uF on either pad. Size is 0805. Probably could get away with just a single 0.1uF. Nothing mentioned in the Datasheet, so I just put them in as you would for any IC.
Hi - On the PCB there are 2 Capacitors marked as C1 & C2. Which one is 0.1uF and 1uF? Thanks
@@SanjayGupta-gv6vb It doesn't matter. They are in parallel.
Just what I was after thanks! Can this be used to control 32 relays in varying combinations to stay on for a set amount of time
Yes absolutely, that would be a good use for it.
Thank you for a great video. I am new to microcontrollers, analog multiplexers, and Arduino. I am trying to replace the classic switches with this new technology. My application is a box with about 20 female 1/4 jacks, where 2 loopers (Boomerang, Boss RC-3), one that has memory but simple, and the other nice 4 tracks but can record the session, are plugged. Also a Volume pedal and a Reverb.
So, I made this box where with two switches 4 poles and some other switches I can alter the order of the signal path. So I can place the Boomerang before or after the Boss RC-3, and have the Volume pedal before the Guitar or after the loopers, etc.
I was trying to imagine. how to port this analog circuit to a more complete one using multiplexers. With the lack of knowledge on the subject I though that to have all possibilities open for about 20 1/4 jacks of I/O, I would need 20 chips of 20 channels (I know they are made of 4, 8, 16, 32 channels) so that any desired combination could be achieved, I believe must be a better way of thinking this out.
Could you just drop me a line or two to put me in the correct direction to research how to achieve my goal? Thank you so much for your time. All the best
its amazing
Hi my friend could you share wiring between arduino and megamux.
thanks
And, what is the value of C1 and C2 , I am going to buy your board.
@@ozgur280 capacitor for C1 is 0.1uF and C2 is 1uF type SMD:C_0805 capacitor.
Hi.
I'd like to use a MUX the other way around : analog to digital.
What I'd like is the "Sparkfun Qwiic MP3 Trigger" to play 10 different sounds, triggered by a 10 position rotary switch.
This MP3 Trigger comes with 4 triggers pins which play MP3 files named accordingly on the SD card :
For example, pulling pins 2 and 4 low at the same time will play track T006.mp3
Hence, in the same example, I need a thing that triggers those 2 pins when triggered itself by the rotary switch 6th position.
I think the "SparkFun Analog/Digital MUX Breakout" can do the job.
But I can't figure out how to connect those 3 objects together.
Rotary Switch 10 positions :arrow: MUX 16-channel :arrow: Qwiic MP3 Trigger :arrow: 10 mp3 files
- Does thes MUX need power ?
- What are the pins SIG and EN on the MUX ?
I'd be really gratefull if someone could help me a bit.
Thanks, Victor
start using platform io
Hi Sean. I don't know what's your exact requirements for your project, but maybe this is an alternative which is cheaper, includes an ADC and not requiring any select pin, so less wiring thanks to I2C: tindie.com/products/FERCSA/32-channel-adc-wi2c-for-arduino-and-raspberry-pi/ My goal is here not self promoting, but if you gonna go down on the multiplexer path without I2C you'll need a lot of select pin for 500 sensors, plus the analog ones ofc.
Pretty cool device, thanks for sharing! Unfortunately this would actually be a little more complicated for what I'm going to do(since I'm making my own PCB and all sensors will be surface mount). With the MUX select pins, you can stack multiple multiplexers on the same pins, and the ADC I'm collecting only require two pins, so I will only need two ADG732 ICs for what I'm doing, 32x32 will give me access to 1024 sensors. If I was wiring it by hand I would definitely consider your device.
How to learn adruino online
Watch a lot of youtube videos!
@@SeanHodgins 🤔 Im not sure that gonna help. If there are any free adruino teaching website suggest.
8:22 Khaby Labe is just a lier. You are the inventor of this hand movement idea :P
LOL!
you see your face more than the topic of the video in practice ...
Woow,
√√√