Note that even with this, one should not expect a very precise altitude indication, it can vary several meters up or down. If you want a more precise altitude (and independence from the weather), you probably need to use a GPS.
@seb First I want to thank you for your help - you have helped me resolve the board detection issue. I understand try/except is the "python way" but as a developer with a much more structured background I was hoping for a solution that might be more robust so as not to encounter issues in the future as the interface or hardware might change.
I really do appreciate your time and effort and I understand this is likely the best solution for now.
Thanks @seb and @jmarcelino! Don't get exactly the same figures, but we're definitely in the same ballpark.
I'll set this aside for now as I don't quite have the time and it was just a "nice to have" feature, but I suppose this should be investigated further at some point, as the sensor itself should only use 50 µA, not over 300, and it renders the wake-on-accelerometer feature a lot less useful.
A few things that could be explored:
it could be that keeping the accelerometer powered on means that all the other sensors are powered on as well and it is them using the rest of the current
it could be the fact that the accelerometer INT pins are set to open drain
it could be the powered down ESP32 (which looks like it's connected to ground when powered down) sinking current coming from a pull-up somewhere
or it could be that the data sheet is just plain wrong :-)
@seb Dear all,
Thank for your advise. I finally ordered an Extention boead that I just received. I will test my project. I think your previous statements are available for the extention board. Then just would like to have an advise to avoid burning my LoPy4 :o)
So I can resume as the following
P21 and P22 are reserved for SDA and SCL (I2C)
P13, P15, P17, P18 can be used as ADC
But does P14 (Switch) and P16 (VBAT) P19 (RTS) and P20 (CTS) can be used as ADC as well, as they look like reserved for VBAT, RTS, CTS, etc...)?
I supposed I do not need a converted Analog to Digital? Can I directly connect my Analog input?
I will try this schema which is my favorite
WMx are the moisture sensor.
I first will try with one sensor. Then I will conect A1 to P13
D1 and D2 and two digital output, when D1 is HIGHT, D2 is LOW. D1 must be 3.3V. I will have to programm LyPo4 to altenate D1 and D2 to avoid corrostion and make an average of the result....
Then I can use P6 and P7 for D1 and D2? P6 and P7 look like free and not use....
Then later, I will use 3 of the WM. Then I can connect A2 to P15 and A3 to P17
P18 can be reserved for a 4 sensors.
IF all is correct, I will have another problem, because I would need (not sure) two more Analog measure. Then can P19 and P20 be used? What will be the impact on RTC and CTS?
Or, can I use P19 or P20 as digital inpout (waterproof temperature sensor)
P16 confused me because , its states 'VBAT'. What does it meens? It's a VBAT output?
I am also a bit confused about P14
if you are not using this then you are ok to connect something else to it
P14 could be the output the measure when the button is pressed?
Or, can I use as Digital Input for Rain gauge (magnetic switch)?
Many, many thank for your clarification, it's help! (I hope, I was clear :o). )