Home Automation: Control 16 channel relay with CD74HC4067 Multiplexer and Arduino with 6 wires

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 119

  • @alirezamirghasemi
    @alirezamirghasemi Před 3 lety +3

    Thank you for this tutorial. In my project, using this multiplexers is challenging. it is the fact that you can only open one switch at a time. in real application you may need to open multiple doors at a time. therefore I also need a latching mechanism.

    • @jefmao
      @jefmao Před 2 lety +1

      Thanks for proposing this great question. When you say "open multi doors ***at a time***," do you mean "the loop iterates very fast hence the multiple door locks can be released one by one in a very short time?" Or, there could be another level problem that, "the 1st door lock solenoid (fired to unlock) is fired and kept fired even if the demultiplexer is firing the second solenoid." If the need is the later, a hardware/software latching could be a solution.

  • @robertrobert5583
    @robertrobert5583 Před 4 lety +2

    Another really clear video - thank you. I've been trying to get my head around MUX and watched several videos but yours was the best. I finally understand!

  • @niekhue4981
    @niekhue4981 Před 2 lety

    I just used mcp23017. Now i try to use hc4067. I hope that it's work. Thanks for sharing

  • @regal_7877
    @regal_7877 Před 3 lety +2

    The problem with using a multiplexer/demultiplexer is that you can only control one output at a time based on what you input at the select lines. When you switch to a different channel, the previous one is cut off. For applications like these, it's better to use a SIPO shift register so it can hold the states of all the relays at once. Pair that with a 16 channel multiplexer and you get 16 complete relay modules.

    • @robojax
      @robojax  Před 3 lety

      Yes. this is the nature of multiplexer. One INPUT/OUTPUT is connected at a time.

    • @regal_7877
      @regal_7877 Před 3 lety

      @@robojax I have a question. What is the state of the pins that are not selected? For example, if I select the first channel of the multiplexer, what are the states of the other channels, are they high (source), low (sink) or hi-z? I want to feed the output of multiplexer to a D-latch.

    • @robojax
      @robojax  Před 3 lety

      Here in page 1 www.ti.com/lit/ds/symlink/cd74hc4067.pdf?ts=1604525574083&ref_url=https%253A%252F%252Fwww.google.com%252F it say: In addition, these devices have an enable control which when high will disable all switches to their “off” state.

    • @regal_7877
      @regal_7877 Před 3 lety

      @@robojax Oh yeah I read the datasheet, but I can't understand what happens to all other switches when the enable pin is low and only selecting one of the switches. I think I have to try it out to know

    • @Anssam-Shidon
      @Anssam-Shidon Před rokem

      @@robojax learn how to control all Mux together at the time @notes and volts

  • @spare-parts-iii
    @spare-parts-iii Před 2 lety +1

    Thank robojax; your code helped me immensely

  • @peachville4383
    @peachville4383 Před 4 lety +1

    I2C is a great tool and your video, as usual, explains every detail superbly! I'd like to add that I2C allows one to extend control to even more relay banks from one Arduino. Just recently I developed a non-I2C method to easily access hundreds of relays without MUX tables on a single Nano. :)

  • @michel.galvao
    @michel.galvao Před 4 lety +1

    I'm watching from Brazil

    • @robojax
      @robojax  Před 4 lety

      Thanks from Canada ❤️

  • @voltronicsautomation
    @voltronicsautomation Před 4 lety

    This is very supportive channel guys.. i love it.. keep on supporting this useful channel by do not skip ads.
    Love from Malaysia.
    #antiskipads

    • @robojax
      @robojax  Před 4 lety +1

      Thank you very much. I appreciate it. Ahmad from Canada.

  • @aqak4772
    @aqak4772 Před 5 lety +1

    很棒!本人非常喜欢这种风格的视频教程。

    • @robojax
      @robojax  Před 5 lety

      谢谢。 我很高兴你喜欢。 艾哈迈德来自加拿大。

  • @neelranade6322
    @neelranade6322 Před 2 lety +1

    Please make video on controlling these 16 relays with arduino with push buttons and display which relay is ON on lcd display

    • @robojax
      @robojax  Před 2 lety

      wow. replay, push button, diplay. threee-in-one. No one will need it . you gotta pay someone to do it. You can hire me for $100/hour. Contact me via robojax.com contact page.

  • @saikalyanmishra21
    @saikalyanmishra21 Před 3 lety

    I just want to know if we need to use 16 as an ac switch not individual blinking
    Can we use the multiplexer as well to control 16 relays as well? The highest number of pins available is 9 for such a job.
    Make it some useful 👍 to every use.

  • @QuickMind
    @QuickMind Před 5 lety +2

    Loving your videos! I will try to do this but i want to use in my car (12v ) ... how can i do this? ardunino is 5v but the relays board i need 12v right?
    also, i need to control the relays and also a way to control 180 degree servo and 90 rectracts.. any idea? Thanks

    • @robojax
      @robojax  Před 5 lety

      You are welcome. I am glad you found them useful.
      the 16 channel module has voltage regulator that converts up to 16V to 5V. So watch the main video on this module czcams.com/users/robojaxTVsearch?query=16+channel+relay and I have other relay videos czcams.com/users/robojaxTVsearch?query=relay
      for servo pleas check my videos on servo czcams.com/users/robojaxTVsearch?query=servo

  • @RETRODISTORT
    @RETRODISTORT Před 5 lety +3

    Great video, nice job!

  • @Detroit_Playa
    @Detroit_Playa Před 3 lety +1

    Nice video

    • @robojax
      @robojax  Před 3 lety

      Here is $200 Arduino course for free Arduino Step by Step Course (over 100 lectures) Starts here robojax.com/L/?id=338

  • @GaryMcKinnonUFO
    @GaryMcKinnonUFO Před 4 lety

    Very helpful indeed, liked and subbed thank you Ahmad. Gary from UK.

    • @robojax
      @robojax  Před 4 lety

      You are welcome. Thank you very much.

  • @Victor_Marius
    @Victor_Marius Před 3 lety

    In short, the 4 binary pins (s0 ... s3) selects the channel to do IO operations on it, EN pin has to be LOW all the time and SIG pin is used to send data to the selected channel. Can SIG pin be used to read data and do you have to do pinMode(controlPin[i], INPUT) and pinMode(SIG, INPUT)?

    • @robojax
      @robojax  Před 3 lety

      Yes you can read pins and yes you should change the pin as input as you said.

  • @luismiguelcosta5515
    @luismiguelcosta5515 Před 5 lety +1

    I built the system you are showing here. The only problem I found was how to switch off one relay without switching on another?

    • @luismiguelcosta5515
      @luismiguelcosta5515 Před 5 lety +1

      I found the solution - Turn ENABLE pin HIGH. Thanks anyway.

    • @robojax
      @robojax  Před 5 lety

      You are welcome. good to hear you resolved it.

    • @GaryMcKinnonUFO
      @GaryMcKinnonUFO Před 4 lety

      @@luismiguelcosta5515 Thanks Luis, i was wondering exactly that :)

  • @bogdy704
    @bogdy704 Před rokem

    Hello i need to control 1500 relay individual can i use multiplexor in multiplexor ? If i can can you explain to me?

  • @GaryMcKinnonUFO
    @GaryMcKinnonUFO Před 4 lety

    Hi Ahmad, i understand how you pass the channel address to the controlpin from the muxtable, i need to turn pumps on and off but i don't see how to turn an individual channel on then off again. Any help greatly appreciated if you have the time, thank you.

    • @GaryMcKinnonUFO
      @GaryMcKinnonUFO Před 4 lety

      I've just seen the answer in a question below, thanks ! :)

    • @robojax
      @robojax  Před 4 lety

      You are welcome.

  • @funnyvlog9331
    @funnyvlog9331 Před rokem

    Hi sir, good day, can you give me an idea how to make 16 relay ON one by one, and off one time, then start again to one by one, and repeat over and over again. Thank you very much sir. I hoping for your reply.

    • @funnyvlog9331
      @funnyvlog9331 Před rokem

      Because sir I'm using 8 channel relay, my sequence is one by one ON from channel 1 up to 8,and How to off one time, then start again to one by one, and off one time again, repeatedly. Thank you sir.

  • @danielcadoria9718
    @danielcadoria9718 Před 2 lety

    Hi, thanks for the video, very useful. How can you connect more cd74hc4067 in chain, to explain better I would like to use a cd74hc4067 where I would attach the other cd74hc4067 is it possible to do it?

    • @robojax
      @robojax  Před 2 lety

      Hi, yes I believe you can. Just use 4 other pins from Arduino connected to another module. Make sure when counter reaches to last digit which is 15, then start the other module. I needs some work but doable.

    • @danielcadoria9718
      @danielcadoria9718 Před 2 lety

      @@robojax Thanks for the answer, but will you show me how to do it with a video?

  • @EnergySeeker
    @EnergySeeker Před 3 lety

    nice video , if i use the multiplixer with only s0 , s 1 and s2 then will it control 12 output ? but how the binary will be in this case ?

    • @robojax
      @robojax  Před 3 lety +1

      If you use 3 bits, then modify the array holding the values for each buy. I have explained it.

  • @jefmao
    @jefmao Před 2 lety

    Thank you for your great demonstration. In addition, may I know that, does the de-multiplexer "holds" the value previously specified onto each channel when it leaves and loses control of that channel? (For ex., given C11=HIGH at time=0ms. I switch to and stay at C12 at 1ms~1000ms. What will happen to C11 during 1ms~1000ms?) Thank you in advance.

    • @jefmao
      @jefmao Před 2 lety

      Found the answer and a possible solution (not tested myself). Just FYI: electronics.stackexchange.com/questions/604406/finding-a-pass-through-demultiplexer-with-latch-register-on-output

    • @robojax
      @robojax  Před 2 lety +1

      You are welcome. I have demonstrated it where it shows if a relay is ON, holding or not. I don't have the circuit to check it. it is in the video.

  • @suprduprmn
    @suprduprmn Před 2 lety

    Excellent video! If you wanted to have 4 of the 16 channel relay boards connected to 4 multiplexers, is that possible or do you run out of pins on the Arduino? Is there a different way to handle that scenario?

    • @robojax
      @robojax  Před 2 lety

      Hello, The we would need expander module amzn.to/3xRdqoa for each relay module

    • @robojax
      @robojax  Před 2 lety

      Sorry, I found it here s.click.aliexpress.com/e/_Dn4ybH5 you can get 16 input/ouput by using just two wires.

    • @Felipera_
      @Felipera_ Před 2 lety

      @@robojax this is also what I needed. thanks.

  • @DaBuzz92
    @DaBuzz92 Před 5 lety

    Is there possibility to select more than one relay to turn on in one Time? For example, i want turn on relay 1,3,7,10,11. I Wonder if mux switch Time Will be fast enough to prevent relays from clicking.

    • @robojax
      @robojax  Před 5 lety

      Actually I made this video to answer your question. Please watch it again and do not escape.

  • @JunaidRahman2001
    @JunaidRahman2001 Před 5 měsíci

    Is there any module which can control all relays in parallel? Apart from using arduino mega or any other microcontroller

    • @robojax
      @robojax  Před 5 měsíci

      You can connect your own push button at the input connected to 5v you can control them without any microcontroller.

    • @JunaidRahman2001
      @JunaidRahman2001 Před 5 měsíci

      @@robojax automation has left the building

  • @javiersoto570
    @javiersoto570 Před 2 lety

    Cual es la diferencia entre usar un pin digital como tu estas usando y uno analógico para SIG ?

    • @robojax
      @robojax  Před 2 lety +1

      Revisé el video y la página de códigos. se ha explicado en el código.

  • @RD-ni7qe
    @RD-ni7qe Před 3 lety

    What if you wanted to switch on Relay #2 and Relay #7 at the same time? I don't think the multiplexer would allow for this.

    • @robojax
      @robojax  Před 3 lety

      at the beginning I said how multiplexer work. only one at a time.

  • @dannyk5084
    @dannyk5084 Před 4 lety

    Can you make a video using this multiplexer controlling a bunch of 7 segment displays?

    • @robojax
      @robojax  Před 4 lety

      Did you search for it? I already have it. I just searched for the word "seven" czcams.com/users/robojaxTVsearch?query=seven

  • @MAX-ox3xh
    @MAX-ox3xh Před 4 lety

    So if you put 0 delay, will they run seemingly all at once? Thank you!

    • @robojax
      @robojax  Před 4 lety +1

      don't forget this is mechanical device that turns ON/OFF. so it always takes time. if yo want all of them to work use it with this czcams.com/video/Q9aBI4ELKC4/video.html or use Arduino Mega

  • @melickon
    @melickon Před 5 lety +3

    10-th relay LED does not work?

    • @robojax
      @robojax  Před 5 lety +2

      Check the working. Software has no issue. Either wiring or the LED is bad.

    • @immenfreund1143
      @immenfreund1143 Před 5 lety +1

      @@robojax in your video at 18:36 LED at Relais 10 do not work.

  • @shubham9672
    @shubham9672 Před 3 lety

    Can we use this channel as input and signal pin as single output pin
    Can I take ADC value from channel to single out

    • @robojax
      @robojax  Před 3 lety

      I used multiplexer. and it can be used for multiplexing and demultiplexing . if you set the EN pin in the code to HIGH it will act as demultiplexer meaning all outputs will be input. See the datasheet for further information www.ti.com/lit/ds/symlink/cd74hc4067.pdf

    • @shubham9672
      @shubham9672 Před 3 lety

      @@robojax
      Thank you
      If I give EN logic high
      Then all pin will input
      So my question is which type of output I will get
      Can I join 14 analog sensors and get analog output from single pin of ic

  • @elmirabagherzadeh9613
    @elmirabagherzadeh9613 Před 4 lety

    Thanks!

    • @robojax
      @robojax  Před 4 lety

      You are welcome. خوشحالم که مفید واقع شده. احمد خراسانی

  • @OoohhhGeeeee
    @OoohhhGeeeee Před 3 lety

    Salam, do I get a motor reversed with it? Would like to swap two wires with a signal from a 3 pin Bldc.

    • @robojax
      @robojax  Před 3 lety

      walaikum salaam, please watch this video czcams.com/video/JMBgGO07YLM/video.html

  • @boopeshkumarprabhakaran

    Hi... Thanks for this video... As yu said multiplexer can't control more than 1 relay at a time... Is thier any alternative to make use of less pins in arduino and also control 2 or more relays at same time?

    • @robojax
      @robojax  Před 3 lety +1

      Hi, yes you can and I have tones of videos on that. Here is how you can find a video in CZcams channel in case of you didn’t know czcams.com/video/OhkUceBWcHs/video.html

    • @boopeshkumarprabhakaran
      @boopeshkumarprabhakaran Před 3 lety

      @@robojax thanks for the reply... I scroll over your videos but can't find one..... It Would be great if you share here...

    • @robojax
      @robojax  Před 3 lety +1

      I made that video so you can find . Watch the video please so you know how find

    • @robojax
      @robojax  Před 3 lety +1

      I have 590 videos you can’t find it by scrolling. Search my friend search

    • @boopeshkumarprabhakaran
      @boopeshkumarprabhakaran Před 3 lety +1

      @@robojax lol... It would be great if you tell me what keywords to search for. Your are pro in it.. But I'm a newbe to arduino.

  • @kartechindustries3069
    @kartechindustries3069 Před 4 lety

    Can I use this to send analog signal will I get same signal at the out as jnput

    • @robojax
      @robojax  Před 4 lety

      which output? the multiplexer is digital and it HAS to be digital. The relay can control anything you want.

  • @Omarbg95
    @Omarbg95 Před 5 lety +2

    so the thing is that you can only turn one of the 16 Ch On? what if i want 2 or more at the same time? i need another component?

    • @robojax
      @robojax  Před 5 lety

      then here is the video for that czcams.com/video/Q9aBI4ELKC4/video.html

    • @veereshy5444
      @veereshy5444 Před 4 lety

      Thank you for video. In case of ESP8266 this approach is not possible as there are very few GPIO pins. Do I have any option to expand the GPIO pins of ESP with mux so that I can individually control each relay?

  • @EnergySeeker
    @EnergySeeker Před 3 lety

    in case if we have 2 multiplexer how that will be changed in the code ?

    • @robojax
      @robojax  Před 3 lety +1

      just define all variables for 2nd module and use exact code. I just watched code section making sure I have explained it which indeed I did. so if you pay attention, you will learn how it works. if needed watch it 2 3 or 4 times and that is what I do if I don't learn something first time.

  • @StoneTL
    @StoneTL Před 4 lety

    Will analog reading work in this method?

    • @robojax
      @robojax  Před 4 lety +1

      sorry did not understand your question. you mean if connected to Analog input? yes. All analog pins are capable to work as digital pins.

  • @ManuelCastillo-kq3xy
    @ManuelCastillo-kq3xy Před 5 lety

    OMG!!!! Thanks for the video. This is equal if I use 8 reley (SSD)? I can use left pins with other sensors (like DTH22 or HC-SR04 or DS18B20 or other)?

    • @robojax
      @robojax  Před 5 lety +1

      Yes of course you can. But I have mentioned that you can't control 2 relay at the same time. Only ONE relay at a time. And yes you can use SSD as well.

    • @ManuelCastillo-kq3xy
      @ManuelCastillo-kq3xy Před 5 lety

      Robojax I can’t control 2 reley at some time? I can control reley1 for cooler and reley2 for heater. One off and other on, based in temp sensor, for example.

  • @melickon
    @melickon Před 5 lety

    1. How to control four of these modules? To cascade multiplexers somehow?
    2. How to turn on more than one relay at one time?

    • @robojax
      @robojax  Před 5 lety

      1-is possible, I have to write code for it
      2- is not possible with the multiplexer. multiplex mean connect multiple path or item to ONE. so only one can go through at a time. ;

    • @melickon
      @melickon Před 5 lety

      ​@@robojax Thanks you for your answer!
      I have an idea of project, where I need to control 50 bulbs on one side and 50 buttons on other side (radio connected). For side with bulbs, I assume I need four of these modules, but I have not clue how to control them.

    • @SimpleEnough2k9
      @SimpleEnough2k9 Před 5 lety

      @@melickon Instead of the CD74HC4067 Multiplexers I'd go for some 74HC595 shift registers which would allow to have any combination of relays at will, with the proper programming and interfacing naturally. For the radio part, then nRF24L01 transceiver could be a good candidate. Globally, you would have one side controlled by an Arduino that will check which buttons are on or off, create some sort of control string, send it to the other arduino which in turns will process the received information and turn on the desired relays. At first glance I would think this is possible.

  • @faiyyazmulla9883
    @faiyyazmulla9883 Před 2 lety

    Can share code for staircase lighting

    • @robojax
      @robojax  Před 2 lety

      what is staircase lighting?

  • @rafikkhan4617
    @rafikkhan4617 Před 3 lety

    👌👌👌👍

  • @DrTRonik
    @DrTRonik Před 5 lety

    Hi, can we control this system with "Teleduino" ? Thank you...

    • @robojax
      @robojax  Před 5 lety

      Never heard the "Teleduino" and just checked it. It is just web version of Arduino software and it should work exactly the same except instead of uploading the code from IDE you will use a web browser. There are more than 1 web base arduino has poped up recently.

  • @_DanielSatria
    @_DanielSatria Před 3 lety

    any coding for this project?

    • @robojax
      @robojax  Před 3 lety

      in the first 40 seconds I mentioned it.

    • @robojax
      @robojax  Před 3 lety

      All my videos have code and separate web page on my website. It would be useless to just make video.

  • @shubhamjain4974
    @shubhamjain4974 Před 3 lety

    i cant get the code

    • @robojax
      @robojax  Před 3 lety

      up to you if you want to get it or not. but it is there. I just checked it.

  • @Felipera_
    @Felipera_ Před 2 lety

    20:48 music these days keep getting weirder

  • @melvingozo
    @melvingozo Před 4 lety

    Stopped watching after the sixth commercial interruption...what a pain - never watched a channel with soooooo many interruption.

    • @robojax
      @robojax  Před 4 lety

      everything you get in life, you pay for it and when it come this, it becomes hard. why? I have spent hours (believe me more than a day) to wrote the code, test it find tune it so you use you get for FREE and use it. This is the least you can do for someone who has done something for you. I am sorry that people think the way you think. If you don't want interruption, then purchase my Arduino course the link is in the description.