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. Announcements
  3. 💬 Air Humidity Sensor - Si7021

💬 Air Humidity Sensor - Si7021

Scheduled Pinned Locked Moved Announcements
temperaturehumiditysi7021
28 Posts 13 Posters 1.8k Views 12 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.
  • B Offline
    B Offline
    bebr
    wrote on last edited by
    #14

    @Yveaux thanks for your answer.

    I used the sketch on the Mysensors'si7021 page, so the vcc level is read at the end of the loop, before going to sleep and after sending the temp/hum values.
    The only modification I made are setting up the voltage values.
    As my 3.7V Li-Ion battery is at 4.2V when fully charged and at 3V when almost completed discharged, this how I configured it in the sketch:

    #ifdef REPORT_BATTERY_LEVEL
    #include <Vcc.h>
    static uint8_t oldBatteryPcnt = 200;  // Initialize to 200 to assure first time value will be sent.
    const float VccMin        = 3.0;      // Minimum expected Vcc level, in Volts: Brownout at 1.8V    -> 0%
    const float VccMax        = 4.2;  // Maximum expected Vcc level, in Volts: 2xAA fresh Alkaline -> 100%
    const float VccCorrection = 1.0;      // Measured Vcc by multimeter divided by reported Vcc
    static Vcc vcc(VccCorrection); 
    #endif
    

    I didn't apply any correction because read and reported VCC was very close, and I'm just testing this for now.

    I didn't removed the onboard regulator nor the power led for now. Isn't the regulator only used when applying voltage to the RAW pin?

    YveauxY 1 Reply Last reply
    1
    • B bebr

      @Yveaux thanks for your answer.

      I used the sketch on the Mysensors'si7021 page, so the vcc level is read at the end of the loop, before going to sleep and after sending the temp/hum values.
      The only modification I made are setting up the voltage values.
      As my 3.7V Li-Ion battery is at 4.2V when fully charged and at 3V when almost completed discharged, this how I configured it in the sketch:

      #ifdef REPORT_BATTERY_LEVEL
      #include <Vcc.h>
      static uint8_t oldBatteryPcnt = 200;  // Initialize to 200 to assure first time value will be sent.
      const float VccMin        = 3.0;      // Minimum expected Vcc level, in Volts: Brownout at 1.8V    -> 0%
      const float VccMax        = 4.2;  // Maximum expected Vcc level, in Volts: 2xAA fresh Alkaline -> 100%
      const float VccCorrection = 1.0;      // Measured Vcc by multimeter divided by reported Vcc
      static Vcc vcc(VccCorrection); 
      #endif
      

      I didn't apply any correction because read and reported VCC was very close, and I'm just testing this for now.

      I didn't removed the onboard regulator nor the power led for now. Isn't the regulator only used when applying voltage to the RAW pin?

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by Yveaux
      #15

      @bebr said in 💬 Air Humidity Sensor - Si7021:
      Your setup looks allright.

      Isn't the regulator only used when applying voltage to the RAW pin?

      Yes it is, but I'm not sure what will happen if you source 3v3 via its output pin.
      Anyway, I doubt if this could cause the effect you're seeing.

      http://yveaux.blogspot.nl

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bebr
        wrote on last edited by
        #16

        Ok, do you need my schematic, to make it clearer?

        I've planned to removed the onboard regulator (and power led) on my production board. But this one is for testing so I leave it untouched.

        So currently the regulator, is obiously external.

        Thanks again, any help appreciated, otherwise I'll use the 2 resistors method.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bebr
          wrote on last edited by
          #17

          And now, without resetting, the battery level has jumped from 23% to 47%. This last seems to be correct according to the measure of 3.673V, directly taken on the battery.

          mfalkviddM 1 Reply Last reply
          0
          • B bebr

            And now, without resetting, the battery level has jumped from 23% to 47%. This last seems to be correct according to the measure of 3.673V, directly taken on the battery.

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

            @bebr could it be temperature related? I have noticed that the voltage in my nodes increase when the sun is shining on them.

            B 1 Reply Last reply
            0
            • mfalkviddM mfalkvidd

              @bebr could it be temperature related? I have noticed that the voltage in my nodes increase when the sun is shining on them.

              B Offline
              B Offline
              bebr
              wrote on last edited by bebr
              #19

              @mfalkvidd I thought of this too, but I opened the windows this morning, 11°C here this morning, and the battery level stayed around 50%.

              Here are some graphs showing it's not temperature related:
              Screenshot_2020-03-30 MySensors testing - Grafana.png

              1 Reply Last reply
              1
              • B Offline
                B Offline
                bebr
                wrote on last edited by bebr
                #20

                I noticed I used a 10uF/50V capacitor instead of a 0.1uF/5V for LM2936 regulator.
                Could it be the source of my problem?
                I change it last evening, and now the reported battery level seems ok.
                Sorry, I'm noob in electronics :)

                skywatchS 1 Reply Last reply
                0
                • B bebr

                  I noticed I used a 10uF/50V capacitor instead of a 0.1uF/5V for LM2936 regulator.
                  Could it be the source of my problem?
                  I change it last evening, and now the reported battery level seems ok.
                  Sorry, I'm noob in electronics :)

                  skywatchS Offline
                  skywatchS Offline
                  skywatch
                  wrote on last edited by
                  #21

                  @bebr Yes, that would make a big difference. Good that you spotted it though!

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bebr
                    wrote on last edited by bebr
                    #22

                    Even with the 0.1uF capacitor, I had wrong values.
                    So, I've gone with the voltage divider method, and it seems more reliable, at least for my case.
                    4.7V max to VCC, R1 1M, R2 330k, another 0.1uF capacitor in parallel with R2.
                    I don't need a very good accuracy, just a trend in order to know when to change my batteries.
                    Thanks for your help.

                    1 Reply Last reply
                    1
                    • H Offline
                      H Offline
                      hoggin
                      wrote on last edited by
                      #23

                      Anyone know why when the temp goes below 32F it jumps all the way down to -100? I have followed this configuration to the T but cannot figure this out. Watching serial output shows the temp at -100 or so whenever the temp is below 32F. As if the conversion is off or something.

                      mfalkviddM 1 Reply Last reply
                      0
                      • H hoggin

                        Anyone know why when the temp goes below 32F it jumps all the way down to -100? I have followed this configuration to the T but cannot figure this out. Watching serial output shows the temp at -100 or so whenever the temp is below 32F. As if the conversion is off or something.

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

                        @hoggin interesting that nobody has had problems with this before. I checked the code, and the problem is caused by treating a signed integer as unsigned. https://github.com/mysensors/MySensorsArduinoExamples/blob/master/libraries/SI7021/SI7021.cpp#L41

                        I think it will work properly if you change unsigned int to int in SI7021.cpp.

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

                          Suggested fix is available at https://github.com/mysensors/MySensorsArduinoExamples/pull/51

                          1 Reply Last reply
                          1
                          • H Offline
                            H Offline
                            hoggin
                            wrote on last edited by
                            #26

                            FIXED!!! Thanks. I have been struggling.

                            1 Reply Last reply
                            1
                            • P Offline
                              P Offline
                              pahe
                              wrote on last edited by
                              #27

                              Hello , I have a problem with this shetch . I get from sensor in serial monitor - Temp 128.86C Hum 118.99 ,
                              Can someone help me ? Thanks

                              1 Reply Last reply
                              0
                              • H Offline
                                H Offline
                                hoggin
                                wrote on last edited by
                                #28

                                My next issue is the humidity seems to be off. It has read as high as 115% humidity. Is this normal or should I be considering a correction? If so, how would I enter a correction. Its a little odd considering it states that the accuracy is much tighter than that.

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


                                12

                                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