Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. relay 2 or 4 or 8 channel ?!

relay 2 or 4 or 8 channel ?!

Scheduled Pinned Locked Moved My Project
9 Posts 4 Posters 4.3k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Reza
    wrote on last edited by
    #1

    hi
    I want build a relay 2 or 4 or 8 channel , but I dont know What is the program?

    have any body the program of relay 2 and 4 and 8 channel ?

    also , for a relay 8 channel with arduino , there are 6 pins ( 2,9,10,11,12,13) in arduino for radio nrf24l01 and there are 6 digital pins for relay !!! what am I do ?

    please help me and give me a correct program for 2,4,8 relay .

    1 Reply Last reply
    0
    • N Offline
      N Offline
      niccodemi
      wrote on last edited by
      #2

      @reza if you are looking for solution to control relays without buttons then you can use default mysensors relay-actuator sketch.

      You only need to change this line according to the number of relays you want to control (this will work with 2 and 4 channel relays).

      #define NUMBER_OF_RELAYS 1 // Total number of attached relays

      For 8 channel I think you would need custom sketch.
      Check this thread. Sketch posted there allows you to assign individual pins.

      R 1 Reply Last reply
      1
      • J Offline
        J Offline
        jemish
        wrote on last edited by
        #3

        hiii,
        Go through this link. http://forum.mysensors.org/topic/2833/relaywithbuttonactuator-6-channel

        R 1 Reply Last reply
        1
        • N niccodemi

          @reza if you are looking for solution to control relays without buttons then you can use default mysensors relay-actuator sketch.

          You only need to change this line according to the number of relays you want to control (this will work with 2 and 4 channel relays).

          #define NUMBER_OF_RELAYS 1 // Total number of attached relays

          For 8 channel I think you would need custom sketch.
          Check this thread. Sketch posted there allows you to assign individual pins.

          R Offline
          R Offline
          Reza
          wrote on last edited by
          #4

          @niccodemi
          hi my dear friend,
          really ? just this line ???
          so dont need I add new lines ? for example 4 channel :
          #define RELAY_1 3
          #define RELAY_2 4
          #define RELAY_3 5
          #define RELAY_4 6
          I think these you say all of relay on or all of relay off ? is it true ? I want manage each relay Separately

          1 Reply Last reply
          0
          • J jemish

            hiii,
            Go through this link. http://forum.mysensors.org/topic/2833/relaywithbuttonactuator-6-channel

            R Offline
            R Offline
            Reza
            wrote on last edited by
            #5

            @jemish thank you my friend , What is the difference between RelayActuator and RelayWithButtonActuator ??? and this is program of a IrrigationController so can i use for lighting controller ?

            1 Reply Last reply
            0
            • N Offline
              N Offline
              niccodemi
              wrote on last edited by
              #6

              @Reza below is example for 4 channel relay

              #define NUMBER_OF_RELAYS 4

              It is that simple. If you will use this sketch then connect relays to pins 3, 4, 5 and 6.
              You will be able to control each relay independently.
              Relay actuator sketch allows you to control relays only via controller ie Veralite. Relay actuator with button sketch allows you to control relays via controller AND physical button (light switch).

              R 1 Reply Last reply
              1
              • N niccodemi

                @Reza below is example for 4 channel relay

                #define NUMBER_OF_RELAYS 4

                It is that simple. If you will use this sketch then connect relays to pins 3, 4, 5 and 6.
                You will be able to control each relay independently.
                Relay actuator sketch allows you to control relays only via controller ie Veralite. Relay actuator with button sketch allows you to control relays via controller AND physical button (light switch).

                R Offline
                R Offline
                Reza
                wrote on last edited by
                #7

                @niccodemi
                so mean that if i change "just" this line (#define NUMBER_OF_RELAYS 4) I can have a relay 4 channel ?
                also I dont need define :
                #define RELAY_1 3
                #define RELAY_2 4
                #define RELAY_3 5
                #define RELAY_4 6
                ???

                1 Reply Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #8

                  No, just change one line.

                  R 1 Reply Last reply
                  1
                  • hekH hek

                    No, just change one line.

                    R Offline
                    R Offline
                    Reza
                    wrote on last edited by
                    #9

                    @hek hi dear hek , this is very Attractive :) very very thank you

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    29

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular