Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:15 13 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Using the HUMID command for other data imput.

Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2611
Posted: 06:44am 11 Dec 2024
Copy link to clipboard 
Print this post

This is in the "Because You Can" category rather than "The Best Way to do It".
The Humid command outputs 2 16 bit numbers, each divided by ten.
When using a DHT22 the values represent temperature and humidity but they could be anything.
Recovering integer values just requires multiplying them by 10. For a 32 bit number stitch them together.
eg. (H*10 << 16) + T*10

Using a second Pico running a DHT22 emulator any data can be packaged into 16 bit lumps and sent to the host.
When more than 32 bits are to be sent a sucession of Humid commands can be used.
If the host is running out of pins and you want to read multiple sensors this needs just one pin.

This pair of programs gathers 8 data values from various devices and sends them via 4 Humid commands.
Synchronization is achieved by having a long pause between each group of 4.

It could have been done by including some address bits in each block of 32 bits.
Eg if the data is from a 10 bit DAC 3 values and 2 address bits could be sent in one 32 bit shot.

There is one catch, if the 32 bits = &H27102710 it could be mistaken for the error indicator when
both T and H = 1000. To prevent that whenever &H27102710 occurs flip the leat important bit, or reserve a bit for that purpose.

Host
' "Get data from DHT22 emulator 02.bas"
Dim float tDHT,hDHT,tAHT,hAHT
Dim f%=0
Do
 If f% Mod 40 = 0 Then Print " Pico"," RTC"," DS18a"," DS18b","    AHT10","    DHT11","  Time"
 For n=0 To 3
  Humid gp0,tDHT,hDHT,0
  If n<2 Then  Print hDHT;"C",tDHT;"C",
  If n>1 Then  Print hDHT;"C",tDHT;"%",
  Pause 20
 Next
 Print Time$
 Do : Loop Until Right$(Time$,1)="8"
 Pause 2000
 Inc f%
Loop
End

Output
> RUN
Pico    RTC     DS18a   DS18b      AHT10           DHT11         Time
37.3C   20.8C   21.3C   20.9C   20.8C   14.1%   20.6C   14%    16:02:44
37.3C   20.8C   21.1C   20.9C   20.8C   14.2%   20.6C   14%    16:02:50
37.3C   20.8C   21.1C   20.9C   20.8C   14.2%   20.6C   14%    16:03:00
38.7C   20.8C   21.1C   21C     20.8C   14.1%   20.5C   13%    16:03:10

Data collector and DHT22 Emulator
Print "multi sensor data collector with DHT22 emulator output v02.bas"
Print MM.Info(cpuspeed);" Hz"

' "DHT11 and 22 Emulator for AHT10 input.bas"
'  One pin version. Link DHTpin and Gnd. to other Pico.
'  If wires are short no pullup resistor is needed.
Const DHTpin = MM.Info(pinno GP6)
SetPin DHTpin, DIn, pullup
Print "DHTpin =";DHTpin, Pin(DHTpin)
Dim integer a(83), b(4), word, n, m, DHT
Dim float t, h, tAHT, hAHT, z 'z = "wake" pulse duration - 1.5 = new firmware, 1 = old


' HUMID won't get a resopnse for 1st reading, so will output 1000.
'measuring first "wake" pulse to set start delay time. Old firmware = 1mS, new = 1.5mS
Print "Waiting to measure first pulse"
Do While Pin(DHTpin):Loop :t=Timer
Do :Loop Until Pin(DHTpin):z=Timer-t-.135 'data must start within 135uS of wake pulse end
Print "Wake Pulse measurement:-"; Cint(z*100+13)/100;"mS" :Print
'z=1.44
Dim integer byte, CSum, i=0, j=0, sensor(7), S
Dim float tmr1, tmt2, d(6) ' BASE 0
Pause 1000 'ignore the rest of this block of requests for data

'Pin(GP6)=1 'for reading DHT11 with DHT22 Humid command to get tenths of deg.
'SetPin GP6, dout :Pin(GP6)=1 'prepare to send low wake pulse to GP7 via diode diode. K to gp6, A to gp7
'Recent firmware does not need this, DHT11 Humid command now gives tenths of deg.
'Using old firmware as TEMPR() function for DS18B20 in latest firmware has a bug, will revise when fixed.

