💬 Air Humidity Sensor - Si7021
-
Hi, when making this sensor battery powered (and thus enabling "#define REPORT_BATTERY_LEVEL"), I get the verification error of "Vcc.h: No such file or directory". How can I solve this?
@Sebex The Si7021 guide mentions that you have to install the Arduino VCC library (link to GitHub) if you want to use this feature:
Example
This example uses the Si7021 library, which is included in the MySensors external examples. If you choose to report battery level to the gateway (by defining REPORT_BATTERY_LEVEL at the top of the sketch) the Vcc library is also required. Please install the librarie(s) and restart the Arduino IDE before trying to compile.
It might be a good idea to add a link to the library in the article itself, since it doesn't make clear which library is required for this.
-
@Sebex The Si7021 guide mentions that you have to install the Arduino VCC library (link to GitHub) if you want to use this feature:
Example
This example uses the Si7021 library, which is included in the MySensors external examples. If you choose to report battery level to the gateway (by defining REPORT_BATTERY_LEVEL at the top of the sketch) the Vcc library is also required. Please install the librarie(s) and restart the Arduino IDE before trying to compile.
It might be a good idea to add a link to the library in the article itself, since it doesn't make clear which library is required for this.
@BearWithBeard the Vcc library is present in MySensorsArduinoExamples, so if MySensorsArduinoExamples is installed, Vcc will be available.
Dependencies is a mess, which is why MySensorsArduinoExamples is in a separate repo. We (the community) has not yet found a good way to handle dependencies.
-
Hi there,
I've a pro mini 3.3V with a si7021 and a Li-ion 3.7V battery.
I'm using the VCC library, but the reported values are weird: the remaining battery value drops a lot, and if I reset the board, it jumps back to a more normal value.The battery is connected to the VCC pin on the arduino.
A regulator (LM2936) powers the si7021 and the nrf24.Here is a graph of the battery level. Pikes appear when I reset the arduino.

Isn't the 2 resistors method more accurate?
Thanks!
-
Hi there,
I've a pro mini 3.3V with a si7021 and a Li-ion 3.7V battery.
I'm using the VCC library, but the reported values are weird: the remaining battery value drops a lot, and if I reset the board, it jumps back to a more normal value.The battery is connected to the VCC pin on the arduino.
A regulator (LM2936) powers the si7021 and the nrf24.Here is a graph of the battery level. Pikes appear when I reset the arduino.

Isn't the 2 resistors method more accurate?
Thanks!
-
@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); #endifI 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?
-
@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); #endifI 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?
@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. -
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.
-
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.
-
@bebr could it be temperature related? I have noticed that the voltage in my nodes increase when the sun is shining on them.
@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:

-
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 :) -
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. -
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.
-
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.
@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 inttointin SI7021.cpp. -
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.