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. πŸ’¬ Building a wired RS485 sensor network
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

πŸ’¬ Building a wired RS485 sensor network

Scheduled Pinned Locked Moved Announcements
164 Posts 33 Posters 46.7k Views 35 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 Reza

    @wimd
    i test with "PA_HIGH" and "PA_MAX" (for nodes and gateway) but this is more bad.
    (for example for 10-15 meter with 2 wall)
    in default PA for 10 command i have 2 error
    in PA_HIGH for 10 command i have 8 error
    in PA_MAX my connection is disconnect completly
    can you understand where is problem? i think this is related to power supply of radio (because when i want more power for more distance so radio can not have a good connection) but i providing enough power for radio. i use a adapter 5v 2A and connect this to a radio adapter(reglator 5 to 3.3) even use a 4.7u capacitor for radio. similar to photo:
    0_1484474385522_photo_2017-01-15_13-28-34.jpg

    wimdW Offline
    wimdW Offline
    wimd
    wrote on last edited by
    #43

    @Reza You have exactly the same problem as I had when I first found MySensors in march last year.
    I got a couple of radio and started to play with them. All worked fine as long as they were not more than 5m away from each other. I dropped the idea at that time.

    2 months ago I saw the possibility on the website to build a wired network. I started again. With the order for the RS485 bricks I ordered also some radios but now with antenna and amplifier. The only improvement I got was now up to 7m.
    I managed now to connect with my greenhouse that is 12m away but had to place a repeater in between but the connection is no reliable.

    The discussion that is now ongoing is not related anymore to a RS485 network. I suggest you start an new topic specific for your radio issue. Or we both did do something wrong or the hardware that we buy does not meet the specification for transmitting distance.

    Let me now if you started a new topic.

    R 1 Reply Last reply
    1
    • R Reza

      @wimd
      i test with "PA_HIGH" and "PA_MAX" (for nodes and gateway) but this is more bad.
      (for example for 10-15 meter with 2 wall)
      in default PA for 10 command i have 2 error
      in PA_HIGH for 10 command i have 8 error
      in PA_MAX my connection is disconnect completly
      can you understand where is problem? i think this is related to power supply of radio (because when i want more power for more distance so radio can not have a good connection) but i providing enough power for radio. i use a adapter 5v 2A and connect this to a radio adapter(reglator 5 to 3.3) even use a 4.7u capacitor for radio. similar to photo:
      0_1484474385522_photo_2017-01-15_13-28-34.jpg

      wimdW Offline
      wimdW Offline
      wimd
      wrote on last edited by
      #44

      @Reza maybe read all on this one : https://forum.mysensors.org/topic/1142/nrf24l01-pa-lna/35

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

        What are the main advantages of rs485 over I2C bus?

        K 1 Reply Last reply
        0
        • gohanG gohan

          What are the main advantages of rs485 over I2C bus?

          K Offline
          K Offline
          kimot
          wrote on last edited by
          #46

          @gohan
          I2C bus is designed for short distances, obviously between circuits on one PCB.
          Max allowed capacitance i2c bus is 400pF. CAT5 cable has nominal 52pf/m.
          Ideally you can communicate to distance 8m.
          It is very short bus for home network, I think.
          Or we need some "hacking" for i2c bus, for example at page 4 in this document:

          http://www.nxp.com/documents/application_note/AN460.pdf

          For each node we need one bus expander ( P82B96 ) and two CAN bus drivers ( PCA82C250 ).
          7 + 2*0.5 US$ ( ebay )
          Plus second pair of wires.
          Or buy this: http://mayhewlabs.com/products/i2c-power-extender
          You can read bus length, number of nodes and speed limit, there.

          But, interesting idea.
          With some smart "node addressing" and multi-master i2c bus I can imagine, that on some places you do not need processor.
          For actuator simply use PCF8574 for example.

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

            So basically for 10-15 meters distance it's better and cheaper to use cheap rs485 modules, right?

            K 1 Reply Last reply
            0
            • gohanG gohan

              So basically for 10-15 meters distance it's better and cheaper to use cheap rs485 modules, right?

              K Offline
              K Offline
              kimot
              wrote on last edited by
              #48

              @gohan
              Yes

              1 Reply Last reply
              1
              • wimdW wimd

                @Reza You have exactly the same problem as I had when I first found MySensors in march last year.
                I got a couple of radio and started to play with them. All worked fine as long as they were not more than 5m away from each other. I dropped the idea at that time.

                2 months ago I saw the possibility on the website to build a wired network. I started again. With the order for the RS485 bricks I ordered also some radios but now with antenna and amplifier. The only improvement I got was now up to 7m.
                I managed now to connect with my greenhouse that is 12m away but had to place a repeater in between but the connection is no reliable.

                The discussion that is now ongoing is not related anymore to a RS485 network. I suggest you start an new topic specific for your radio issue. Or we both did do something wrong or the hardware that we buy does not meet the specification for transmitting distance.

                Let me now if you started a new topic.

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

                @wimd thank you friend . i started several topic about this issue , but dont found any answer so i delete all topics. also i dont start new topic because friends are sad for my topics and admin told me dont start any topic :(
                i have exactly this problem. now for 10 meter i must use a repeater ! for 10 meter ! ! ! ! this is strange ! i use 4.7u capacitor and more. i use radio adaptor. i use reglator module. use 3 type of radio . in sketch use PA_MAX and PA_HIGH ... but effectless. so you told me if i want change my network to wiring with RS485 , i will have same problem again ? i can not found any way for this problem .
                now please let me for read this topic perhaps i can found any way for this problem . thank you

                wimdW 1 Reply Last reply
                0
                • R Reza

                  @wimd thank you friend . i started several topic about this issue , but dont found any answer so i delete all topics. also i dont start new topic because friends are sad for my topics and admin told me dont start any topic :(
                  i have exactly this problem. now for 10 meter i must use a repeater ! for 10 meter ! ! ! ! this is strange ! i use 4.7u capacitor and more. i use radio adaptor. i use reglator module. use 3 type of radio . in sketch use PA_MAX and PA_HIGH ... but effectless. so you told me if i want change my network to wiring with RS485 , i will have same problem again ? i can not found any way for this problem .
                  now please let me for read this topic perhaps i can found any way for this problem . thank you

                  wimdW Offline
                  wimdW Offline
                  wimd
                  wrote on last edited by
                  #50

                  @Reza I have written earlier that I didn’t have any problem with RS485 on a cable of 10m but did not trail longer yet.
                  If you make trails with the wired network, make sure that you define your node id number

                  #define MY_NODE_ID <X>```
                  1 Reply Last reply
                  1
                  • wimdW Offline
                    wimdW Offline
                    wimd
                    wrote on last edited by
                    #51

                    @hek I was wondering if it could be useful to have an extra sensor that a bridge between the wireless and wire network.
                    This bridge is made between the SPI dealing with the wireless network and the hardware serial that is dealing with the wire network.
                    It would allow you to connect a remote wired network.

                    IF the CE pin for the radio (9) could be user defined, a 2nd thought (based on the bridge idea).
                    Can’t something similar be done for the serial gateway and make that one suitable for wired and wireless network in the same gateway?

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

                      Cable will always be better that wireless, so if you can go with cable. I tried NRF24 but with those smd modules I can't get more than 6-7 meters. I have to try to add a longer antenna

                      B 1 Reply Last reply
                      0
                      • gohanG gohan

                        Cable will always be better that wireless, so if you can go with cable. I tried NRF24 but with those smd modules I can't get more than 6-7 meters. I have to try to add a longer antenna

                        B Offline
                        B Offline
                        boozz
                        wrote on last edited by
                        #53

                        @gohan
                        In some cases 'with cable' is the better option. In some cases wireless is the better option. I totally disagree with you on your statement that cable will be ALWAYS be better than wireless. that's nonsense!

                        There are good NRF24 modules out there and there are worse variants, maybe fake ones. I've bought from several ebay stores throughout time. I found out the hard way that some perform good with a 100uF capacitor attached (the simplest variants, costing no more than $0.85), and other perform better with a smaller size capacitor (4.7uF). I get distances with these modules over more than 25 mtrs. with all kinds of obstructions (even faraday alike) in between. All it takes is some (hobby) time to find out what works best (e.g. move a node 1 meter to the left or right or align the antenna somewhat...)
                        I never ever modified an antenna, never needed to do so. I once bought 2 nrf24L01+-PA-LNA antenna's for wider coverage as I thought I would need that for better/wider coverage, but now, 2 years later, they still are lying around in my workshop.

                        Maybe good to say that these distances can only be achieved with a speed set at 250 kBs and this is only possible using the nrf24L01+ modules!

                        If I can, I use wireless, as it is cheap, simple, and convenient, but the best reason for going wireless is that I don't need to use a cable! Simple as that.

                        For the sake of staying somewhat on topic ("Building a wired RS485 sensor network")...
                        There are occasions in which a wired (RS485) network would be the better choice. In my opinion one occasion is when you need instantly acknowledge that a command really was delivered to a node.

                        BR,

                        Boozz

                        R gohanG 2 Replies Last reply
                        0
                        • R Offline
                          R Offline
                          Reza
                          wrote on last edited by Reza
                          #54

                          @wimd
                          how long wiring can i use between a node and gateway with rs485 (without repeater)? how many node can support ? delay for send and receive for nrf24 is more or rs485 ? thank you

                          1 Reply Last reply
                          0
                          • B boozz

                            @gohan
                            In some cases 'with cable' is the better option. In some cases wireless is the better option. I totally disagree with you on your statement that cable will be ALWAYS be better than wireless. that's nonsense!

                            There are good NRF24 modules out there and there are worse variants, maybe fake ones. I've bought from several ebay stores throughout time. I found out the hard way that some perform good with a 100uF capacitor attached (the simplest variants, costing no more than $0.85), and other perform better with a smaller size capacitor (4.7uF). I get distances with these modules over more than 25 mtrs. with all kinds of obstructions (even faraday alike) in between. All it takes is some (hobby) time to find out what works best (e.g. move a node 1 meter to the left or right or align the antenna somewhat...)
                            I never ever modified an antenna, never needed to do so. I once bought 2 nrf24L01+-PA-LNA antenna's for wider coverage as I thought I would need that for better/wider coverage, but now, 2 years later, they still are lying around in my workshop.

                            Maybe good to say that these distances can only be achieved with a speed set at 250 kBs and this is only possible using the nrf24L01+ modules!

                            If I can, I use wireless, as it is cheap, simple, and convenient, but the best reason for going wireless is that I don't need to use a cable! Simple as that.

                            For the sake of staying somewhat on topic ("Building a wired RS485 sensor network")...
                            There are occasions in which a wired (RS485) network would be the better choice. In my opinion one occasion is when you need instantly acknowledge that a command really was delivered to a node.

                            BR,

                            Boozz

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

                            @boozz
                            how detect a fake radio with a original radio ?

                            B 1 Reply Last reply
                            0
                            • B boozz

                              @gohan
                              In some cases 'with cable' is the better option. In some cases wireless is the better option. I totally disagree with you on your statement that cable will be ALWAYS be better than wireless. that's nonsense!

                              There are good NRF24 modules out there and there are worse variants, maybe fake ones. I've bought from several ebay stores throughout time. I found out the hard way that some perform good with a 100uF capacitor attached (the simplest variants, costing no more than $0.85), and other perform better with a smaller size capacitor (4.7uF). I get distances with these modules over more than 25 mtrs. with all kinds of obstructions (even faraday alike) in between. All it takes is some (hobby) time to find out what works best (e.g. move a node 1 meter to the left or right or align the antenna somewhat...)
                              I never ever modified an antenna, never needed to do so. I once bought 2 nrf24L01+-PA-LNA antenna's for wider coverage as I thought I would need that for better/wider coverage, but now, 2 years later, they still are lying around in my workshop.

                              Maybe good to say that these distances can only be achieved with a speed set at 250 kBs and this is only possible using the nrf24L01+ modules!

                              If I can, I use wireless, as it is cheap, simple, and convenient, but the best reason for going wireless is that I don't need to use a cable! Simple as that.

                              For the sake of staying somewhat on topic ("Building a wired RS485 sensor network")...
                              There are occasions in which a wired (RS485) network would be the better choice. In my opinion one occasion is when you need instantly acknowledge that a command really was delivered to a node.

                              BR,

                              Boozz

                              gohanG Offline
                              gohanG Offline
                              gohan
                              Mod
                              wrote on last edited by
                              #56

                              @boozz

                              I said it's better because in terms of stability and reliability you can't beat cable and I also added that if he can use a cable to go with it otherwise wireless it's still an option, but as you said it takes time and trial and error to make good use of those nrf24 especially for the reason that there are lots of clones on the market that behave slightly differently from one another and thus adding more complexity to the project.
                              In addition once you have a cable you can also use it for power.
                              Of course cable is not the universal solution for all the problems, but if I had to choose between a wired or wireless security system I'd choose wired and if I would need to have a temperature sensor that reports data every now and then I'd go most likely wireless

                              B 1 Reply Last reply
                              0
                              • gohanG gohan

                                @boozz

                                I said it's better because in terms of stability and reliability you can't beat cable and I also added that if he can use a cable to go with it otherwise wireless it's still an option, but as you said it takes time and trial and error to make good use of those nrf24 especially for the reason that there are lots of clones on the market that behave slightly differently from one another and thus adding more complexity to the project.
                                In addition once you have a cable you can also use it for power.
                                Of course cable is not the universal solution for all the problems, but if I had to choose between a wired or wireless security system I'd choose wired and if I would need to have a temperature sensor that reports data every now and then I'd go most likely wireless

                                B Offline
                                B Offline
                                boozz
                                wrote on last edited by
                                #57

                                @gohan
                                My reaction was only based on your last post in this tread :relaxed:, I totally agree with you on the wired security system where wireless is not an option.

                                1 Reply Last reply
                                0
                                • R Reza

                                  @boozz
                                  how detect a fake radio with a original radio ?

                                  B Offline
                                  B Offline
                                  boozz
                                  wrote on last edited by boozz
                                  #58

                                  @Reza
                                  There are many options for detecting fake radio's. For me it works best to test them in a node that has a good working radio attached (preferrably far as far away from its parent node as possible) and exchange it with the suspected fake one.

                                  There's also a thread in this forum that describes a method to test the quality of nrf24L01+ connections. It's a quality meter. I know for sure you can find this one using the search function.

                                  By the way; about the wiring distance between a node and gateway: the fastest way to get an answer is to get multiple answers on such questions is using an universal search engine: www.google.com

                                  gohanG 1 Reply Last reply
                                  0
                                  • B boozz

                                    @Reza
                                    There are many options for detecting fake radio's. For me it works best to test them in a node that has a good working radio attached (preferrably far as far away from its parent node as possible) and exchange it with the suspected fake one.

                                    There's also a thread in this forum that describes a method to test the quality of nrf24L01+ connections. It's a quality meter. I know for sure you can find this one using the search function.

                                    By the way; about the wiring distance between a node and gateway: the fastest way to get an answer is to get multiple answers on such questions is using an universal search engine: www.google.com

                                    gohanG Offline
                                    gohanG Offline
                                    gohan
                                    Mod
                                    wrote on last edited by
                                    #59

                                    @boozz
                                    What are the codes on the NRF24 chip of the modules you consider being the best performing?

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

                                      @gohan

                                      There is no easy way of telling by looking at it.

                                      https://forum.mysensors.org/topic/1664/which-are-the-best-nrf24l01-modules

                                      1 Reply Last reply
                                      1
                                      • R Offline
                                        R Offline
                                        Reza
                                        wrote on last edited by
                                        #61

                                        for wiring , is this true ?
                                        rs485...............arduino
                                        vcc......................5v
                                        gnd....................gnd
                                        DI.........................9
                                        DE........................2
                                        RE.......................10
                                        R0........................8

                                        K 2 Replies Last reply
                                        0
                                        • R Reza

                                          for wiring , is this true ?
                                          rs485...............arduino
                                          vcc......................5v
                                          gnd....................gnd
                                          DI.........................9
                                          DE........................2
                                          RE.......................10
                                          R0........................8

                                          K Offline
                                          K Offline
                                          kimot
                                          wrote on last edited by
                                          #62

                                          @Reza

                                          DI and DO depends on your board type.
                                          Look at AltSoftSerial_Boards.h
                                          DE and RE should be connected together and connected to pin,
                                          which is defined in your program:
                                          #define MY_RS485_DE_PIN 2

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


                                          5

                                          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