HDC1080 Temp & Feuchte Sensor +-0,2°C +-2%rel.F.

Procedure zum kopieren für Alle

tbegle
Benutzer
Avatar
Gender: n/a
Age: 64
Posts: 150
Registered: 01 / 2018
Subject:

HDC1080 Temp & Feuchte Sensor +-0,2°C +-2%rel.F.

 · 
Posted: 15.07.2018 - 18:43  ·  #1
Hallo,
ich habe in Anlehnung an den SHT21 eine für den HDC1080 abgewandelt.
Ein super Sensor für wenig Geld! ~1,5€/Stk + PORTO! + ATMEGA Nano Board ~2€/Stück
Den Sensor an 3,3V an das Board angeschlossen TWI 5V verträglich! - fertig!

Viel Spass
Toni

// ------------------- TWI HDC1080 (Temp & Feuchte) ---ok!------
// HDC1080 : byte = $40 // Adr.
procedure HDC1080_; // T+-0,2°C F +-2%
begin
if TWIstat(HDC1080)= true then // HDC1080 found?
TWIOut(HDC1080,00); // trigger temp
mdelay(100); // 100ms (14 bit!)
TWIInp(HDC1080,LW);
Hi(Wo) := lByArr[1]; // get the MSB
Lo(Wo) := lByArr[2]; // get the LSB
HDC_T := 165.00 * float(Wo)/65536 -40; // calculate the temperature
write(serout,'Temperatur '+floattostr(HDC_T:2:2)+'°C'+char(13));
// ---------------------------------------
TWIOut(HDC1080,01); // trig hum
mdelay(100); // 100ms (14 bit!)
TWIInp(HDC1080,LW);
Hi(Wo) := lByArr[1]; // get the MSB
Lo(Wo) := lByArr[2]; // get the LSB
HDC_H := 100 * float(Wo)/65536; // calculate humitity
write(serout,'rel. Feuchte '+floattostr(HDC_H:2:2)+'%'+char(13));
else
write(serout,'HDC1080 Fehler!'+char(13));
EndIf;
End;
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   36   50 · Page-Gen-Time: 0.022656s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI