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

Поділитися
Вставка
  • Опубліковано 27 гру 2024

КОМЕНТАРІ • 119

  • @alirezamirghasemi
    @alirezamirghasemi 3 роки тому +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 2 роки тому +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 4 роки тому +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!

    • @robojax
      @robojax  4 роки тому

      Glad it was helpful!

  • @spare-parts-iii
    @spare-parts-iii 2 роки тому +1

    Thank robojax; your code helped me immensely

  • @niekhue4981
    @niekhue4981 2 роки тому

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

  • @regal_7877
    @regal_7877 4 роки тому +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  4 роки тому

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

    • @regal_7877
      @regal_7877 4 роки тому

      @@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  4 роки тому

      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 4 роки тому

      @@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 2 роки тому

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

  • @michel.galvao
    @michel.galvao 4 роки тому +1

    I'm watching from Brazil

    • @robojax
      @robojax  4 роки тому

      Thanks from Canada ❤️

  • @peachville4383
    @peachville4383 5 років тому +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. :)

    • @robojax
      @robojax  5 років тому

      Yes. indeed.

  • @bogdy704
    @bogdy704 Рік тому

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

  • @QuickMind
    @QuickMind 5 років тому +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  5 років тому

      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 ua-cam.com/users/robojaxTVsearch?query=16+channel+relay and I have other relay videos ua-cam.com/users/robojaxTVsearch?query=relay
      for servo pleas check my videos on servo ua-cam.com/users/robojaxTVsearch?query=servo

  • @voltronicsautomation
    @voltronicsautomation 5 років тому

    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  5 років тому +1

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

  • @GaryMcKinnonUFO
    @GaryMcKinnonUFO 4 роки тому

    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 4 роки тому

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

    • @robojax
      @robojax  4 роки тому

      You are welcome.

  • @Victor_Marius
    @Victor_Marius 3 роки тому

    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  3 роки тому

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

  • @EnergySeeker
    @EnergySeeker 3 роки тому

    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  3 роки тому +1

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

  • @saikalyanmishra21
    @saikalyanmishra21 3 роки тому

    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.

  • @RETRODISTORT
    @RETRODISTORT 6 років тому +3

    Great video, nice job!

  • @neelranade6322
    @neelranade6322 2 роки тому +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  2 роки тому

      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.

  • @javiersoto570
    @javiersoto570 2 роки тому

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

    • @robojax
      @robojax  2 роки тому +1

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

  • @JunaidRahman2001
    @JunaidRahman2001 8 місяців тому

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

    • @robojax
      @robojax  8 місяців тому

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

    • @JunaidRahman2001
      @JunaidRahman2001 8 місяців тому

      @@robojax automation has left the building

  • @RD-ni7qe
    @RD-ni7qe 4 роки тому

    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  4 роки тому

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

  • @Detroit_Playa
    @Detroit_Playa 3 роки тому +1

    Nice video

    • @robojax
      @robojax  3 роки тому

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

  • @GaryMcKinnonUFO
    @GaryMcKinnonUFO 4 роки тому

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

    • @robojax
      @robojax  4 роки тому

      You are welcome. Thank you very much.

  • @jefmao
    @jefmao 2 роки тому

    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 2 роки тому

      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  2 роки тому +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.

  • @EnergySeeker
    @EnergySeeker 3 роки тому

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

    • @robojax
      @robojax  3 роки тому +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.

  • @MAX-ox3xh
    @MAX-ox3xh 4 роки тому

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

    • @robojax
      @robojax  4 роки тому +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 ua-cam.com/video/Q9aBI4ELKC4/v-deo.html or use Arduino Mega

  • @suprduprmn
    @suprduprmn 2 роки тому

    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  2 роки тому

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

    • @robojax
      @robojax  2 роки тому

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

    • @Felipera_
      @Felipera_ 2 роки тому

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

  • @kartechindustries3069
    @kartechindustries3069 4 роки тому

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

    • @robojax
      @robojax  4 роки тому

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

  • @luismiguelcosta5515
    @luismiguelcosta5515 5 років тому +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 5 років тому +1

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

    • @robojax
      @robojax  5 років тому

      You are welcome. good to hear you resolved it.

    • @GaryMcKinnonUFO
      @GaryMcKinnonUFO 4 роки тому

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

  • @shubham9672
    @shubham9672 3 роки тому

    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  3 роки тому

      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 3 роки тому

      @@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

  • @Omarbg95
    @Omarbg95 5 років тому +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  5 років тому

      then here is the video for that ua-cam.com/video/Q9aBI4ELKC4/v-deo.html

    • @veereshy5444
      @veereshy5444 5 років тому

      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?

  • @aqak4772
    @aqak4772 6 років тому +1

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

    • @robojax
      @robojax  6 років тому

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

  • @melickon
    @melickon 6 років тому +3

    10-th relay LED does not work?

    • @robojax
      @robojax  6 років тому +2

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

    • @immenfreund1143
      @immenfreund1143 5 років тому +1

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

  • @DaBuzz92
    @DaBuzz92 5 років тому

    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  5 років тому

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

  • @OoohhhGeeeee
    @OoohhhGeeeee 4 роки тому

    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  4 роки тому

      walaikum salaam, please watch this video ua-cam.com/video/JMBgGO07YLM/v-deo.html

  • @danielcadoria9718
    @danielcadoria9718 3 роки тому

    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  3 роки тому

      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 3 роки тому

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

  • @StoneTL
    @StoneTL 4 роки тому

    Will analog reading work in this method?

    • @robojax
      @robojax  4 роки тому +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.

  • @boopeshkumarprabhakaran
    @boopeshkumarprabhakaran 3 роки тому

    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  3 роки тому +1

      Hi, yes you can and I have tones of videos on that. Here is how you can find a video in UA-cam channel in case of you didn’t know ua-cam.com/video/OhkUceBWcHs/v-deo.html

    • @boopeshkumarprabhakaran
      @boopeshkumarprabhakaran 3 роки тому

      @@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  3 роки тому +1

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

    • @robojax
      @robojax  3 роки тому +1

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

    • @boopeshkumarprabhakaran
      @boopeshkumarprabhakaran 3 роки тому +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.

  • @dannyk5084
    @dannyk5084 5 років тому

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

    • @robojax
      @robojax  5 років тому

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

  • @funnyvlog9331
    @funnyvlog9331 Рік тому

    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 Рік тому

      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.

  • @faiyyazmulla9883
    @faiyyazmulla9883 3 роки тому

    Can share code for staircase lighting

    • @robojax
      @robojax  3 роки тому

      what is staircase lighting?

  • @melickon
    @melickon 6 років тому

    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  6 років тому

      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 6 років тому

      ​@@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 5 років тому

      @@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.

  • @elmirabagherzadeh9613
    @elmirabagherzadeh9613 4 роки тому

    Thanks!

    • @robojax
      @robojax  4 роки тому

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

  • @_DanielSatria
    @_DanielSatria 3 роки тому

    any coding for this project?

    • @robojax
      @robojax  3 роки тому

      in the first 40 seconds I mentioned it.

    • @robojax
      @robojax  3 роки тому

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

  • @DrTRonik
    @DrTRonik 6 років тому

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

    • @robojax
      @robojax  6 років тому

      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.

  • @shubhamjain4974
    @shubhamjain4974 3 роки тому

    i cant get the code

    • @robojax
      @robojax  3 роки тому

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

  • @ManuelCastillo-kq3xy
    @ManuelCastillo-kq3xy 6 років тому

    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  6 років тому +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 6 років тому

      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.

  • @rafikkhan4617
    @rafikkhan4617 3 роки тому

    👌👌👌👍

  • @Felipera_
    @Felipera_ 2 роки тому

    20:48 music these days keep getting weirder

  • @melvingozo
    @melvingozo 5 років тому

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

    • @robojax
      @robojax  5 років тому

      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.