Skip to content
  • 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. Announcements
  3. 💬 Relay
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

💬 Relay

Scheduled Pinned Locked Moved Announcements
139 Posts 47 Posters 33.7k Views 45 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.
  • skywatchS Offline
    skywatchS Offline
    skywatch
    wrote on last edited by
    #78

    Can I suggest a change to this page?

    As it stands the wiring diagram only applies to sketch 1 (without switch). It could get confusing as the 2 sketches use different pins for the relay and there is no need for this.

    I propose that the wiring diagram be changed for the relay to be attached to pin 4.
    The first sketch needs the relay pin to change from pin 3 to pin 4.

    That's it. Then the diagram and sketches will work whichever way the builder wants to do it.

    mfalkviddM 1 Reply Last reply
    1
    • skywatchS skywatch

      Can I suggest a change to this page?

      As it stands the wiring diagram only applies to sketch 1 (without switch). It could get confusing as the 2 sketches use different pins for the relay and there is no need for this.

      I propose that the wiring diagram be changed for the relay to be attached to pin 4.
      The first sketch needs the relay pin to change from pin 3 to pin 4.

      That's it. Then the diagram and sketches will work whichever way the builder wants to do it.

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #79

      Good idea @skywatch
      When doing the update, we should also rename RELAY_1 to RELAY_PIN to be consistent with sketch 2.

      1 Reply Last reply
      0
      • mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #80

        https://github.com/mysensors/MySensors/pull/973

        1 Reply Last reply
        0
        • mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #81

          https://www.mysensors.org/build/relay has been updated with new wiring instructions (picture + table)

          1 Reply Last reply
          0
          • skywatchS Offline
            skywatchS Offline
            skywatch
            wrote on last edited by
            #82

            That looks good, only the sketchs to go....On that note I wonder if Relay_1 might not be better choice as it gives a clue to people that if they want to add a second relay then that would be Relay_2.... Just a thought and maybe not needed.... ;)

            1 Reply Last reply
            0
            • HenryWhiteH Offline
              HenryWhiteH Offline
              HenryWhite
              wrote on last edited by
              #83

              @mfalkvidd when updating the example sketch you could maybe consider my version of the relay sketch which offers some nice additions: https://forum.mysensors.org/topic/6638/multiple-relays-motion-sketch-fully-customizable-optional-timer-manual-override

              mfalkviddM 1 Reply Last reply
              0
              • HenryWhiteH HenryWhite

                @mfalkvidd when updating the example sketch you could maybe consider my version of the relay sketch which offers some nice additions: https://forum.mysensors.org/topic/6638/multiple-relays-motion-sketch-fully-customizable-optional-timer-manual-override

                mfalkviddM Offline
                mfalkviddM Offline
                mfalkvidd
                Mod
                wrote on last edited by
                #84

                @HenryWhite my mind is divided when it comes to that type of sketch. Yes, it has a lot of functionality. Yes, it is probably what people need anyway. But the examples are meant to be used by someone who is just getting into diy home automation. Someone new should be able to understand as much of the sketch as possible. There should be as little as possible to trubleshoot. If the sketch is complex, most people's initial reaction will be that there is something wrong with the code, when in reality almost all newbie problems are power or wiring-related. Keeping the sketch simple helps, at lest a bit.

                fhenrycoF 1 Reply Last reply
                1
                • mfalkviddM mfalkvidd

                  @HenryWhite my mind is divided when it comes to that type of sketch. Yes, it has a lot of functionality. Yes, it is probably what people need anyway. But the examples are meant to be used by someone who is just getting into diy home automation. Someone new should be able to understand as much of the sketch as possible. There should be as little as possible to trubleshoot. If the sketch is complex, most people's initial reaction will be that there is something wrong with the code, when in reality almost all newbie problems are power or wiring-related. Keeping the sketch simple helps, at lest a bit.

                  fhenrycoF Offline
                  fhenrycoF Offline
                  fhenryco
                  wrote on last edited by
                  #85

                  @mfalkvidd You are right but may be should there be for each sensor or actuator first the most basic sketch but also at the end of the page a complete version with all functionalities and granted to work by the mysensors team.

                  Of course for the complicated sketch version a big warning in red letters that this is not recommended for newbies would help...

                  fhenrycoF 1 Reply Last reply
                  1
                  • fhenrycoF fhenryco

                    @mfalkvidd You are right but may be should there be for each sensor or actuator first the most basic sketch but also at the end of the page a complete version with all functionalities and granted to work by the mysensors team.

                    Of course for the complicated sketch version a big warning in red letters that this is not recommended for newbies would help...

                    fhenrycoF Offline
                    fhenrycoF Offline
                    fhenryco
                    wrote on last edited by
                    #86

                    After testing some functionalities of nodemanager, i was wondering if already somebody was working on making a GUI for nodemanager which would allow to build one's sketch completely from a graphical interface (at least the most common and basic functionalities) : i thing the great work that resulted in Nodemanager has so well structured the various functions needed that it has already paved the way for creating such a graphical interface.

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #87

                      There was a user some time ago that was trying to make a web GUI

                      1 Reply Last reply
                      0
                      • skywatchS Offline
                        skywatchS Offline
                        skywatch
                        wrote on last edited by
                        #88

                        I would agree that more advanced sketches 'should' be included on the same page. Keep all the info in one resource place. Provided it is clearly marked as an advanced project it might help people looking for similar functionality or just interested in learning more about programming....

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

                          @fhenryco
                          https://rakeshpai.github.io/mysensors-network-manager/networks/

                          https://github.com/rakeshpai/mysensors-network-manager

                          1 Reply Last reply
                          1
                          • fhenrycoF Offline
                            fhenrycoF Offline
                            fhenryco
                            wrote on last edited by
                            #90

                            wow! fantastic! ... the github link readme warns that it's not yet fully ready but the interface is already impressive!
                            I still have the same question i had for nodemanager though : for measuring another battery than the one that feeds Vcc obviously another pin is needed, however why not propose as well the option of measuring such pin voltage but with Vcc as the reference rather than the internal 1.1V which most of the time makes necessary a voltage divider ? Actually i did the modification in nodemanager.cpp to use DEFAULT (~3.3V) rather than INTERNAL (1.1V) reference for a 3.3 pro mini and i can get the expected battery level without any voltage divider.

                            Another unrelated question i have is : could there be any way to adapt the idea of the readVcc method (which is to measure the internal 1.1V against the Vcc reference to get Vcc) but using any voltage applied to a pin as the reference to again measure the internal 1.1 against it ? This would allow the masurement of any voltage greater than 1.1 without voltage divider while the usual method would be applied for measuring any voltage lower than 1.1 ... what did i miss that makes this impossible ?

                            fhenrycoF 1 Reply Last reply
                            0
                            • gohanG Offline
                              gohanG Offline
                              gohan
                              Mod
                              wrote on last edited by
                              #91

                              We need to use the internal reference since it is the only stable voltage source and you need the voltage divider to lower the measured voltage between 0 and 1.1v. There are not many options to choose from

                              1 Reply Last reply
                              0
                              • fhenrycoF fhenryco

                                wow! fantastic! ... the github link readme warns that it's not yet fully ready but the interface is already impressive!
                                I still have the same question i had for nodemanager though : for measuring another battery than the one that feeds Vcc obviously another pin is needed, however why not propose as well the option of measuring such pin voltage but with Vcc as the reference rather than the internal 1.1V which most of the time makes necessary a voltage divider ? Actually i did the modification in nodemanager.cpp to use DEFAULT (~3.3V) rather than INTERNAL (1.1V) reference for a 3.3 pro mini and i can get the expected battery level without any voltage divider.

                                Another unrelated question i have is : could there be any way to adapt the idea of the readVcc method (which is to measure the internal 1.1V against the Vcc reference to get Vcc) but using any voltage applied to a pin as the reference to again measure the internal 1.1 against it ? This would allow the masurement of any voltage greater than 1.1 without voltage divider while the usual method would be applied for measuring any voltage lower than 1.1 ... what did i miss that makes this impossible ?

                                fhenrycoF Offline
                                fhenrycoF Offline
                                fhenryco
                                wrote on last edited by fhenryco
                                #92

                                i also just realized that there is a special AREF pin intended for what i was thinking about ... but it's not available on the mini pro.

                                My measurements using Vcc as Ref have been indeed very fluctuating, however what i get was highly sufficient to monitor the battery feeding a 3.3v step up regulator to the arduino and help anticipate failure

                                1 Reply Last reply
                                0
                                • skywatchS Offline
                                  skywatchS Offline
                                  skywatch
                                  wrote on last edited by
                                  #93

                                  I just noticed another thing that should be changed in the 'relay with button' sketch....

                                  S_LIGHT should be S_BINARY
                                  V_LIGHT shoud be V_STATUS

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    APL2017
                                    wrote on last edited by
                                    #94

                                    I would like to clarify operation of the sketch, where more than 1 sensors input are used along with more than 1 relay actuator. in one node

                                    1. Does node need unique child ID for each sensor input AND relay output?
                                    2. If that is the case how child ID is assigned to relay actuators in the above examples?
                                    1 Reply Last reply
                                    0
                                    • jopebeJ Offline
                                      jopebeJ Offline
                                      jopebe
                                      wrote on last edited by jopebe
                                      #95

                                      This is a nice sketch and it is very universal for relays. Now m looking for a similar sketch for digital inputs such as buttons i.e.. I would like to join both. The problem: I want to use a mega for reading status of a lot of digital outputs (min.20) of another ISP. It is only High or Low. Only when the level changes, I want the mega send a message to the gateway. I tried this "for" loop, but it didnt help. There are too many informations sent to the gateway. I imagine a solution, where only a change at the pin will create an information, that is sent to the gateway.
                                      Here my test, which didnt run:
                                      void loop()
                                      {

                                      for (int sensor=16, pin=BIN_1; sensor<=NUMBER_OF_BIN; sensor++, pin++)
                                      {
                                      int BUTT;
                                      int BUTTOLD;
                                      BUTT =digitalRead(pin);
                                      if (BUTT != BUTTOLD && BUTT !=0){
                                      MyMessage msg(sensor, V_TRIPPED);
                                      send(msg.set(BUTT ? "1" : "0"));
                                      }
                                      BUTTOLD = BUTT;
                                      wait (900);
                                      }
                                      }
                                      Has anybody an idea or a hint for me?

                                      1 Reply Last reply
                                      0
                                      • gohanG Offline
                                        gohanG Offline
                                        gohan
                                        Mod
                                        wrote on last edited by
                                        #96

                                        I believe there is a logic error in the sketch as you would need to declare global variables BUTTOLD_XX unique for each button, otherwise how can you keep track of the variable between each loop and FOR iteraction?

                                        1 Reply Last reply
                                        0
                                        • jopebeJ Offline
                                          jopebeJ Offline
                                          jopebe
                                          wrote on last edited by
                                          #97

                                          Thank You for Your quick answer.
                                          Do I understand You correctly: I must index the BUTTOLD?
                                          As BUTTOLD[pin) for example or how? Where?

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


                                          15

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular