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. nRF5 action!

nRF5 action!

Scheduled Pinned Locked Moved My Project
1.9k Posts 49 Posters 658.4k Views 44 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.
  • T Offline
    T Offline
    Toyman
    wrote on last edited by
    #588

    How can I redefine UART pins in nrf51822? For example, if I want to have p13 as uart tx?

    scalzS 1 Reply Last reply
    0
    • T Toyman

      How can I redefine UART pins in nrf51822? For example, if I want to have p13 as uart tx?

      scalzS Offline
      scalzS Offline
      scalz
      Hardware Contributor
      wrote on last edited by
      #589

      @Toyman
      it has been explained above in the topic ;)
      you have to follow

      • https://github.com/mysensors/ArduinoBoards
      • https://github.com/mysensors/ArduinoHwNRF5
      T 1 Reply Last reply
      0
      • scalzS scalz

        I don't think sendSignalStrength function is implemented yet, but you should be able to get this info with:

        int16_t transportGetSendingRSSI(void)
        int16_t transportGetReceivingRSSI(void)
        
        rmtuckerR Offline
        rmtuckerR Offline
        rmtucker
        wrote on last edited by
        #590

        @scalz
        Rssi works really well.
        Thank you.

        rmtuckerR 1 Reply Last reply
        1
        • rmtuckerR rmtucker

          @scalz
          Rssi works really well.
          Thank you.

          rmtuckerR Offline
          rmtuckerR Offline
          rmtucker
          wrote on last edited by
          #591

          So range test.
          Using esp8266 with standard nrf24 not amplified gateway at one end of the house.
          Nrf51822 node in garage which is not fastened to house so at a guess 15m through 3 brick walls is reporting -86db.
          I think that is quite respectable.;-)

          1 Reply Last reply
          0
          • scalzS scalz

            @Toyman
            it has been explained above in the topic ;)
            you have to follow

            • https://github.com/mysensors/ArduinoBoards
            • https://github.com/mysensors/ArduinoHwNRF5
            T Offline
            T Offline
            Toyman
            wrote on last edited by
            #592

            @scalz thx.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              Omemanti
              wrote on last edited by
              #593

              Regarding the PCB/KiCad comments.
              I was trying out KiCad and copied the NRF52832 DC/DC schematic from the datasheet.

              It might be of help for someone.
              https://github.com/Omemanti/KiCAD/tree/master/NRF52832

              PS. been at KiCad for a couple of hours, been used to Eagle, so please double check.

              1 Reply Last reply
              0
              • rmtuckerR rmtucker

                @NeverDie
                As mentioned earlier by someone the nrf52 is preset to 0.6v internal ref and a 1/5 divider so 0 - 3v is the max input so your calculation is correct.
                The nrf51 is different because the ref can be set to a few different settings but the default is vdd.

                NeverDieN Offline
                NeverDieN Offline
                NeverDie
                Hero Member
                wrote on last edited by NeverDie
                #594

                @rmtucker said in nRF5 Bluetooth action!:

                @NeverDie
                As mentioned earlier by someone the nrf52 is preset to 0.6v internal ref and a 1/5 divider so 0 - 3v is the max input so your calculation is correct.
                The nrf51 is different because the ref can be set to a few different settings but the default is vdd.

                I've lately found that I seem to get a more accurate measurement if I multiply by 3131 instead of 3000. Just an empirical result with no real theory behind it.

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

                  I don't know if it is actually related, but I'll post the link to this programmer :)
                  adafruit.com/product/3571

                  Nca78N 1 Reply Last reply
                  1
                  • NeverDieN Offline
                    NeverDieN Offline
                    NeverDie
                    Hero Member
                    wrote on last edited by NeverDie
                    #596

                    What's going to be the best way to reduce the sleep current and Tx current on the nRF52? Since I'm feeding off a supercap for power, it's noticeably worse (by an order of magnitude) on the same task than the atmega328p+rfm69 combo. I've already increased the datarate to 2mbps, and it's inherently lower Tx current should give it a natural advantage.

                    I guess I'll try reducing Tx power and see if that makes much of a dent....

                    I suppose reducing 3 separate packets to one single packet, and maybe turning off ACK requests might also help. Then, maybe all of the LONG_WAIT's can be eliminated. Is the radio still awake even if the CPU is sleeping during a "wait" period? If so, that might be a large chunk of the wasted power.

                    I wonder if the mysensors mesh networking (which I don't intend to use) might be getting in the way, and possibly keeping it awake longer than it otherwise would be? Can I disable the mysensors meshnetworking just to be sure?

                    Sorry for the shotgun blast of questions, but I'm trying to get a sense of what will yield the highest payoff.

                    rmtuckerR 1 Reply Last reply
                    0
                    • NeverDieN Offline
                      NeverDieN Offline
                      NeverDie
                      Hero Member
                      wrote on last edited by NeverDie
                      #597

                      Since I'll be reducing Tx power in an attempt to reduce current consumption, I'll be using a scanner program to try to find empty channels. The only one I know of is: https://github.com/nRF24/RF24/tree/master/examples/scanner
                      for the nRF24L01, but it seems to work well enough if you let it run awhile. Anyone else using one that they like?

                      NeverDieN 1 Reply Last reply
                      0
                      • NeverDieN NeverDie

                        Since I'll be reducing Tx power in an attempt to reduce current consumption, I'll be using a scanner program to try to find empty channels. The only one I know of is: https://github.com/nRF24/RF24/tree/master/examples/scanner
                        for the nRF24L01, but it seems to work well enough if you let it run awhile. Anyone else using one that they like?

                        NeverDieN Offline
                        NeverDieN Offline
                        NeverDie
                        Hero Member
                        wrote on last edited by NeverDie
                        #598

                        @NeverDie said in nRF5 Bluetooth action!:

                        Since I'll be reducing Tx power in an attempt to reduce current consumption, I'll be using a scanner program to try to find empty channels. The only one I know of is: https://github.com/nRF24/RF24/tree/master/examples/scanner
                        for the nRF24L01, but it seems to work well enough if you let it run awhile. Anyone else using one that they like?

                        Nevermind. I see now that there's an entire entry on it:
                        https://forum.mysensors.org/topic/2454/node-cant-see-gateway-less-than-10m-away/11

                        1 Reply Last reply
                        1
                        • gohanG gohan

                          I don't know if it is actually related, but I'll post the link to this programmer :)
                          adafruit.com/product/3571

                          Nca78N Offline
                          Nca78N Offline
                          Nca78
                          Hardware Contributor
                          wrote on last edited by
                          #599

                          @gohan said in nRF5 Bluetooth action!:

                          I don't know if it is actually related, but I'll post the link to this programmer :)
                          adafruit.com/product/3571

                          Not sure it's even legal to use this if you ever plan to sell PCBs on openhardware.io ...

                          You may use the J-Link EDU for non profit educational purposes only! Non-profit educational purposes means that you >may not use the J-Link EDU and its J-Link software.

                          • direct or indirect in or for a profit organization or business purposes or other undertaking intended for profit
                          • direct or indirect in any other commercial environment (e.g. office)
                          • to develop, debug, program or manufacturer a commercial product (or parts thereof)
                          • to use it to either earn money or reasonably anticipate the receipt of monetary gain from it.
                          gohanG 1 Reply Last reply
                          0
                          • Nca78N Nca78

                            @gohan said in nRF5 Bluetooth action!:

                            I don't know if it is actually related, but I'll post the link to this programmer :)
                            adafruit.com/product/3571

                            Not sure it's even legal to use this if you ever plan to sell PCBs on openhardware.io ...

                            You may use the J-Link EDU for non profit educational purposes only! Non-profit educational purposes means that you >may not use the J-Link EDU and its J-Link software.

                            • direct or indirect in or for a profit organization or business purposes or other undertaking intended for profit
                            • direct or indirect in any other commercial environment (e.g. office)
                            • to develop, debug, program or manufacturer a commercial product (or parts thereof)
                            • to use it to either earn money or reasonably anticipate the receipt of monetary gain from it.
                            gohanG Offline
                            gohanG Offline
                            gohan
                            Mod
                            wrote on last edited by gohan
                            #600

                            @Nca78 Educational versions of many things can not be used for commercial purposes, maybe they got an agreement as it will be sold primarily to hobbyists.

                            1 Reply Last reply
                            0
                            • NeverDieN Offline
                              NeverDieN Offline
                              NeverDie
                              Hero Member
                              wrote on last edited by NeverDie
                              #601

                              In my testing, NRF5_PA_LOW did offer some modest reduction in overall current consumption, but it's no silver bullet.

                              The range with NRF5_PA_MIN is just a few feet, so I don't consider it practical for the vast majority of use cases.

                              So, further reductions in current consumption will have to come from somewhere (?) else.

                              I suppose the next step is to turn-off auto ACK's and any listening for ACK's by the mote. Hopefully (?) there's a switch in myconfig which does that.

                              1 Reply Last reply
                              0
                              • d00616D Offline
                                d00616D Offline
                                d00616
                                Contest Winner
                                wrote on last edited by
                                #602

                                I have checked the current with my nRF52 board with integrated shunt. I have measured 6.5µA while sleeping until timeout or sleeping until interrupt. It doesn't matter if RX/TX are connected but after flashing the firmware a reset by removing the voltage is required.

                                There was an bug, with any type of sleep(0) which is fixed by this PR https://github.com/mysensors/MySensors/pull/909

                                rmtuckerR 1 Reply Last reply
                                0
                                • NeverDieN Offline
                                  NeverDieN Offline
                                  NeverDie
                                  Hero Member
                                  wrote on last edited by
                                  #603

                                  Unless I'm doing it unwittingly, I'm not doing any sleep(0)'s at present.

                                  1 Reply Last reply
                                  0
                                  • NeverDieN Offline
                                    NeverDieN Offline
                                    NeverDie
                                    Hero Member
                                    wrote on last edited by NeverDie
                                    #604

                                    I'm finding that having a very simple adapter board, such as that in the photo here, is quite convenient both for programming and for powering the nRF52832, and for wiring-up prototypes. I made my breakout board for breadboards, but those connections are always just too flakey. Maybe I need to use better breadboards? Anyhow, this meets the requirement for reliable, solid connections.
                                    0_1502636407342_nRF52_adapter.jpg

                                    1 Reply Last reply
                                    0
                                    • NeverDieN Offline
                                      NeverDieN Offline
                                      NeverDie
                                      Hero Member
                                      wrote on last edited by
                                      #605

                                      I removed this useless block of code from the main loop, which, with its long waits, may have been what was draining the power:

                                      	Serial.println("");
                                      	Serial.println("");
                                      	Serial.println("");
                                      	Serial.println("#########################");
                                      	randNumber=random(0,101);
                                      
                                      	Serial.print("RandomNumber:");
                                      	Serial.println(randNumber);
                                      	// Send fake battery level
                                      	Serial.println("Send Battery Level");
                                      	sendBatteryLevel(randNumber);
                                      	wait(LONG_WAIT);
                                      
                                      	// Request time
                                      	Serial.println("Request Time");
                                      	requestTime();
                                      	wait(LONG_WAIT);
                                      
                                      1 Reply Last reply
                                      0
                                      • NeverDieN NeverDie

                                        What's going to be the best way to reduce the sleep current and Tx current on the nRF52? Since I'm feeding off a supercap for power, it's noticeably worse (by an order of magnitude) on the same task than the atmega328p+rfm69 combo. I've already increased the datarate to 2mbps, and it's inherently lower Tx current should give it a natural advantage.

                                        I guess I'll try reducing Tx power and see if that makes much of a dent....

                                        I suppose reducing 3 separate packets to one single packet, and maybe turning off ACK requests might also help. Then, maybe all of the LONG_WAIT's can be eliminated. Is the radio still awake even if the CPU is sleeping during a "wait" period? If so, that might be a large chunk of the wasted power.

                                        I wonder if the mysensors mesh networking (which I don't intend to use) might be getting in the way, and possibly keeping it awake longer than it otherwise would be? Can I disable the mysensors meshnetworking just to be sure?

                                        Sorry for the shotgun blast of questions, but I'm trying to get a sense of what will yield the highest payoff.

                                        rmtuckerR Offline
                                        rmtuckerR Offline
                                        rmtucker
                                        wrote on last edited by
                                        #606

                                        @NeverDie
                                        When you are comparing the atmega 328 and the nrf52 what sketch are you using to come to your conclusions?.

                                        NeverDieN 1 Reply Last reply
                                        0
                                        • rmtuckerR rmtucker

                                          @NeverDie
                                          When you are comparing the atmega 328 and the nrf52 what sketch are you using to come to your conclusions?.

                                          NeverDieN Offline
                                          NeverDieN Offline
                                          NeverDie
                                          Hero Member
                                          wrote on last edited by NeverDie
                                          #607

                                          @rmtucker said in nRF5 Bluetooth action!:

                                          @NeverDie
                                          When you are comparing the atmega 328 and the nrf52 what sketch are you using to come to your conclusions?.

                                          A solar mote which reports the voltage on the supercap and the unloaded voltage on the solar panel.

                                          The goal is to get the mote to be a solar powered remote, where it will wake up and listen for a packet once every 100ms and then go back to sleep if it doesn't receive one inside a very narrow window of time. That window can be a lot narrower on the nRF52302, because it supports 2Mbps, whereas the RFM69 can support at most 300kbps. I got the atmega328p+rfm69 to do that (although it required a larger than 10F supercap to get through the night), and it worked. At the present moment, though, I don't think the nrf52 can do it, unless I were to use an even bigger supercap and more than one mini solar panel. The potential to do it is there though. I just need to drive it better.

                                          I think a high priority is to get the DCDC working on the nRF52.
                                          That should cut the higher currents (such as during Tx and Rx) by about half, as discussed earlier in this thread.

                                          BTW, removing the above block of code did help appreciably.

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


                                          20

                                          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