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
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.
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)
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.
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).
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.
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.
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
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.
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
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?
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.
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 ?
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!
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 - 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.
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 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.