'main_loop
Do
 tmr1=Timer+2000 '2 Sec. between reads
 sensor(0) = Pin(temp)*10 :Print sensor(0)/10;"C RP chip", 'RP2040 chip temp sensor
 Call "DS3231" 'DS3231 RTC chip temp sensor
 Call "DS18B20a" 'DS18B20 temp sensor
 Call "DS18B20b" 'another DS18B20 temp sensor
 Call "AHT10" 'I2C temp and humid. sensor
 Call "dht11" 'read DHT11
 Print Time$
'  Math v_print sensor() '16 bit values to be sent
 Do :Loop Until Timer>tmr1
 Call "Emulator"
 'your program here
Loop


Sub Emulator 'emulate DHT22
 For S=0 To 7 Step 2
  Math Set 50, a() : a(0)=80 : a(1)=80 : Math set 0, b() : word=0 : m=0

  If z > 2 Then End Sub
  b(0) = sensor(S) >> 8 : b(1) = sensor(S) And 255
  b(2) = sensor(S+1) >> 8 : b(3) = sensor(S+1) And 255

  b(4) = Math(SUM b()) And 255 'make checksum

  For n=0 To 4 : Inc word, (b(n) << (8 * (4-n))) : Next
'  Print "data ";Bin$(word,40),:Math v_Print b()
  For n=81 To 2 Step -2
   a(n) = 27 + 43 * ((word >> m) And 1)
   Inc m
  Next
'  Math V_Print a()
'   Print "Waiting to receive HUMID command", Cint(z*100)/100
  Do While Pin(DHTpin):Loop
   t=Timer + z '1.5 = DHT22
  Do : Loop Until Timer > t
  SetPin DHTpin,off:Pin(DHTpin)=1:SetPin DHTpin,DOut
  Device BitStream DHTpin,83,a()
  SetPin DHTpin, off : SetPin DHTpin, din, pullup
 Next
End Sub

Sub DS3231 'read DS3231 RTC temp, if installed
 Local integer Tdeg, Tdec
 On Error skip 3 : RTC GetReg 17,Tdeg : RTC GetReg 18,Tdec
 sensor(1) = Cint((Tdeg + Tdec / 256)*10) And &hFFF
 Print (Tdeg + Tdec / 256);"C RTC",
End Sub

Sub DS18B20a 'read DS18B20 temp, if installed
 On Error skip 3
 TEMPR START gp0,2
 sensor(2) = Cint(TEMPR(gp0)*10) And &hFFF
 Print sensor(2)/10;"C DS18a",
End Sub

Sub DS18B20b 'read another DS18B20 temp, if installed
 On Error skip 3
 TEMPR START gp1,2 ': Pause 800
 sensor(3) = Cint(TEMPR(gp1)*10) And &hFFF
 Print sensor(3)/10;"C DS18b" ,
End Sub

Sub AHT10
 Local integer dat(5)
 I2C2 write &H38, 0, 3, 172, 51, 0  'trigger measurement for next read
 Pause 100 'allow time to measure and prepare data
 On error skip 4
 I2C2 read &H38,1,6,dat() 'read data bytes
 hAHT = Cint((dat(1)*256+(dat(2)And &Hf0))/65.536)
 tAHT = Cint(((dat(3) And 15)*256 + dat(4)) / 2.048 - 500)
 sensor(5) = hAHT And &hFFF : sensor(4) = tAHT And &hFFF
 hAHT = sensor(5)/10 : tAHT = sensor(4)/10
 Print tAHT;"C", hAHT;"% AHT",
End Sub

Sub dht11  'get DHT11 reading
 If Timer > Tmr2 Then
  Humid GP7, tDHT, hDHT, 1  'start DHT22 command
'   Pause 6
  sensor(7) = hDHT*10 And &hFFF : sensor(6) = tDHT*10 And &hFFF
  tmr2=Timer+29000 '30 Sec. between reads
 EndIf

 Print "temp "; tDHT ;"C","humid ";hDHT ;"% DHT",
End Sub

End

Source Data
> RUN
multi sensor data collector with DHT22 emulator output v02.bas
378000000 Hz
DHTpin = 9       1
Waiting to measure first pulse
Wake Pulse measurement:- 1.5mS

