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. Hardware
  3. In wall light switch node - Custom PCB

In wall light switch node - Custom PCB

Scheduled Pinned Locked Moved Hardware
custompcbinwallnodelight switchswitch
245 Posts 15 Posters 132.7k Views 23 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.
  • S Samuel235

    @m26872 From having a quick look at your guide, you bring your clock speed right down to 1MHz, am i correct in thinking this? Do you have any timing issues at all, is the node still quick enough to respond to switching and sensor detecting or is there a delay in the signal sending?

    m26872M Offline
    m26872M Offline
    m26872
    Hardware Contributor
    wrote on last edited by
    #105

    @samuel235 Yes, it's working. But you can't use some things like DS18B20s and DHTs at these low frequencies. Si7021 etc are used instead. Button switches and other simple things are exellent applications.

    S 1 Reply Last reply
    0
    • m26872M m26872

      @samuel235 Yes, it's working. But you can't use some things like DS18B20s and DHTs at these low frequencies. Si7021 etc are used instead. Button switches and other simple things are exellent applications.

      S Offline
      S Offline
      Samuel235
      Hardware Contributor
      wrote on last edited by Samuel235
      #106

      @m26872 - Well, I was planning on maybe having a temp sensor in there at some point, but not this revision. So if i went without that function at the moment it wouldn't be the end of the world, i would just revise even more for the next revision. I'm presuming that you have taken it to 1MHz for power saving or?

      This is the configuration i'm thinking:

      ######## settings for 8Mhz internal clock

      proMYSBL8.name=ATmega328 internal 8Mhz with MYSBootloader
      proMYSBL8.upload.tool=avrdude
      proMYSBL8.upload.protocol=arduino
      proMYSBL8.upload.maximum_size=30720
      proMYSBL8.upload.maximum_data_size=2048
      proMYSBL8.upload.speed=57600
      proMYSBL8.bootloader.tool=avrdude
      proMYSBL8.bootloader.low_fuses=0x42
      proMYSBL8.bootloader.high_fuses=0xDE
      proMYSBL8.bootloader.extended_fuses=0xFF
      proMYSBL8.bootloader.unlock_bits=0x3F
      proMYSBL8.bootloader.lock_bits=0x3F
      proMYSBL8.bootloader.file=MySensors/MYSBootloader.hex
      proMYSBL8.build.mcu=atmega328p
      proMYSBL8.build.f_cpu=8000000L
      proMYSBL8.build.board=AVR_UNO
      proMYSBL8.build.core=arduino
      proMYSBL8.build.variant=standard

      That would remove the brownout, enable SPI, and put the clock to 8MHz. What is your thoughts on this config?

      MySensors 2.1.1
      Controller - OpenHAB (Virtual Machine)
      Gateway - Arduino Mega MQTT Gateway W5100

      m26872M 1 Reply Last reply
      0
      • S Samuel235

        @m26872 - Well, I was planning on maybe having a temp sensor in there at some point, but not this revision. So if i went without that function at the moment it wouldn't be the end of the world, i would just revise even more for the next revision. I'm presuming that you have taken it to 1MHz for power saving or?

        This is the configuration i'm thinking:

        ######## settings for 8Mhz internal clock

        proMYSBL8.name=ATmega328 internal 8Mhz with MYSBootloader
        proMYSBL8.upload.tool=avrdude
        proMYSBL8.upload.protocol=arduino
        proMYSBL8.upload.maximum_size=30720
        proMYSBL8.upload.maximum_data_size=2048
        proMYSBL8.upload.speed=57600
        proMYSBL8.bootloader.tool=avrdude
        proMYSBL8.bootloader.low_fuses=0x42
        proMYSBL8.bootloader.high_fuses=0xDE
        proMYSBL8.bootloader.extended_fuses=0xFF
        proMYSBL8.bootloader.unlock_bits=0x3F
        proMYSBL8.bootloader.lock_bits=0x3F
        proMYSBL8.bootloader.file=MySensors/MYSBootloader.hex
        proMYSBL8.build.mcu=atmega328p
        proMYSBL8.build.f_cpu=8000000L
        proMYSBL8.build.board=AVR_UNO
        proMYSBL8.build.core=arduino
        proMYSBL8.build.variant=standard

        That would remove the brownout, enable SPI, and put the clock to 8MHz. What is your thoughts on this config?

        m26872M Offline
        m26872M Offline
        m26872
        Hardware Contributor
        wrote on last edited by
        #107

        @samuel235

        • You'll need low MHz for ot to work when battery runs out and voltage decreases.
        • Those fuses are for 1MHz, not for 8MHz.
        • I've never used MYSBootloader. Someone else has to confirm the settings if you use this.
        S 1 Reply Last reply
        0
        • m26872M m26872

          @samuel235

          • You'll need low MHz for ot to work when battery runs out and voltage decreases.
          • Those fuses are for 1MHz, not for 8MHz.
          • I've never used MYSBootloader. Someone else has to confirm the settings if you use this.
          S Offline
          S Offline
          Samuel235
          Hardware Contributor
          wrote on last edited by
          #108

          @m26872

          Lower clock speed would last through the low power phase of the battery. Obviously, thank you for pointing that out! However, I'm looking at Maniacs battery testing graph and the battery is stable down to around 2.4v for around 150 hours, then it will rapidly drop off to 0v, so I'm thinking "is the lower clock speed really worth the extra 10 hours of use?".

          The fuses, although I am going off of what you suggested, i entered them into my fuse calculator and its showing up at 8MHz, with no modification needed to the speed.... I'm a little confused at this part as you have now said that those fuses are for 1MHz.

          I'm now wondering if its worth using MYSBootloader or the one you used, I can see that you used this and programmed through the Arduino IDE, from your post you said you're more comfortable with using the Arduino IDE (Which i am too, but can adapt if needed).

          MySensors 2.1.1
          Controller - OpenHAB (Virtual Machine)
          Gateway - Arduino Mega MQTT Gateway W5100

          m26872M 1 Reply Last reply
          0
          • scalzS Offline
            scalzS Offline
            scalz
            Hardware Contributor
            wrote on last edited by scalz
            #109

            @samuel235: don't worry about 1mhz...there is no big difference 1Mhz vs 8Mhz at 3V in deepsleep mode. In deepsleep mode, at 3V 8Mhz internal rc, you can get 140nA. So you can't have such interesting diff.
            In other hand, if node is wake up, you are in mA range, and here it can be interesting to play between clock and voltage ;) you can do it on the fly in sketch and it's good to know that for timing things, atmel clock and voltage are linked.
            So i would suggest you to stay with internal rc 8Mhz, BOD 1.8V and MYSBootloader. If I remember right it should be ok. Other thing good to know, you can disable BOD=0V when in deepsleepmode (this is done like this in lib I think), but it's not a good practice to disable it when wake up. Keep 1.8V limit, it can prevent some bugs..All is described in datasheet ;)

            Another thing good to know, as I see lot of peope estimation for coincell...there are lot of chance that you can't get the full coincell capacity, depending on the application, the use. A common "prevision is to plan 80% of its capacity. It's due to the rate of discharge of battery and coincell's one is small..
            There are lot of others resources on the subjects but here few links :
            https://www.dmcinfo.com/Portals/0/Blog Files/High pulse drain impact on CR2032 coin cell battery capacity.pdf
            http://www.embedded.com/electronics-blogs/break-points/4429960/How-much-energy-can-you-really-get-from-a-coin-cell-
            http://www.ti.com/lit/wp/swra349/swra349.pdf

            S m26872M 2 Replies Last reply
            0
            • scalzS scalz

              @samuel235: don't worry about 1mhz...there is no big difference 1Mhz vs 8Mhz at 3V in deepsleep mode. In deepsleep mode, at 3V 8Mhz internal rc, you can get 140nA. So you can't have such interesting diff.
              In other hand, if node is wake up, you are in mA range, and here it can be interesting to play between clock and voltage ;) you can do it on the fly in sketch and it's good to know that for timing things, atmel clock and voltage are linked.
              So i would suggest you to stay with internal rc 8Mhz, BOD 1.8V and MYSBootloader. If I remember right it should be ok. Other thing good to know, you can disable BOD=0V when in deepsleepmode (this is done like this in lib I think), but it's not a good practice to disable it when wake up. Keep 1.8V limit, it can prevent some bugs..All is described in datasheet ;)

              Another thing good to know, as I see lot of peope estimation for coincell...there are lot of chance that you can't get the full coincell capacity, depending on the application, the use. A common "prevision is to plan 80% of its capacity. It's due to the rate of discharge of battery and coincell's one is small..
              There are lot of others resources on the subjects but here few links :
              https://www.dmcinfo.com/Portals/0/Blog Files/High pulse drain impact on CR2032 coin cell battery capacity.pdf
              http://www.embedded.com/electronics-blogs/break-points/4429960/How-much-energy-can-you-really-get-from-a-coin-cell-
              http://www.ti.com/lit/wp/swra349/swra349.pdf

              S Offline
              S Offline
              Samuel235
              Hardware Contributor
              wrote on last edited by Samuel235
              #110

              @scalz This is the information that was much needed. Right, so my settings are going to be:

              ######## settings for 8Mhz internal clock

              proMYSBL8.name=ATmega328 internal 8Mhz with MYSBootloader
              proMYSBL8.upload.tool=avrdude
              proMYSBL8.upload.protocol=arduino
              proMYSBL8.upload.maximum_size=30720
              proMYSBL8.upload.maximum_data_size=2048
              proMYSBL8.upload.speed=57600
              proMYSBL8.bootloader.tool=avrdude
              proMYSBL8.bootloader.low_fuses=0x62
              proMYSBL8.bootloader.high_fuses=0xD9
              proMYSBL8.bootloader.extended_fuses=0xFE
              proMYSBL8.bootloader.unlock_bits=0x3F
              proMYSBL8.bootloader.lock_bits=0x3F
              proMYSBL8.bootloader.file=MySensors/MYSBootloader.hex
              proMYSBL8.build.mcu=atmega328p
              proMYSBL8.build.f_cpu=8000000L
              proMYSBL8.build.board=AVR_UNO
              proMYSBL8.build.core=arduino
              proMYSBL8.build.variant=standard

              At the moment the fuses are set using Hexadecimal notation, I'm sure that I read somewhere that to burn this using a Arduino IDE you need to use normal binary rather than Hex. Do you know if Hex is okay for Arduino IDE?

              I've got those fuses set to enable 1.8v BoD, 8MHz clock with a 65ms delay on startup. This will use MYSBootloader too. Does this sound okay to now edit my boards.txt, and burn the MYSBootloader.hex file to the chip? I'm using a USBASP device connected to my ISP connection. Am i forgetting anything at all here? As far as I'm aware of, i now plug the board and USBASP into my computer, load the .hex file into arduino IDE and burn using the board config i have put into my boards.txt file. Then i can use my FTDI adapter to then burn sketches to the board through the arduino IDE?

              I know that to some people I may be asking what seems like the same questions over and over but I'm starting to feel very confident with embedded chips now. Thank you!

              MySensors 2.1.1
              Controller - OpenHAB (Virtual Machine)
              Gateway - Arduino Mega MQTT Gateway W5100

              1 Reply Last reply
              0
              • scalzS Offline
                scalzS Offline
                scalz
                Hardware Contributor
                wrote on last edited by
                #111

                no problem :) yes, it sounds ok...that's how I do too. But I don't use mysbootloader, i use dualoptiboot (sensebender bootloader). for the hex/bin fuse notation, I use hexa.

                S 1 Reply Last reply
                0
                • S Samuel235

                  @m26872

                  Lower clock speed would last through the low power phase of the battery. Obviously, thank you for pointing that out! However, I'm looking at Maniacs battery testing graph and the battery is stable down to around 2.4v for around 150 hours, then it will rapidly drop off to 0v, so I'm thinking "is the lower clock speed really worth the extra 10 hours of use?".

                  The fuses, although I am going off of what you suggested, i entered them into my fuse calculator and its showing up at 8MHz, with no modification needed to the speed.... I'm a little confused at this part as you have now said that those fuses are for 1MHz.

                  I'm now wondering if its worth using MYSBootloader or the one you used, I can see that you used this and programmed through the Arduino IDE, from your post you said you're more comfortable with using the Arduino IDE (Which i am too, but can adapt if needed).

                  m26872M Offline
                  m26872M Offline
                  m26872
                  Hardware Contributor
                  wrote on last edited by
                  #112

                  @samuel235

                  • You could be rigth regarding the battery. I've no coin cell experience.
                  • You noticed the check mark by the 'divide clock by 8' ?
                  • If you by 'program' normal ftdi flash, then yes. I didn't program bootloader with Arduino.
                  1 Reply Last reply
                  0
                  • scalzS scalz

                    no problem :) yes, it sounds ok...that's how I do too. But I don't use mysbootloader, i use dualoptiboot (sensebender bootloader). for the hex/bin fuse notation, I use hexa.

                    S Offline
                    S Offline
                    Samuel235
                    Hardware Contributor
                    wrote on last edited by
                    #113

                    @scalz

                    Is there a reason to use dualoptiboot over MYSBootloader or is that just something you did for no reason?

                    Did you use Arduino IDE to burn your bootloader, if so then i can confirm its okay to use Hexa for my board with arduino IDE, if you didn't i will have to convert it to normal binary.

                    @m26872

                    I have just realised that you burn your bootloader with the check mark of 8MHz but then the board.txt is configured to set it to 1MHz, is that what you're trying to tell me? I'm not too sure on your last point, i don't get what you're trying to say if i'm honest, could you elaborate a little? Sorry.

                    MySensors 2.1.1
                    Controller - OpenHAB (Virtual Machine)
                    Gateway - Arduino Mega MQTT Gateway W5100

                    1 Reply Last reply
                    0
                    • scalzS Offline
                      scalzS Offline
                      scalz
                      Hardware Contributor
                      wrote on last edited by
                      #114

                      @samuel235: yes, always good reasons ;) I have tried both. both works well. I like the "buffer style" of dualoptiboot. plus no mysensors lib in bootloader, few others reasons...but mysbootloader is very cool too and simple. So don't worry about this :) it's a matter of taste, each have their pros&cons.
                      Yes, use arduino ide to burn bootloader + hexa is ok.

                      S 1 Reply Last reply
                      0
                      • scalzS scalz

                        @samuel235: yes, always good reasons ;) I have tried both. both works well. I like the "buffer style" of dualoptiboot. plus no mysensors lib in bootloader, few others reasons...but mysbootloader is very cool too and simple. So don't worry about this :) it's a matter of taste, each have their pros&cons.
                        Yes, use arduino ide to burn bootloader + hexa is ok.

                        S Offline
                        S Offline
                        Samuel235
                        Hardware Contributor
                        wrote on last edited by
                        #115

                        @scalz - Perfect. I will see how i get on with the MYSBootloader style. Soon as i get back i will burn these settings to my uC and see how i get on. I will come back with the results when i'm done. :)

                        MySensors 2.1.1
                        Controller - OpenHAB (Virtual Machine)
                        Gateway - Arduino Mega MQTT Gateway W5100

                        m26872M 2 Replies Last reply
                        0
                        • scalzS scalz

                          @samuel235: don't worry about 1mhz...there is no big difference 1Mhz vs 8Mhz at 3V in deepsleep mode. In deepsleep mode, at 3V 8Mhz internal rc, you can get 140nA. So you can't have such interesting diff.
                          In other hand, if node is wake up, you are in mA range, and here it can be interesting to play between clock and voltage ;) you can do it on the fly in sketch and it's good to know that for timing things, atmel clock and voltage are linked.
                          So i would suggest you to stay with internal rc 8Mhz, BOD 1.8V and MYSBootloader. If I remember right it should be ok. Other thing good to know, you can disable BOD=0V when in deepsleepmode (this is done like this in lib I think), but it's not a good practice to disable it when wake up. Keep 1.8V limit, it can prevent some bugs..All is described in datasheet ;)

                          Another thing good to know, as I see lot of peope estimation for coincell...there are lot of chance that you can't get the full coincell capacity, depending on the application, the use. A common "prevision is to plan 80% of its capacity. It's due to the rate of discharge of battery and coincell's one is small..
                          There are lot of others resources on the subjects but here few links :
                          https://www.dmcinfo.com/Portals/0/Blog Files/High pulse drain impact on CR2032 coin cell battery capacity.pdf
                          http://www.embedded.com/electronics-blogs/break-points/4429960/How-much-energy-can-you-really-get-from-a-coin-cell-
                          http://www.ti.com/lit/wp/swra349/swra349.pdf

                          m26872M Offline
                          m26872M Offline
                          m26872
                          Hardware Contributor
                          wrote on last edited by m26872
                          #116

                          @scalz

                          • Don't know if good practice or not, but I run 328p + nRF down to 1.6V very stable. Could depend on a lot things and conditions of course. You said "some bugs" - do you know more what risks there are? Permanent damages etc?
                          • Do you know if the 'Divide clock by 8" (8MHz or 1MHz) also can be changed on-fly-with code? If so, does it matter which speed set by fuse and thus used at start-up?
                          • Great thanks for the coin cell info!
                          1 Reply Last reply
                          0
                          • S Samuel235

                            @scalz - Perfect. I will see how i get on with the MYSBootloader style. Soon as i get back i will burn these settings to my uC and see how i get on. I will come back with the results when i'm done. :)

                            m26872M Offline
                            m26872M Offline
                            m26872
                            Hardware Contributor
                            wrote on last edited by
                            #117

                            @samuel235 I meant that you should untick this to use 8MHz. Provided that you don't change it on-the-fly somehow.
                            0_1455459198626_klipp.PNG

                            1 Reply Last reply
                            0
                            • S Samuel235

                              @scalz - Perfect. I will see how i get on with the MYSBootloader style. Soon as i get back i will burn these settings to my uC and see how i get on. I will come back with the results when i'm done. :)

                              m26872M Offline
                              m26872M Offline
                              m26872
                              Hardware Contributor
                              wrote on last edited by
                              #118

                              @samuel235 Sorry for not elaborating. I've been mobile all day until now. And my phone also seems to have a few issues with the forum.

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                Samuel235
                                Hardware Contributor
                                wrote on last edited by
                                #119

                                @m26872 Ahh right okay, good job i caught your reply before burning it haha! So if i set it to 8MHz internal with 64ms delay and untick that divide by 8 option, that'll be good?

                                MySensors 2.1.1
                                Controller - OpenHAB (Virtual Machine)
                                Gateway - Arduino Mega MQTT Gateway W5100

                                m26872M 2 Replies Last reply
                                0
                                • S Samuel235

                                  @m26872 Ahh right okay, good job i caught your reply before burning it haha! So if i set it to 8MHz internal with 64ms delay and untick that divide by 8 option, that'll be good?

                                  m26872M Offline
                                  m26872M Offline
                                  m26872
                                  Hardware Contributor
                                  wrote on last edited by
                                  #120

                                  Yes. but don't forget to enable the boot reset vector.

                                  1 Reply Last reply
                                  0
                                  • S Samuel235

                                    @m26872 Ahh right okay, good job i caught your reply before burning it haha! So if i set it to 8MHz internal with 64ms delay and untick that divide by 8 option, that'll be good?

                                    m26872M Offline
                                    m26872M Offline
                                    m26872
                                    Hardware Contributor
                                    wrote on last edited by
                                    #121

                                    @samuel235 I have not checked if the bootloader size and baud rate matches fuse settings.

                                    S 1 Reply Last reply
                                    0
                                    • scalzS Offline
                                      scalzS Offline
                                      scalz
                                      Hardware Contributor
                                      wrote on last edited by
                                      #122

                                      @m26872:

                                      • for bod=0v, problems could be flash corruption for instance..so it's good to know (it's explained in datasheet that for instance it ensures that a flash write is completely done before reset, I think it makes sense, plus I imagine that there are some internal things with voltage levels related stuff. but I'm not a guru on this....). So my interpretation is sometimes we don't care about it for sleepmode, for instance, and sometimes in wakeup, it's important or not, depending of tasks involved...
                                        maybe I should have said a good practice is to know what you do, lol!
                                      • for prescaler, are you asking for something like this : http://www.gammon.com.au/forum/?id=11497&reply=7#reply7
                                      • glad to share what I learn :)
                                      m26872M 1 Reply Last reply
                                      0
                                      • scalzS scalz

                                        @m26872:

                                        • for bod=0v, problems could be flash corruption for instance..so it's good to know (it's explained in datasheet that for instance it ensures that a flash write is completely done before reset, I think it makes sense, plus I imagine that there are some internal things with voltage levels related stuff. but I'm not a guru on this....). So my interpretation is sometimes we don't care about it for sleepmode, for instance, and sometimes in wakeup, it's important or not, depending of tasks involved...
                                          maybe I should have said a good practice is to know what you do, lol!
                                        • for prescaler, are you asking for something like this : http://www.gammon.com.au/forum/?id=11497&reply=7#reply7
                                        • glad to share what I learn :)
                                        m26872M Offline
                                        m26872M Offline
                                        m26872
                                        Hardware Contributor
                                        wrote on last edited by
                                        #123

                                        @scalz .

                                        maybe I should have said a good practice is to know what you do, lol!

                                        l don't fulfil that either, lol! :smiley:

                                        Thanks for the prescaler info. Seems like a yes - it can be changed on-the-fly, but for me it's a No. I won't even dare to think of consequences for the rest of the software.

                                        1 Reply Last reply
                                        0
                                        • m26872M m26872

                                          @samuel235 I have not checked if the bootloader size and baud rate matches fuse settings.

                                          S Offline
                                          S Offline
                                          Samuel235
                                          Hardware Contributor
                                          wrote on last edited by
                                          #124

                                          @m26872 said:

                                          @samuel235 I have not checked if the bootloader size and baud rate matches fuse settings.

                                          I'm not 100% sure of what you mean here, on the fuse calculator there is not an option to specify the baud rate.... As for the bootloader size, the calculator is set to "Boot Flash section size=2048 words Boot start address=$3800; [BOOTSZ=00]". As this is the highest it can be I'm assuming it is correct, however i will try and check the size of the MYSBootloader.hex size and see if it is below 2048 words (Is this what this setting means?).

                                          MySensors 2.1.1
                                          Controller - OpenHAB (Virtual Machine)
                                          Gateway - Arduino Mega MQTT Gateway W5100

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


                                          21

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