AHT10 humidity sensor over Software I2C

What are you developing?
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: AHT10 humidity sensor over Software I2C

Post by ag123 »

Then going a little further for temperature sensor maybe thermistor
lets take 1N4148
https://en.wikipedia.org/wiki/1N4148_signal_diode

https://en.wikipedia.org/wiki/Shockley_diode_equation
oops missing some parameters, we'd need to borrow that from Spice models
https://github.com/neiser/spice-padiwa- ... 1N4148.lib
ok got it
ideality factor N = 1.906
https://en.wikipedia.org/wiki/Saturation_current
Is = 4.352E-9

now plug these back into Shockley diode equation
1n4148 diode model from shockley equation
1n4148 diode model from shockley equation
1n4148_diode_model.png (13.66 KiB) Viewed 3287 times
ok looks good

Then consider a simple model of a resistor in series with a diode

Code: Select all

+------R------+----->|-------+
lets use R = 2k ohm
re-arranging the Shockley equation to get temperature vs V diode forward voltage
- deleted - incorrect, Is is not constant with temperature hence direct substitution in Shockley equation results in misleading values
https://en.wikipedia.org/wiki/Saturation_current
explored here
https://electronics.stackexchange.com/q ... ation?rq=1
but maybe that's how this enterprising person did it :lol:
https://hackaday.com/2018/04/16/two-cen ... e-sensors/
there is apparently no substitutes for testing it to derive the empirical parameters

oh but the shockley equation finding is a bit scary as this implies that circuit simulations is made at a *fixed temperature*, when the diode (or junction Vbe heats up), circuit behaviour maybe wildly different from the ideal Shockley equation :lol:
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: AHT10 humidity sensor over Software I2C

Post by ag123 »

the analog world is really wild wild different from ideal world of equations
such as the findings here that Newtons's law of cooling
https://en.wikipedia.org/wiki/Newton%27s_law_of_cooling
doesn't fit an exponential/logarithmic curve !
viewtopic.php?p=8524#p8524
it is some other power law curve :lol:
User avatar
blue-man
Posts: 51
Joined: Mon Mar 23, 2020 5:02 pm

Re: AHT10 humidity sensor over Software I2C

Post by blue-man »

ag123 wrote: Fri Nov 12, 2021 1:40 pm Thinking about this, has anyone got a decent idea how to do humidity as *analog*? after all stm32 has good ADCs ;)

now you are left with the 'labor intensive' parts :lol:
This is really an interesting idea.
Just build your own sensor instead of struggling with an I2C bus. :lol:
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: AHT10 humidity sensor over Software I2C

Post by ag123 »

the trouble with the analog world is it is really *analog*, equations and all are 'too perfect' for this real world around us, otherwise a humidity sensor is simply a capacitor with a piece of paper sandwiched in between. and it is 'perfect'
https://www.mdpi.com/1424-8220/21/19/6557/pdf
according to figure 6 graph c of the above paper :lol:
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: AHT10 humidity sensor over Software I2C

Post by mrburnette »

ag123 wrote: Fri Nov 12, 2021 7:08 pm the trouble with the analog world is it is really *analog*, equations and all are 'too perfect' for this real world around us,...
But with Excel (or open-source similar) one can use solver and best-fit equations to derive rather simple bounded real-world models. uC just love flashed-based array tables and they are sooo very easy to implement. The one-off project is quiet doable using sampled data. Testing and fine-tuning is necessary if small production is being considered: usually by grading and grading selecting similar sensors. It is the large production runs where empirical data runs up the cost; however, the costs are often recovered by increasing the unit price and providing calibration charts specifics for the specific unit.

IMO: Often the engineer over designs for the job at hand. A case in point: replacing a analog gauge with a digital display; for example the oil pressure on an engine. The old gauge is likely to look like:
Image

while the newly implemented replacement may appear as:
Image

Now, for 99% of applications, that decimal point is just ridiculous.

The same can be said of using a 10% burden resistor and a digital display with 2 decimal places to show the voltage drop. Time to review that lesson on accuracy and resolution.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: AHT10 humidity sensor over Software I2C

Post by ag123 »