37.3C RP chip   20.75C RTC      21.3C DS18a     20.9C DS18b     20.8C   14.1% AHT      temp  20.6C     humid  14% DHT  15:02:06
37.3C RP chip   20.75C RTC      21.1C DS18a     20.9C DS18b     20.8C   14.2% AHT      temp  20.6C     humid  14% DHT  15:02:19
37.3C RP chip   20.75C RTC      21.1C DS18a     20.9C DS18b     20.8C   14.2% AHT      temp  20.6C     humid  14% DHT  15:02:25
38.7C RP chip   20.75C RTC      21.1C DS18a     21C DS18b       20.8C   14.1% AHT      temp  20.5C     humid  13% DHT  15:02:35
37.8C RP chip   20.75C RTC      21.1C DS18a     21C DS18b       20.8C   14.2% AHT      temp  20.5C     humid  13% DHT  15:02:45
37.3C RP chip   20.75C RTC      21.1C DS18a     21C DS18b       20.8C   14.2% AHT      temp  20.5C     humid  13% DHT  15:02:55


Footnote added 2024-12-12 06:35 by phil99
Some corrections.
  Quote  Eg if the data is from a 10 bit DAC
should be ADC.

Some of the comments in "Sub Emulator 'emulate DHT22" aren't relevant.
The original version of that sub was for both DHT22 and DHT11. The DHT11 encoding doesn't allow extracting all 32 bits at the other end so was removed, but forgot the comments.

Footnote added 2024-12-19 09:57 by phil99
An updated version that allows a wider range of CPu speeds on both Pico1 and Pico2.
The original has a fixed fudge factor to allow for the time it takes for the interpreter to switch from DIN to DOUT. This measures that time and reads the CPU speed for better correction.
Print "multi sensor data collector with DHT22 emulator output v05b.bas"
Print MM.Info(cpuspeed);" Hz"

' "DHT11 and 22 Emulator for AHT10 input.bas"
'  One pin version. Link DHTpin and Gnd. to other Pico.
'  If wires are short no pullup resistor is needed.
Pin(gp22) = 1 :SetPin gp22,dout 'pullup has been connected to this instead of 3.3V
Const DHTpin = MM.Info(pinno GP7)
SetPin DHTpin, DIn, pullup
Print "DHTpin =";DHTpin, Pin(DHTpin)
Dim integer a(83), b(4), c(1), word, n, m, DHT
Dim float t, h, tAHT, hAHT, z, z1, q=36000000/Val(MM.Info(cpuspeed))
'z = "wake" pulse duration - 1.5 = new firmware, 1 = old
'z1 = BitStream start delay
'q = extra adjustment based on CPU speed. the first BitStream (of 4) needs extra compensation. reason unknown.
' HUMID won't get a resopnse for 1st reading, so will output 1000.
'measuring first "wake" pulse to set start delay time. Old firmware = 1mS, new = 1.5mS
Print "Waiting to measure first pulse"
Do While Pin(DHTpin):Loop :t=Timer
Do :Loop Until Pin(DHTpin):z=Timer-t 'data must start within 135uS of wake pulse end

'measure pin switching time and subtract from wake pulse time to set output delay from start of wake pulse
t=Timer:SetPin DHTpin,off:Pin(DHTpin)=1:SetPin DHTpin,dout:z1=z+t-Timer
Print "Wake Pulse measurement:-"; Cint(z*100)/100;" mS  Output Delay"; Cint(z1*100)/100;" mS"

Dim integer byte, CSum, i=0, j=0, sensor(7), S
Dim float tmr1, tmt2, d(6) ' BASE 0
Pause 500 'ignore the rest of this block of requests for data

SetPin DHTpin, DIn, pullup
'main_loop
Do
tmr1=Timer+3000 '3 Sec. between reads
sensor(0) = Pin(temp)*10 :Print sensor(0)/10;"C RP chip", 'RP2040 chip temp sensor
'  sensor(0) = q*10000 : Print q,
Call "DS3231" 'DS3231 RTC chip temp sensor
Call "DS18B20a" 'DS18B20 temp sensor
Call "DS18B20b" 'another DS18B20 temp sensor
Call "AHT10" 'I2C temp and humid. sensor
Call "dht11" 'read DHT11
Print Time$
'  Math v_print sensor() '16 bit values to be sent
Do :Loop Until Timer>tmr1
Call "Emulator"

'your program here
Loop


Sub Emulator 'emulate DHT22
 Pause 10
For S=0 To 7 Step 2
 Math Set 50, a() : a(0)=80 : a(1)=80 : Math set 0, b() : word=0 : m=0
 If s Then z=z1 Else z=z1 -q '.1 =378, .28 =126MHz
 If z > 2 Then End Sub

 b(0) = sensor(S) >> 8 : b(1) = sensor(S) And 255
 b(2) = sensor(S+1) >> 8 : b(3) = sensor(S+1) And 255

 b(4) = Math(SUM b()) And 255 'make checksum

 For n=0 To 4 : Inc word, (b(n) << (8 * (4-n))) : Next
'  Print "data ";Bin$(word,40),:Math v_Print b()
 For n=81 To 2 Step -2
  a(n) = 27 + 43 * ((word >> m) And 1)
  Inc m
 Next
'  Math V_Print a()
 Do While Pin(DHTpin):Loop
  t=Timer + z '1.5--processing time = DHT22
 Do : Loop Until Timer > t
 SetPin DHTpin,off:Pin(DHTpin)=1:SetPin DHTpin,DOut
 Device BitStream DHTpin,83,a()
 SetPin DHTpin, off : SetPin DHTpin, din, pullup
Next

End Sub

Sub DS3231 'read DS3231 RTC temp, if installed
Local integer Tdeg, Tdec
On Error skip 3 : RTC GetReg 17,Tdeg : RTC GetReg 18,Tdec
sensor(1) = Cint((Tdeg + Tdec / 256)*10) And &hFFF
Print (Tdeg + Tdec / 256);"C RTC",
End Sub

Sub DS18B20a 'read DS18B20 temp, if installed
On Error skip 3
TEMPR START gp0,2
sensor(2) = Cint(TEMPR(gp0)*10) And &hFFF
Print sensor(2)/10;"C DS18a",
End Sub

Sub DS18B20b 'read another DS18B20 temp, if installed
On Error skip 3
TEMPR START gp1,2 ': Pause 800
sensor(3) = Cint(TEMPR(gp1)*10) And &hFFF
Print sensor(3)/10;"C DS18b" ,
End Sub

Sub AHT10
Local integer dat(5)
I2C2 write &H38, 0, 3, 172, 51, 0  'trigger measurement for next read
Pause 100 'allow time to measure and prepare data
On error skip 4
I2C2 read &H38,1,6,dat() 'read data bytes
hAHT = Cint((dat(1)*256+(dat(2)And &Hf0))/65.536)
tAHT = Cint(((dat(3) And 15)*256 + dat(4)) / 2.048 - 500)
sensor(5) = hAHT And &hFFF : sensor(4) = tAHT And &hFFF
hAHT = sensor(5)/10 : tAHT = sensor(4)/10
Print tAHT;"C", hAHT;"% AHT",
End Sub

Sub dht11  'get DHT11 reading
If Timer > Tmr2 Then
 Humid GP6, tDHT, hDHT, 1  'start DHT22 command
'   Pause 6
 sensor(7) = hDHT*10 And &hFFF : sensor(6) = tDHT*10 And &hFFF
 tmr2=Timer+29000 '30 Sec. between reads
EndIf

Print "temp "; tDHT ;"C","humid ";hDHT ;"% DHT",
End Sub

End

And here is a version that eliminates the need for the "fudge factor" by using separate DIN and DOUT pins, linked by a 3.3k resistor.
Print "multi sensor data collector with DHT22 emulator output - 2 pin version"
' "MSDC 2p DHT22 emulator.bas"
mm.startup
Print MM.Info(cpuspeed);" Hz"
Option explicit
' "DHT11 and 22 Emulator for AHT10 input.bas"
'  Two pin version. Link DHTin and Gnd. to Host Pico.
'  3.3k resistor from DHTout to DHTin instead of a pullup resistor.
Const DHTin = MM.Info(pinno GP7)
SetPin DHTin, din, pullup
Const DHTout = MM.Info(pinno GP22)
SetPin DHTout, Dout
Pin(DHTout) = 1
Print "DHTin = ";DHTin;"=";Pin(DHTin), "DHTout =";DHTout;"=";Pin(DHTout)
Dim integer a(83), b(4), c(1), word, n, m, byte, sensor(7), S
Dim float t, h, tAHT, hAHT, tDHT, hDHT, tmr, d(6) ' BASE 0

