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. OpenHardware.io
  3. πŸ’¬ Button size radionode with sensors swarm extension

πŸ’¬ Button size radionode with sensors swarm extension

Scheduled Pinned Locked Moved OpenHardware.io
atsha204aflashhumidityrf69lightuv lightbatterymysensortemperatureota
189 Posts 28 Posters 40.5k Views 25 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.
  • alexsh1A alexsh1

    The sensor looks more complicated that I thought:

    2.2. Ambient Light
    The Si1132 has photodiodes capable of measuring both vi
    sible and infrared light. Howe
    ver, the visible photodiode
    is also influenced by infrared light. The measurement of illuminance require
    s the same spectral response as the
    human eye. If an accurate lux measurement is desired, the
    extra IR response of the vi
    sible-light photodiode must
    be compensated. Therefore, to allow the host to make corrections to the infrared light’s influence, the Si1132
    reports the infrared light measurement on a separate channel. The separate visible and IR photodiodes lend
    themselves to a variety of algorithmic solutions. The
    host can then take these two measurements and run an
    algorithm to derive an equivalent lux level as perceive
    d by a human eye. Having
    the IR correction algorithm
    running in the host a
    llows for the most flexibility in adjusting for system-dependent
    variables. For example, if the
    glass used in the system blocks visibl
    e light more than infrared light, the
    IR correction needs to be adjusted.

    I will have to spend more time to understand how to extract the correct ambient light

    alexsh1A Offline
    alexsh1A Offline
    alexsh1
    wrote on last edited by
    #47

    The sketch I posted above contains some errors
    (it sets COFFs 0x29, 0x89, 0x02 and 0x00 to the 0x13, 0x14, 0x15 and 0x16 registers).

    The correct UCOEF values are 0x7B, 0x6B, 0x01, and 0x00

    The sensor is quite complex.

    alexsh1A 1 Reply Last reply
    0
    • alexsh1A alexsh1

      The sketch I posted above contains some errors
      (it sets COFFs 0x29, 0x89, 0x02 and 0x00 to the 0x13, 0x14, 0x15 and 0x16 registers).

      The correct UCOEF values are 0x7B, 0x6B, 0x01, and 0x00

      The sensor is quite complex.

      alexsh1A Offline
      alexsh1A Offline
      alexsh1
      wrote on last edited by
      #48

      I got the following values from the sensor:

      1. V_VOLTAGE (3.21)
      2. V_HUM (51
      3. V_TEMP (30)
      4. V_LIGHT_LEVEL (4466)
      5. V_UV (1.74)
      6. V_LIGHT_LEVEL (3367)
      7. V_LIGHT_LEVEL (3367)

      Clearly, Si1132 is not in line with BH1750. VEML6075 is giving me UV Index 1.65, which is close to the Si1132.

      Moreover, depending where it is used, the coeff in formula has to change (I am using 0.282 for the direct sunlight) :

      Visible Photodiode 
      Response
      
      Sunlight
      ALS_VIS_ADC_GAIN=0
      VIS_RANGE=0
      β€”
      0.282
      
      2500K incandescent bulb
      ALS_VIS_ADC_GAIN=0
      VIS_RANGE=0
      
      0.319
      
      β€œCool white” fluorescent 
      ALS_VIS_ADC_GAIN=0
      VIS_RANGE=0
      
      0.146
      
      
      1 Reply Last reply
      0
      • alexsh1A Offline
        alexsh1A Offline
        alexsh1
        wrote on last edited by alexsh1
        #49

        @Koresh My 2032 died in 2 days and I noticed that power consumption is 3.5mA. OK, maybe bad soldering - I desoldered Si1132, but the consumption is still 0.14mA while sleeping. For 2032 this is a huge consumption. Did you measure consumption at all? I am using CW radio

        Si1132 must be consuming around < 500 nA standby current according to the datasheet. Not sure why consumption was increased with Si1132.

        KoreshK 1 Reply Last reply
        0
        • alexsh1A alexsh1

          @Koresh My 2032 died in 2 days and I noticed that power consumption is 3.5mA. OK, maybe bad soldering - I desoldered Si1132, but the consumption is still 0.14mA while sleeping. For 2032 this is a huge consumption. Did you measure consumption at all? I am using CW radio

          Si1132 must be consuming around < 500 nA standby current according to the datasheet. Not sure why consumption was increased with Si1132.

          KoreshK Offline
          KoreshK Offline
          Koresh
          Contest Winner
          wrote on last edited by Koresh
          #50

          @alexsh1 Do not forget put BH1750 into sleep mode. Unfortunatelly standart library do not put the sensor into this mode. I described it on the github page.

            /*  Please comment out private declaration in BH1750.h 
             *   Otherwise you can't call lightMeter.write8(BH1750_POWER_DOWN); and BH1750 will not sleep!
             *   
             *  //private:
             *   void write8(uint8_t data);
             */
             
            lightMeter.write8(BH1750_POWER_DOWN);
          
          alexsh1A 1 Reply Last reply
          0
          • KoreshK Koresh

            @alexsh1 Do not forget put BH1750 into sleep mode. Unfortunatelly standart library do not put the sensor into this mode. I described it on the github page.

              /*  Please comment out private declaration in BH1750.h 
               *   Otherwise you can't call lightMeter.write8(BH1750_POWER_DOWN); and BH1750 will not sleep!
               *   
               *  //private:
               *   void write8(uint8_t data);
               */
               
              lightMeter.write8(BH1750_POWER_DOWN);
            
            alexsh1A Offline
            alexsh1A Offline
            alexsh1
            wrote on last edited by alexsh1
            #51

            @Koresh I did it on the first day I got the sensor. The consumption above is with BH1750 in the sleeping mode as per your github

            Y 1 Reply Last reply
            0
            • alexsh1A alexsh1

              @Koresh I did it on the first day I got the sensor. The consumption above is with BH1750 in the sleeping mode as per your github

              Y Offline
              Y Offline
              yury
              wrote on last edited by
              #52

              @alexsh1 said in πŸ’¬ Button size radionode with sensors swarm extension:

              it on the first day I got

              Could you post the code you use? and links for the libs. we will check tomorrow consumption with your code . mysensors 2.0 or 2.2?

              alexsh1A 1 Reply Last reply
              0
              • Y yury

                @alexsh1 said in πŸ’¬ Button size radionode with sensors swarm extension:

                it on the first day I got

                Could you post the code you use? and links for the libs. we will check tomorrow consumption with your code . mysensors 2.0 or 2.2?

                alexsh1A Offline
                alexsh1A Offline
                alexsh1
                wrote on last edited by
                #53

                @yury It is the latest bh1750 lib -> https://github.com/claws/BH1750

                I am using MySensors 2.2.0b

                I am using a default code :
                https://github.com/EasySensors/ButtonSizeNode/blob/master/ButtonSizeNode.ino

                alexsh1A KoreshK 2 Replies Last reply
                0
                • alexsh1A alexsh1

                  @yury It is the latest bh1750 lib -> https://github.com/claws/BH1750

                  I am using MySensors 2.2.0b

                  I am using a default code :
                  https://github.com/EasySensors/ButtonSizeNode/blob/master/ButtonSizeNode.ino

                  alexsh1A Offline
                  alexsh1A Offline
                  alexsh1
                  wrote on last edited by alexsh1
                  #54

                  @yury One thing I did notice is this. To put BH1750 into a sleep mode (1uA consumption), it has to be called as follows:

                  void setup()  {
                  lightMeter.begin(BH1750_ONE_TIME_HIGH_RES_MODE);
                  
                  }
                  

                  After a one time measurement it goes to sleep automatically.
                  Please see -> https://github.com/claws/BH1750/blob/master/examples/BH1750advanced/BH1750advanced.ino

                  I have tried above, but still getting 0.14mA consumption in a sleep mode. Very odd!

                  KoreshK 1 Reply Last reply
                  0
                  • alexsh1A alexsh1

                    @yury It is the latest bh1750 lib -> https://github.com/claws/BH1750

                    I am using MySensors 2.2.0b

                    I am using a default code :
                    https://github.com/EasySensors/ButtonSizeNode/blob/master/ButtonSizeNode.ino

                    KoreshK Offline
                    KoreshK Offline
                    Koresh
                    Contest Winner
                    wrote on last edited by
                    #55

                    @alexsh1 Very strange. I can't see a method write8 in current lib version (https://github.com/claws/BH1750). So I can't understand how is it possible to compile default code with this string

                    lightMeter.write8(BH1750_POWER_DOWN);
                    

                    I couldn't put this sensor into power down mode without this.

                    alexsh1A 2 Replies Last reply
                    0
                    • alexsh1A alexsh1

                      @yury One thing I did notice is this. To put BH1750 into a sleep mode (1uA consumption), it has to be called as follows:

                      void setup()  {
                      lightMeter.begin(BH1750_ONE_TIME_HIGH_RES_MODE);
                      
                      }
                      

                      After a one time measurement it goes to sleep automatically.
                      Please see -> https://github.com/claws/BH1750/blob/master/examples/BH1750advanced/BH1750advanced.ino

                      I have tried above, but still getting 0.14mA consumption in a sleep mode. Very odd!

                      KoreshK Offline
                      KoreshK Offline
                      Koresh
                      Contest Winner
                      wrote on last edited by Koresh
                      #56

                      @alexsh1 said in πŸ’¬ Button size radionode with sensors swarm extension:

                      ...
                      After a one time measurement it goes to sleep automatically.
                      ...
                      I have tried above, but still getting 0.14mA consumption in a sleep mode. Very odd!

                      I've read the claws library briefly again. I'm a litte doubt that this code:

                      _delay_ms(10);
                      

                      is enough to ensure correctly timings and sensors work :)

                      alexsh1A 1 Reply Last reply
                      0
                      • KoreshK Koresh

                        @alexsh1 said in πŸ’¬ Button size radionode with sensors swarm extension:

                        ...
                        After a one time measurement it goes to sleep automatically.
                        ...
                        I have tried above, but still getting 0.14mA consumption in a sleep mode. Very odd!

                        I've read the claws library briefly again. I'm a litte doubt that this code:

                        _delay_ms(10);
                        

                        is enough to ensure correctly timings and sensors work :)

                        alexsh1A Offline
                        alexsh1A Offline
                        alexsh1
                        wrote on last edited by
                        #57

                        @Koresh It does work, I have just test it, but there is a delay, i.e. the sensor is lagging one reading behind.

                        1 Reply Last reply
                        0
                        • KoreshK Koresh

                          @alexsh1 Very strange. I can't see a method write8 in current lib version (https://github.com/claws/BH1750). So I can't understand how is it possible to compile default code with this string

                          lightMeter.write8(BH1750_POWER_DOWN);
                          

                          I couldn't put this sensor into power down mode without this.

                          alexsh1A Offline
                          alexsh1A Offline
                          alexsh1
                          wrote on last edited by
                          #58

                          @Koresh said in πŸ’¬ Button size radionode with sensors swarm extension:

                          @alexsh1 Very strange. I can't see a method write8 in current lib version (https://github.com/claws/BH1750). So I can't understand how is it possible to compile default code with this string

                          lightMeter.write8(BH1750_POWER_DOWN);
                          

                          I couldn't put this sensor into power down mode without this.

                          I tried it with the original (old) library -> https://github.com/mysensors/MySensorsArduinoExamples/tree/master/libraries/BH1750

                          I commended out "private" in bh1750.h
                          Consumption has not changed - 0.14mA

                          1 Reply Last reply
                          0
                          • KoreshK Koresh

                            @alexsh1 Very strange. I can't see a method write8 in current lib version (https://github.com/claws/BH1750). So I can't understand how is it possible to compile default code with this string

                            lightMeter.write8(BH1750_POWER_DOWN);
                            

                            I couldn't put this sensor into power down mode without this.

                            alexsh1A Offline
                            alexsh1A Offline
                            alexsh1
                            wrote on last edited by
                            #59

                            @Koresh One more observation. If I comment out:

                            //lightMeter.write8(BH1750_POWER_DOWN);
                            

                            from the original sketch, the consumption goes up to 0.27mA.
                            So BH1750 is not a problem. Something else is eating up a few milliamps.

                            1 Reply Last reply
                            0
                            • Y Offline
                              Y Offline
                              yury
                              wrote on last edited by
                              #60

                              @alexsh1 said in πŸ’¬ Button size radionode with sensors swarm extension:

                              Something else is eating up a few milliamps

                              yes seems your board has bad capacitors. After rechecking many boards we found one eating a lot - 0.4 mA. Replacing caps fixed issue.

                              2_1499267230472_noLDO.jpg 1_1499267230472_LDO.jpg 0_1499267230471_gooodCap.jpg

                              can you check?

                              alexsh1A 2 Replies Last reply
                              0
                              • Y yury

                                @alexsh1 said in πŸ’¬ Button size radionode with sensors swarm extension:

                                Something else is eating up a few milliamps

                                yes seems your board has bad capacitors. After rechecking many boards we found one eating a lot - 0.4 mA. Replacing caps fixed issue.

                                2_1499267230472_noLDO.jpg 1_1499267230472_LDO.jpg 0_1499267230471_gooodCap.jpg

                                can you check?

                                alexsh1A Offline
                                alexsh1A Offline
                                alexsh1
                                wrote on last edited by alexsh1
                                #61

                                @yury There are two yellow caps in your photo. Do I have to change both of them? What's nominal please?

                                EDIT: both are 107J SMD Tantalum

                                1 Reply Last reply
                                0
                                • Y yury

                                  @alexsh1 said in πŸ’¬ Button size radionode with sensors swarm extension:

                                  Something else is eating up a few milliamps

                                  yes seems your board has bad capacitors. After rechecking many boards we found one eating a lot - 0.4 mA. Replacing caps fixed issue.

                                  2_1499267230472_noLDO.jpg 1_1499267230472_LDO.jpg 0_1499267230471_gooodCap.jpg

                                  can you check?

                                  alexsh1A Offline
                                  alexsh1A Offline
                                  alexsh1
                                  wrote on last edited by
                                  #62

                                  @yury I was suspecting EEPROM (CS pin with pull-up resistor?) to be a culprit

                                  KoreshK 1 Reply Last reply
                                  0
                                  • Y Offline
                                    Y Offline
                                    yury
                                    wrote on last edited by
                                    #63

                                    combined capacitance of booth should be 100 --200 microfarads . It is input capacitors.
                                    please try replacing them

                                    re:
                                    I was suspecting EEPROM (CS pin with pull-up resistor?) to be a culprit

                                    not pullups...

                                    alexsh1A 1 Reply Last reply
                                    0
                                    • Y Offline
                                      Y Offline
                                      yury
                                      wrote on last edited by
                                      #64

                                      0.4 ma here with the bad cap
                                      0_1499269945983_viber image.jpeg

                                      1 Reply Last reply
                                      0
                                      • alexsh1A alexsh1

                                        @yury I was suspecting EEPROM (CS pin with pull-up resistor?) to be a culprit

                                        KoreshK Offline
                                        KoreshK Offline
                                        Koresh
                                        Contest Winner
                                        wrote on last edited by
                                        #65

                                        @alexsh1 you can solder one or two capacitors ~50-200uf. But you should remove both because we do not know which of them is bad. Do not forget about polarity ;) Dot-key on the board means positive, so tantalum has positive key, but electrolitic capacitors has negative key.

                                        alexsh1A 1 Reply Last reply
                                        0
                                        • KoreshK Koresh

                                          @alexsh1 you can solder one or two capacitors ~50-200uf. But you should remove both because we do not know which of them is bad. Do not forget about polarity ;) Dot-key on the board means positive, so tantalum has positive key, but electrolitic capacitors has negative key.

                                          alexsh1A Offline
                                          alexsh1A Offline
                                          alexsh1
                                          wrote on last edited by alexsh1
                                          #66

                                          @Koresh thanks. It does not matter which caps, right?
                                          I have a few 1206 100uF ceramic caps. They are not polarised and may be a good fit size wise

                                          KoreshK 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.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