Rather, the notion is that a capacitor with a piece of paper sandwiched is a humidity sensor.
The trouble is that the paper's response (as capacitance) to humidity varies according to both the relative humidity and temperature.
So to turn a piece of paper into a humidity sensor, it would take calibration against a grid of temperature and relative humidity.
It is non-linear, empirical and it takes serious experiments to measure those to calibrate that piece of paper.
Then, finally, u'd have a humidity sensor from that piece of paper. I'd guess it is a reason most would just settle for the DHT sensors :lol:

That said, one of the ways out is those things based on works shared by scientists nearly a century back. It seemed, in those days, people believe in doing and sharing serious science. that is the wet bulb and dry bulb temperatures technique. It is probably about as accurate as you can get, and there are scientifically measured and calibrated tables for them.
viewtopic.php?p=8911#p8911
Just that it is perhaps not as convenient as a piece of paper humidity sensor for the convenience and portability :lol:
User avatar
blue-man
Posts: 51
Joined: Mon Mar 23, 2020 5:02 pm

Re: AHT10 humidity sensor over Software I2C

Post by blue-man »

ag123 wrote: Fri Nov 12, 2021 7:08 pm the trouble with the analog world is it is really *analog*, equations and all are 'too perfect' for this real world around us, otherwise a humidity sensor is simply a capacitor with a piece of paper sandwiched in between.
When everything would be so easy as to implement some tables to compensate non-linearity.

There are simple mechanical problems like producing a constant film of the detection substance.
So some paper would be really perfect if you can use it.

AHT10-Innen.jpg
AHT10-Innen.jpg (60.96 KiB) Viewed 3218 times
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: AHT10 humidity sensor over Software I2C

Post by ag123 »

If that is an AHT10, that looks fairly close to our guesses. for that 'thin film' I'd guess ordinary paper glue is possibly close enough.
To increase the capacitance, one could just mix some TiO2 (titanium dioxide).
https://en.wikipedia.org/wiki/Relative_permittivity
I'd guess a way to make a humidity sensor is to make a pcb with thin wires patterns spaced closely, say 0.1mm gaps, the wire pattern could be a twin wire spiral pattern. To increase sensitivity, one could use a bigger pcb surface area. Then mix that TiO2 paper glue and make a thin layer over the surface.
This is a surface capacitor with TiO2 and paper glue as the dielectric. I'd guess this would be sensitive to humidity and temperature.
The trouble with thin long wires on pcb is that it turns them into antennas, so we'd receive radio waves on it than simply a 'humidity sensor'

In fact, there is a real implementation here:
https://www.mdpi.com/1424-8220/17/2/284
we'd not be able to achieve the level of sensitivity described in the paper as the method as described in the paper uses very thin layer of TiO2 dielectric possibly just microns thick and sandwich the dielectric with porous electrodes at the top layer. But then our 'surface capacitor' concept would be similar to AHT10 if indeed it is made that way.

And the hard part that remains is always to calibrate it due to the twin dependencies of temperature and humidity.
This may make sense if you are making many pieces of it, as it could reduce the cost of 'humidity sensors' to like a few cents a piece, less that stm32 that does all the measurements :lol:
User avatar
blue-man
Posts: 51
Joined: Mon Mar 23, 2020 5:02 pm

Re: AHT10 humidity sensor over Software I2C

Post by blue-man »

ag123 wrote: Sat Nov 13, 2021 11:58 am If that is an AHT10, that looks fairly close to our guesses. for that 'thin film' I'd guess ordinary paper glue is possibly close enough.
This is an picture of an AHT10 found on an russian site.
There was the picture of the complete breakout PCB, but the picture was to big to upload.
ag123 wrote: Sat Nov 13, 2021 11:58 am And the hard part that remains is always to calibrate it due to the twin dependencies of temperature and humidity.
This may make sense if you are making many pieces of it, as it could reduce the cost of 'humidity sensors' to like a few cents a piece, less that stm32 that does all the measurements :lol:
It is possible to measure against an AHT10 or AHT20 with 2% accuracy.
Then an correction table can be easily set up.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: AHT10 humidity sensor over Software I2C

Post by ag123 »

it turns out my pcb humidity sensor thought experiment is more than just a thought experiment
the real implementation of this concept is called *capacitive soil moisture sensors* :lol:
https://www.mdpi.com/1424-8220/20/19/5644
https://www.aliexpress.com/wholesale?ca ... capacitive
Post Reply

Return to “Projects”