'main_loop - read sensors, saving values in Sensor().
' Emulator waits for request from host on DHTin then sends a BitStream on DHTout
Do
sensor(0) = Pin(temp)*10 :Print sensor(0)/10;"C RP chip", 'RP2040 chip temp sensor
Call "DS3231" 'DS3231 RTC chip temp sensor
Call "DS18B20a" 'DS18B20 temp sensor
Call "DS18B20b" 'another DS18B20 temp sensor
Call "AHT10" 'I2C temp and humid. sensor
Call "dht11" 'read DHT11
Print Time$
Call "Emulator"

'your program here
Loop


Sub Emulator 'emulate DHT22
Pin(DHTout) = 1

For S=0 To 7 Step 2 'load the bitstream array
 Pause 6
 Math Set 50, a() : a(0)=80 : a(1)=80 : Math set 0, b() : word=0 : m=0

 b(0) = sensor(S) >> 8 : b(1) = sensor(S) And 255
 b(2) = sensor(S+1) >> 8 : b(3) = sensor(S+1) And 255

 b(4) = Math(SUM b()) And 255 'make checksum

 For n=0 To 4 : Inc word, (b(n) << (8 * (4-n))) : Next
'  Print "data ";Bin$(word,40),:Math v_Print b()
 For n=81 To 2 Step -2
  a(n) = 27 + 43 * ((word >> m) And 1)
  Inc m
 Next
'  Math V_Print a()
 Do While Pin(DHTin):Loop 'wait for request then send.
 Do :Loop Until Pin(DHTin):Device BitStream DHTout,83,a()
 Pin(DHTout) = 1
Next
End Sub

Sub DS3231 'read DS3231 RTC temp, if installed
Local integer Tdeg, Tdec
On Error skip 3 : RTC GetReg 17,Tdeg : RTC GetReg 18,Tdec
sensor(1) = Cint((Tdeg + Tdec / 256)*10) And &hFFF
Print (Tdeg + Tdec / 256);"C RTC",
End Sub

Sub DS18B20a 'read DS18B20 temp, if installed
On Error skip 3
TEMPR START gp0,2
sensor(2) = Cint(TEMPR(gp0)*10) And &hFFF
Print sensor(2)/10;"C DS18a",
End Sub

Sub DS18B20b 'read another DS18B20 temp, if installed
On Error skip 3
TEMPR START gp1,2 ': Pause 800
sensor(3) = Cint(TEMPR(gp1)*10) And &hFFF
Print sensor(3)/10;"C DS18b" ,
End Sub

Sub AHT10
Local integer dat(5)
I2C2 write &H38, 0, 3, 172, 51, 0  'trigger measurement for next read
Pause 100 'allow time to measure and prepare data
On error skip 4
I2C2 read &H38,1,6,dat() 'read data bytes
hAHT = Cint((dat(1)*256+(dat(2)And &Hf0))/65.536)
tAHT = Cint(((dat(3) And 15)*256 + dat(4)) / 2.048 - 500)
sensor(5) = hAHT And &hFFF : sensor(4) = tAHT And &hFFF
hAHT = sensor(5)/10 : tAHT = sensor(4)/10
Print tAHT;"C", hAHT;"% AHT",
End Sub

Sub dht11  'get DHT11 reading
If Timer > Tmr Then
 SetPin gp6,off
 Humid GP6, tDHT, hDHT, 1  'start DHT11 command
 SetPin gp6,din'   Pause 6
 sensor(7) = hDHT*10 And &hFFF : sensor(6) = tDHT*10 And &hFFF
 tmr=Timer+29000 '30 Sec. between reads
EndIf

Print "temp "; tDHT ;"C","humid ";hDHT ;"% DHT",
End Sub

Sub MM.Startup
 Print "Setting unused pins to DIN,pullup"
 Local Integer m, n
 For m=0 To 28
  n = MM.Info(pinno "GP"+Str$(m))
  If MM.Info(pin n)="OFF" Then SetPin n, DIN, PULLUP
'   Print n,"GP"+Str$(m), MM.Info(pin n)
 Next
End Sub

End
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 07:23am 11 Dec 2024
Copy link to clipboard 
Print this post

An interesting exercise.

I am impressed with your humidity readings. Here we are running at 60%+ with no sign of it dropping by any significant amount.

I struggle to get reliable readings out of any sensor for any length of time.

Jim
VK7JH
MMedit
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2611
Posted: 07:38am 11 Dec 2024
Copy link to clipboard 
Print this post

