CD74HC4067 16 Channel Multiplexer - How to Use - Interface with Arduino - Increasing Inputs/Outputs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends welcome to a fresh new episode of our Channel RG Innovations [Music] subscribed already please subscribe to our Channel click on the Bell button and select all to get all future notifications of our video uploads today I am here with a new video after a long time in today's video I am going to discuss about this module which is a 16 channel multiplexer this module can be used to increase the number of input and output of a microcontroller there are many pins on this module and we will learn what every pin does in detail this module does not come with the header pin soldered I have soldered the header pins to use it on a breadboard and give you a demonstration so first let's learn what every pin of this module does this is the module you can see all the pins are marked at the bottom side all the pins are marked from c0 to C15 total 16 pins and at the top side here all the pins are marked the rightmost pin is marked as ground this this connects to the negative power supply and the next pin is connect marked as VCC this connects to the positive power supply then the next pin is the enable pin which enables or disables this module when we connect this to the ground or negative power supply this module is active and when is connected to the positive power supply this module gets reactive then we have four pins which are marked from s0 to S3 these four pins are selector pins this selects which pin gets connected to the signal pin this signal pin connects to these 15 pin as per the selector inputs this selector input follows a binary truth table I will show that in a moment for example if S3 is 0 S2 is 0 S1 is 0 and s0 is 1 then this connects to C1 pin the signal pin connects to C1 pin and rest of the C pins are not connected with any part of the circuit if all the pin selector pins are zero that means all the pins are connected to the negative power supply or ground the c0 pin is connected with the signal pin if we give any input to the signal pin we will get output for from the c0 pin or if we give any input to the c0 pin we will get output from the signal pin so this works as a one pole 16 way switch where the output or input pins are selected via the selector pins now let us move on and check the truth table of the selector pin how the output is selected as I was saying when the S3 pin is 0 S 2 pin is 0 S 1 pin is 0 as 0 pin is 0 that means all the selector pin values are zero the signal pin connects to c0 pin likewise when s30 s20 S10 and s0 is 1 the signal pin connects to C1 pin in this way when all the inputs the selector pins all the selector pins are one that means all the selector pins are high then the signal pin connects to C15 we will see in a practical demonstration so the advantage of this module is we can connect only five pins to the microcontroller and get 16 numbers of input and output from this module 4 pins as selected and one pin as a signal pin now if we want the outputs to be high when the selector pins change we need to connect the signal pin to the positive power supply or the VCC and if we want the outputs to be low when we change the selector pins we will connect the signal pin to the ground pin and if we want to change the signal pin value then we have to connect this to a microcontroller or if we want this to use as a input module then we have to connect the signal pin to the microcontroller input pin the only disadvantage that this module have is we can connect only one C pin to the signal pin at a particular time we cannot connect to multiple outputs or multiple inputs at a certain time but with a higher speed operation in a microcontroller we can achieve that so that is the theory part now we will see the demonstration of this module so here I have built a circuit on the breadboard I have used an Arduino Nano for giving the switching signal I have placed one switch just by pressing the switch it will increase the binary value one by one and the binary value will show in this LEDs this one is the s0 output this one is the S1 this one is S2 this one is S3 and you can see I have only used the Arduino Nanos A2 to A5 pins to connect to the selector pins of the multiplexer module one thing I forgot to mention that this multiplexer board works in digital and analog in both modes I will show that in the demonstration so first let us place that place the module in the breadboard so it is connected I have connected 16 LEDs from the 16 pins of the multiplexer and I have taken as I said four pins from A2 to A5 for the selector princess 0 to S3 and I have connected the signal pin to the positive power supply so that the outputs always remain high now I will connect the power supply I'll give the second diagram in the download section as a download link in the description box so you can download the circuit diagram and you can build it of your own so I am not wasting much time with the details of the circuit diagram it is very simple I have connected the 16 pins of this module to the LEDs and LEDs are connected with the negative power supply via 220 ohms resistance and the signal pin is connected with the positive power supply then the s0 to S3 pins are connected to analog A2 pins to A5 pins of the Arduino Nano and VCC pin is connected to the positive power supply enable is connected to the negative power supply and ground is connected to the negative power supply and I have used D12 to D9 pins as a binary output to show the out the selected pin status with the LED we could have connected the pins with the with these pins A2 to A5 pins we have used the analog input pins as output pin here we could have connected these LEDs here but the circuit would get complex so we have used separately four pins for the displaying the LEDs now I will connect the power supply to the Arduino actually I have connected it with my computer see initially all the outputs are low that means all these pins are zero so the LED that is connected with the c0 pin is now glowing now I will upload Arduino sketch so that we can increase the binary value one by one and see the change in output I am moving on to my desktop so this is the Arduino sketch I have used one button pin that is handling the push button then this led pins then selected pins I have used the analog input pins as output in the Arduino Nano then Define the output types and then here if the button pin is high then it will increase the binary value by one here I am converting the decimal value to Binary value and setting the output accordingly so this is the sketch now I will upload it to the Arduino I have already selected the port and the board so uploading is done now let's get back to the circuit diagram so here I am back with the circuit diagram and you can see even after uploading since all the selected pins inputs are zero so the c0 is selected from the signal pin now if you can see I have connected the signal pin with the positive power supply now if we connect it to the negative power supply this will not glow because this pin c0 pin connects to the signal pin as a switch so I am connecting it to positive Supply again now if I press this button the binary value will increase one by one and you can see this LEDs will move I will LEDs will move one by one I am pressing it for one time you see now the binary value is zero zero zero one so C1 pin is connected with the signal pin and this led is glowing then moving next 0 0 1 0 and C2 is connected with this led so this led is blowing likewise if the binary value increases the output will move one by one at the end when all the selector pins are one it is connected with C15 and C15 pin output is glowing again all 0 so C 0 is selected so this is one mode the digital mode I am showing you now if we want to see the analog mode I have another sketch in the Arduino that will show you the analog mode of this module so I have to upload a new sketch let's check the sketch so this is the sketch I have used here a pwm pin pin number three is the pwm pin in the Arduino Nano and rest of the code is almost same except that I have used a fading code that Fades and unfades the LED I will upload this cage to the Arduino so I am uploading this sketch to the Arduino uploading is done now let's get back to the Circuit since we have used the pin number digital pin number three as the pwm pin we will change the connection for Signal pin this is the signal pin we will change the connection to digital pin number three and you see this pin is fading so it is working in analog mode now if we press the button the next LED will be selected the next pin will be selected and the fading will continue so by this example you understood that all the pins can be used as a analog output pin I will give the Arduino sketch for downloading in the description section so you can download the code from there so this is for increasing the number of output pins now I will show you how we can use it for checking input using this c0 to C15 pins I will only show one pin but you can connect 16 number of input devices to this module and the output from those input signals will get to the signal pin and we can take the output to any input pin of the Arduino from signal pin so let's move on to the input selector part now we have changed the circuit for showing the input selection we have used two input devices one is a button a push button and one is a potentiometer for showing analog input and this one will show digital input we have connected to pin number C1 to the push switch and we have connected pin number C3 to the potentiometer and the middle pin of the potentiometer is connected with C3 and the two sides of the potentiometer is connected with the positive power supply and negative power supply and we have connected One LED with the signal pin from the signal pin we have given supply to the positive pin of the LED and the negative pin of the LED is connected to the ground pin since we have not used the Arduino inputs we need not to update any new sketch the previous code will work for selecting the selector pins initially all the selector pin inputs are zero so the c0 pin is selected but as nothing is connected with the c0 pin the LED will not glow the potentiometer is in high position the LED will not glow but when we press the input selector key the input changes to zero zero zero one now C1 pin is connected with the signal pin now if we press this push button the positive power supply from here connects to pin number C1 to the signal pin and goes to the LED and this led turns on but the potentiometer will not work now now we are pressing the selector button once now the binary value becomes 0 0 1 0 that means pin 2 is connected with the signal pin so nothing happens if we press this button or if we change the potentiometer value because C2 pin is connected with none of the inputs so the signal pin is connecting with C2 pin and it is not getting any signal now we are again pressing the selector button and this time the LED glows when the input is 0 0 1 1 because the potentiometer is connected with the C3 pin here and the potentiometer is in high position now if we decrease the value of the potentiometer you see the brightness of the LED reduces so you see this module Works in both digital and analog mode we can connect the signal pin to the Arduino inputs and we can connect multiple input devices to get their values just by using only 5 pins we can select 15 input devices using this multiplexer module so I think the concept of this 16 channel multiplexer is clear to you if you have any further question please feel free to ask me in the comments I will definitely try to answer your queries today up to this we will meet again in a new video if you like my video please hit the like button and share it and if you have not subscribed to my Channel please subscribe to my channel RG Innovations till then bye bye take care have a nice time and thank you once again for watching my video thank you
Info
Channel: RG Innovations
Views: 14,658
Rating: undefined out of 5
Keywords: 16 Channel Analog Multiplexer, 4 Channel Analog Multiplexer, 8 Channel Analog Multiplexer, CD74HC4067 Multiplexer, CD4067 IC Module, HC4067 Module Multiplexer, 16 Channel Multiplexer Arduino, CD74HC4067 Tutorial, Arduino Multiplexer Tutorial, CD74HC4067 Interfacing, Arduino Increasing Inputs, CD74HC4067 Arduino Code, Multiplexer with Arduino, CD74HC4067 Setup, Arduino Input Expansion, CD74HC4067 Example, Arduino Multiplexer Project, CD74HC4067 Circuit, CD74HC4067 Multiplexing
Id: j_ZP_zd0WHI
Channel Id: undefined
Length: 15min 50sec (950 seconds)
Published: Mon May 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.