The humidity readings are a fraud! The DHT and AHT sensors are currently sealed in a jar with some silica gel.

We had some very high humidity recently resulting in the DHT11 reading 12% above the AHT10. It will be in "therapy" for a few days to recover.
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 237
Posted: 10:54pm 11 Dec 2024
Copy link to clipboard 
Print this post

phil99,

I think the DHT20 is better than the DHT11 and DHT22, which have the property of quickly reaching 100% when placed outside?
The specifications of the DHT20 are better, but it is I2C, so the distance between sensor and controller is shorter.
On the forum at WebMite ADC there is a program example I2C examples.pdf.
They are not that expensive at AliExpress, but that was a few years ago.

With its ability to measure humidity from 0-100% RH and temperatures from -40 to 80 degrees C, the DHT20 offers a wide measurement range for a variety of environmental conditions. The typical accuracy of ±3% for humidity and ±0.5℃ for temperature ensures reliable and accurate measurements.

Greetings,
Jan.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2611
Posted: 11:12pm 11 Dec 2024
Copy link to clipboard 
Print this post

You are right, the DHT11 humidity sensor is the worst of all in high humidity. And it needs to be revived regularly.

The reasons I still use it are:-

I don't really need great accuracy.
It will work on a long cable (tens of metres).
Since I already have it I may as well use it.

Phil

Edit. Looking at the datasheet the DHT20 appears to be the same as the AHT10
Edited 2024-12-12 09:26 by phil99
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 04:15am 12 Dec 2024
Copy link to clipboard 
Print this post

I have been comparing various sensors, looking for reliable temperature, humidity and pressure in the one chip.

The DHT20 is worth a try but pinout is odd and I will have to make a special socket for it. I need to redo the board anyway so not too bad. I will be dropping the DHT22.

I like it when all the modules can be interchanged easily. It makes comparisons easier.

My test results so far:
Temperature BME280 20.5, HTU21 20.1, BMP180 21.6, DHT22 20.5, SHT31 20.6
Humidity    BME280 50.4, HTU21 63.7,              DHT22 43.4  SHT31 60.8
Pressure    BME280 1011.0            BMP180 1010.2

The temperature on all modules compare very well.
The SHT31 humidity is the most believable so far.
On another BME280, the humidity has gone to 100% without any recovery. I don't expect much better with this one.
DHT22 humidity varies from 40 to 75% depending on the module I choose. All were "new"

Putting the pico at the top stops it's heating upsetting the readings when the cover is on.



Next step is to move the sensors out into the real world.
Sorry Phil, I used normal serial for my link.

Jim
VK7JH
MMedit
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2611
Posted: 07:19am 12 Dec 2024
Copy link to clipboard 
Print this post

Yes, serial is the sensible way to do it.
  Quote  This is in the "Because You Can" category rather than "The Best Way to do It".


Not sure if this is applicable to the DHT22 but I found the DHT11 humidity accuracy improves somewhat if the reading interval is extended to 30S. In the program above the DHT11 Sub skips read cycles until 29S is exceeded.

For the AHT10 the interval doesn't seem to matter.

Part of the issue with most humidity sensors is all manner of vapours can stick to the surface of the sensing element, affecting accuracy.
Removing them may require heating it to the maximum temperature that the sensor can tolerate for many hours. My silica gel method only removes the water.

I think the old dry bulb / wet bulb method is best for high humidity conditions.
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 237
Posted: 12:12am 14 Dec 2024
Copy link to clipboard 
Print this post

phil99,

The dry bulb-wet bulb method is indeed a proven method and can be calibrated yourself by adjusting the correct temperature for both sensors without a wick.
What is very important is that the cotton sock is clean and cannot drip and do not use demineralized water and that there is a suction fan above the sensors for the correct air flow. Possibly a filter at the suction opening to keep it clean.
The only problem is if the measuring box is placed outside in winter. They are still in abundance in the greenhouses in my area.

Greetings,
Jan.
 
zeitfest
Guru

Joined: 31/07/2019
Location: Australia
Posts: 574
Posted: 11:03pm 15 Dec 2024
Copy link to clipboard 
Print this post

Just a thought -
Water vapor absorbs IR at about 940 nm, and IR leds/detectors are cheaply available at that wavelength. It should be possible to measure how much IR is absorbed by a length of atmosphere and then calculate the humidity directly.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025