├── .gitattributes ├── .gitignore ├── LICENSE.md ├── Libraries ├── Arduino │ ├── .gitattributes │ ├── .gitignore │ ├── LICENSE.md │ ├── README.md │ ├── examples │ │ ├── SparkFun_HTU21D_Demo │ │ │ └── SparkFun_HTU21D_Demo.ino │ │ └── SparkFun_HTU21D_RegisterReading │ │ │ └── SparkFun_HTU21D_RegisterReading.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── SparkFunHTU21D.cpp │ │ └── SparkFunHTU21D.h └── README.md ├── Production ├── HTU21D_Breakout-Panel-v12.brd └── README.md ├── README.md ├── firmware ├── HTU21D_SimpleSketch │ └── HTU21D_SimpleSketch.ino ├── README.md └── SparkFun_HTU21D_Example │ └── SparkFun_HTU21D_Example.ino └── hardware ├── README.md ├── SparkFun_HTU21D_Breakout.brd ├── SparkFun_HTU21D_Breakout.pdf └── SparkFun_HTU21D_Breakout.sch /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ############# 33 | ## Eagle 34 | ############# 35 | 36 | # Ignore the board and schematic backup files 37 | *.b#? 38 | *.s#? 39 | 40 | 41 | ################# 42 | ## Visual Studio 43 | ################# 44 | 45 | ## Ignore Visual Studio temporary files, build results, and 46 | ## files generated by popular Visual Studio add-ons. 47 | 48 | # User-specific files 49 | *.suo 50 | *.user 51 | *.sln.docstates 52 | 53 | # Build results 54 | [Dd]ebug/ 55 | [Rr]elease/ 56 | *_i.c 57 | *_p.c 58 | *.ilk 59 | *.meta 60 | *.obj 61 | *.pch 62 | *.pdb 63 | *.pgc 64 | *.pgd 65 | *.rsp 66 | *.sbr 67 | *.tlb 68 | *.tli 69 | *.tlh 70 | *.tmp 71 | *.vspscc 72 | .builds 73 | *.dotCover 74 | 75 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 76 | #packages/ 77 | 78 | # Visual C++ cache files 79 | ipch/ 80 | *.aps 81 | *.ncb 82 | *.opensdf 83 | *.sdf 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | 89 | # ReSharper is a .NET coding add-in 90 | _ReSharper* 91 | 92 | # Installshield output folder 93 | [Ee]xpress 94 | 95 | # DocProject is a documentation generator add-in 96 | DocProject/buildhelp/ 97 | DocProject/Help/*.HxT 98 | DocProject/Help/*.HxC 99 | DocProject/Help/*.hhc 100 | DocProject/Help/*.hhk 101 | DocProject/Help/*.hhp 102 | DocProject/Help/Html2 103 | DocProject/Help/html 104 | 105 | # Click-Once directory 106 | publish 107 | 108 | # Others 109 | [Bb]in 110 | [Oo]bj 111 | sql 112 | TestResults 113 | *.Cache 114 | ClientBin 115 | stylecop.* 116 | ~$* 117 | *.dbmdl 118 | Generated_Code #added for RIA/Silverlight projects 119 | 120 | # Backup & report files from converting an old project file to a newer 121 | # Visual Studio version. Backup files are not needed, because we have git ;-) 122 | _UpgradeReport_Files/ 123 | Backup*/ 124 | UpgradeLog*.XML 125 | 126 | 127 | ############ 128 | ## Windows 129 | ############ 130 | 131 | # Windows image file caches 132 | Thumbs.db 133 | 134 | # Folder config file 135 | Desktop.ini 136 | 137 | 138 | ############# 139 | ## Python 140 | ############# 141 | 142 | *.py[co] 143 | 144 | # Packages 145 | *.egg 146 | *.egg-info 147 | dist 148 | build 149 | eggs 150 | parts 151 | bin 152 | var 153 | sdist 154 | develop-eggs 155 | .installed.cfg 156 | 157 | # Installer logs 158 | pip-log.txt 159 | 160 | # Unit test / coverage reports 161 | .coverage 162 | .tox 163 | 164 | #Translations 165 | *.mo 166 | 167 | #Mr Developer 168 | .mr.developer.cfg 169 | 170 | # Mac crap 171 | .DS_Store 172 | 173 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | SparkFun License Information 2 | ============================= 3 | 4 | This product is open source! 5 | The hardware is released under [Creative Commons ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). 6 | The code is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round! 7 | Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. 8 | 9 | 10 | Distributed as-is; no warranty is given. 11 | 12 | - Your friends at SparkFun. 13 | 14 | -------------------------------------------------------------------------------- /Libraries/Arduino/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | 24 | -------------------------------------------------------------------------------- /Libraries/Arduino/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ############# 33 | ## Eagle 34 | ############# 35 | 36 | # Ignore the board and schematic backup files 37 | *.b#? 38 | *.s#? 39 | 40 | 41 | ################# 42 | ## Visual Studio 43 | ################# 44 | 45 | ## Ignore Visual Studio temporary files, build results, and 46 | ## files generated by popular Visual Studio add-ons. 47 | 48 | # User-specific files 49 | *.suo 50 | *.user 51 | *.sln.docstates 52 | 53 | # Build results 54 | [Dd]ebug/ 55 | [Rr]elease/ 56 | *_i.c 57 | *_p.c 58 | *.ilk 59 | *.meta 60 | *.obj 61 | *.pch 62 | *.pdb 63 | *.pgc 64 | *.pgd 65 | *.rsp 66 | *.sbr 67 | *.tlb 68 | *.tli 69 | *.tlh 70 | *.tmp 71 | *.vspscc 72 | .builds 73 | *.dotCover 74 | 75 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 76 | #packages/ 77 | 78 | # Visual C++ cache files 79 | ipch/ 80 | *.aps 81 | *.ncb 82 | *.opensdf 83 | *.sdf 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | 89 | # ReSharper is a .NET coding add-in 90 | _ReSharper* 91 | 92 | # Installshield output folder 93 | [Ee]xpress 94 | 95 | # DocProject is a documentation generator add-in 96 | DocProject/buildhelp/ 97 | DocProject/Help/*.HxT 98 | DocProject/Help/*.HxC 99 | DocProject/Help/*.hhc 100 | DocProject/Help/*.hhk 101 | DocProject/Help/*.hhp 102 | DocProject/Help/Html2 103 | DocProject/Help/html 104 | 105 | # Click-Once directory 106 | publish 107 | 108 | # Others 109 | [Bb]in 110 | [Oo]bj 111 | sql 112 | TestResults 113 | *.Cache 114 | ClientBin 115 | stylecop.* 116 | ~$* 117 | *.dbmdl 118 | Generated_Code #added for RIA/Silverlight projects 119 | 120 | # Backup & report files from converting an old project file to a newer 121 | # Visual Studio version. Backup files are not needed, because we have git ;-) 122 | _UpgradeReport_Files/ 123 | Backup*/ 124 | UpgradeLog*.XML 125 | 126 | 127 | ############ 128 | ## Windows 129 | ############ 130 | 131 | # Windows image file caches 132 | Thumbs.db 133 | 134 | # Folder config file 135 | Desktop.ini 136 | 137 | 138 | ############# 139 | ## Python 140 | ############# 141 | 142 | *.py[co] 143 | 144 | # Packages 145 | *.egg 146 | *.egg-info 147 | dist 148 | build 149 | eggs 150 | parts 151 | bin 152 | var 153 | sdist 154 | develop-eggs 155 | .installed.cfg 156 | 157 | # Installer logs 158 | pip-log.txt 159 | 160 | # Unit test / coverage reports 161 | .coverage 162 | .tox 163 | 164 | #Translations 165 | *.mo 166 | 167 | #Mr Developer 168 | .mr.developer.cfg 169 | 170 | # Mac crap 171 | .DS_Store 172 | 173 | -------------------------------------------------------------------------------- /Libraries/Arduino/LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | License Information 3 | ------------------- 4 | 5 | The hardware is released under [Creative Commons Share-alike 3.0](http://creativecommons.org/licenses/by-sa/3.0/). 6 | 7 | All other code is open source so please feel free to do anything you want with it; you buy me a beer if you use this and we meet someday ([Beerware license](http://en.wikipedia.org/wiki/Beerware)). 8 | 9 | 10 | -------------------------------------------------------------------------------- /Libraries/Arduino/README.md: -------------------------------------------------------------------------------- 1 | SparkFun Humidity and Temperature Sensor Breakout - HTU21D 2 | =========================================================== 3 | 4 | 5 | ![SparkFun Humidity and Temperature Sensor Breakout - HTU21D](https://dlnmh9ip6v2uc.cloudfront.net/images/products/1/2/0/6/4/12064-04.jpg) 6 | 7 | [*SparkFun Humidity and Temperature Sensor Breakout - HTU21D (SEN-12064)*](https://www.sparkfun.com/products/12064) 8 | 9 | This is a breadboard friendly breakout board for the Measurement Specialties high-precision, low-power digital humidity sensor. 10 | 11 | Repository Contents 12 | ------------------- 13 | 14 | * **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE. 15 | * **/src** - Source files for the library (.cpp, .h). 16 | * **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE. 17 | * **library.properties** - General library properties for the Arduino package manager. 18 | 19 | Documentation 20 | -------------- 21 | 22 | * **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library. 23 | * **[Product Repository](https://github.com/sparkfun/HTU21D_Breakout)** - Main repository (including hardware files) for the HTU21D breakout board. 24 | * **[Hookup Guide](https://learn.sparkfun.com/tutorials/htu21d-humidity-sensor-hookup-guide?_ga=1.239533187.1678495895.1378918345)** - Basic hookup guide for the HTU21D breakout board. 25 | 26 | 27 | License Information 28 | ------------------- 29 | 30 | This product is _**open source**_! 31 | 32 | The **code** is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round! 33 | 34 | Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. 35 | 36 | Distributed as-is; no warranty is given. 37 | 38 | - Your friends at SparkFun. 39 | -------------------------------------------------------------------------------- /Libraries/Arduino/examples/SparkFun_HTU21D_Demo/SparkFun_HTU21D_Demo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | HTU21D Humidity Sensor Example Code 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: September 15th, 2013 6 | License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). 7 | 8 | Uses the HTU21D library to display the current humidity and temperature 9 | 10 | Open serial monitor at 9600 baud to see readings. Errors 998 if not sensor is detected. Error 999 if CRC is bad. 11 | 12 | Hardware Connections (Breakoutboard to Arduino): 13 | -VCC = 3.3V 14 | -GND = GND 15 | -SDA = A4 (use inline 330 ohm resistor if your board is 5V) 16 | -SCL = A5 (use inline 330 ohm resistor if your board is 5V) 17 | 18 | */ 19 | 20 | #include 21 | #include "SparkFunHTU21D.h" 22 | 23 | //Create an instance of the object 24 | HTU21D myHumidity; 25 | 26 | void setup() 27 | { 28 | Serial.begin(9600); 29 | Serial.println("HTU21D Example!"); 30 | 31 | myHumidity.begin(); 32 | } 33 | 34 | void loop() 35 | { 36 | float humd = myHumidity.readHumidity(); 37 | float temp = myHumidity.readTemperature(); 38 | 39 | Serial.print("Time:"); 40 | Serial.print(millis()); 41 | Serial.print(" Temperature:"); 42 | Serial.print(temp, 1); 43 | Serial.print("C"); 44 | Serial.print(" Humidity:"); 45 | Serial.print(humd, 1); 46 | Serial.print("%"); 47 | 48 | Serial.println(); 49 | delay(1000); 50 | } -------------------------------------------------------------------------------- /Libraries/Arduino/examples/SparkFun_HTU21D_RegisterReading/SparkFun_HTU21D_RegisterReading.ino: -------------------------------------------------------------------------------- 1 | /* 2 | HTU21D Humidity Sensor Example Code 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: September 15th, 2013 6 | License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). 7 | 8 | This example demonstrates how to read the user registers to display resolution and other settings. 9 | 10 | Uses the HTU21D library to display the current humidity and temperature 11 | 12 | Open serial monitor at 9600 baud to see readings. Errors 998 if not sensor is detected. Error 999 if CRC is bad. 13 | 14 | Hardware Connections (Breakoutboard to Arduino): 15 | -VCC = 3.3V 16 | -GND = GND 17 | -SDA = A4 (use inline 330 ohm resistor if your board is 5V) 18 | -SCL = A5 (use inline 330 ohm resistor if your board is 5V) 19 | 20 | */ 21 | 22 | #include 23 | #include "SparkFunHTU21D.h" 24 | 25 | //Create an instance of the object 26 | HTU21D myHumidity; 27 | 28 | void show_yes_no(const char *prefix, int val) 29 | { 30 | Serial.print(prefix); 31 | if (val) 32 | Serial.println("yes"); 33 | else 34 | Serial.println("no"); 35 | } 36 | 37 | void dump_user_register() 38 | { 39 | byte reg = myHumidity.readUserRegister(); 40 | 41 | Serial.print("Resolution (Humidity, Temperature): "); 42 | switch (reg & USER_REGISTER_RESOLUTION_MASK) { 43 | case USER_REGISTER_RESOLUTION_RH12_TEMP14: Serial.print(12); Serial.print(", "); Serial.println(14); break; 44 | case USER_REGISTER_RESOLUTION_RH8_TEMP12: Serial.print(8); Serial.print(", "); Serial.println(12); break; 45 | case USER_REGISTER_RESOLUTION_RH10_TEMP13: Serial.print(10); Serial.print(", "); Serial.println(13); break; 46 | case USER_REGISTER_RESOLUTION_RH11_TEMP11: Serial.print(11); Serial.print(", "); Serial.println(11); break; 47 | } 48 | 49 | show_yes_no("End of battery: ", reg & USER_REGISTER_END_OF_BATTERY); 50 | show_yes_no("Heater enabled: ", reg & USER_REGISTER_HEATER_ENABLED); 51 | show_yes_no("Disable OTP reload: ", reg & USER_REGISTER_DISABLE_OTP_RELOAD); 52 | } 53 | 54 | void setup() 55 | { 56 | Serial.begin(9600); 57 | Serial.println("HTU21D Example!"); 58 | 59 | myHumidity.begin(); 60 | 61 | dump_user_register(); 62 | } 63 | 64 | void loop() 65 | { 66 | float humd = myHumidity.readHumidity(); 67 | float temp = myHumidity.readTemperature(); 68 | 69 | Serial.print("Time:"); 70 | Serial.print(millis()); 71 | Serial.print(" Temperature:"); 72 | Serial.print(temp, 1); 73 | Serial.print("C"); 74 | Serial.print(" Humidity:"); 75 | Serial.print(humd, 1); 76 | Serial.print("%"); 77 | 78 | Serial.println(); 79 | delay(1000); 80 | } 81 | -------------------------------------------------------------------------------- /Libraries/Arduino/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | HTU21D KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | readHumidity KEYWORD2 17 | readTemperature KEYWORD2 18 | setResolution KEYWORD2 19 | 20 | ####################################### 21 | # Constants (LITERAL1) 22 | ####################################### -------------------------------------------------------------------------------- /Libraries/Arduino/library.properties: -------------------------------------------------------------------------------- 1 | name=SparkFun HTU21D Humidity and Temperature Sensor Breakout 2 | version=1.1.3 3 | author=SparkFun Electronics 4 | maintainer=SparkFun Electronics 5 | sentence=HTU21D temperature and humidity densor breakout. 6 | paragraph=This is a breadboard friendly breakout board for the Measurement Specialties HTU21D, a high-precision, low-power digital temperature and humidity sensor. 7 | category=Sensors 8 | url=https://github.com/sparkfun/SparkFun_HTU21D_Breakout_Arduino_Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /Libraries/Arduino/src/SparkFunHTU21D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | HTU21D Humidity Sensor Library 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: September 22nd, 2013 6 | License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). 7 | 8 | This library allows an Arduino to read from the HTU21D low-cost high-precision humidity sensor. 9 | 10 | If you have feature suggestions or need support please use the github support page: https://github.com/sparkfun/HTU21D 11 | 12 | Hardware Setup: The HTU21D lives on the I2C bus. Attach the SDA pin to A4, SCL to A5. If you are using the SparkFun 13 | breakout board you *do not* need 4.7k pull-up resistors on the bus (they are built-in). 14 | 15 | Link to the breakout board product: 16 | 17 | Software: 18 | Call HTU21D.Begin() in setup. 19 | HTU21D.ReadHumidity() will return a float containing the humidity. Ex: 54.7 20 | HTU21D.ReadTemperature() will return a float containing the temperature in Celsius. Ex: 24.1 21 | HTU21D.SetResolution(byte: 0b.76543210) sets the resolution of the readings. 22 | HTU21D.check_crc(message, check_value) verifies the 8-bit CRC generated by the sensor 23 | HTU21D.read_user_register() returns the user register. Used to set resolution. 24 | */ 25 | 26 | #include 27 | 28 | #include "SparkFunHTU21D.h" 29 | 30 | HTU21D::HTU21D() 31 | { 32 | //Set initial values for private vars 33 | } 34 | 35 | //Begin 36 | /*******************************************************************************************/ 37 | //Start I2C communication 38 | void HTU21D::begin(TwoWire &wirePort) 39 | { 40 | _i2cPort = &wirePort; //Grab which port the user wants us to use 41 | 42 | _i2cPort->begin(); 43 | } 44 | 45 | #define MAX_WAIT 100 46 | #define DELAY_INTERVAL 10 47 | #define MAX_COUNTER (MAX_WAIT/DELAY_INTERVAL) 48 | 49 | //Given a command, reads a given 2-byte value with CRC from the HTU21D 50 | uint16_t HTU21D::readValue(byte cmd) 51 | { 52 | //Request a humidity reading 53 | _i2cPort->beginTransmission(HTU21D_ADDRESS); 54 | _i2cPort->write(cmd); //Measure value (prefer no hold!) 55 | _i2cPort->endTransmission(); 56 | 57 | //Hang out while measurement is taken. datasheet says 50ms, practice may call for more 58 | byte toRead; 59 | byte counter; 60 | for (counter = 0, toRead = 0 ; counter < MAX_COUNTER && toRead != 3 ; counter++) 61 | { 62 | delay(DELAY_INTERVAL); 63 | 64 | //Comes back in three bytes, data(MSB) / data(LSB) / Checksum 65 | toRead = _i2cPort->requestFrom(HTU21D_ADDRESS, 3); 66 | } 67 | 68 | if (counter == MAX_COUNTER) return (ERROR_I2C_TIMEOUT); //Error out 69 | 70 | byte msb, lsb, checksum; 71 | msb = _i2cPort->read(); 72 | lsb = _i2cPort->read(); 73 | checksum = _i2cPort->read(); 74 | 75 | uint16_t rawValue = ((uint16_t) msb << 8) | (uint16_t) lsb; 76 | 77 | if (checkCRC(rawValue, checksum) != 0) return (ERROR_BAD_CRC); //Error out 78 | 79 | return rawValue & 0xFFFC; // Zero out the status bits 80 | } 81 | 82 | //Read the humidity 83 | /*******************************************************************************************/ 84 | //Calc humidity and return it to the user 85 | //Returns 998 if I2C timed out 86 | //Returns 999 if CRC is wrong 87 | float HTU21D::readHumidity(void) 88 | { 89 | uint16_t rawHumidity = readValue(TRIGGER_HUMD_MEASURE_NOHOLD); 90 | 91 | if(rawHumidity == ERROR_I2C_TIMEOUT || rawHumidity == ERROR_BAD_CRC) return(rawHumidity); 92 | 93 | //Given the raw humidity data, calculate the actual relative humidity 94 | float tempRH = rawHumidity * (125.0 / 65536.0); //2^16 = 65536 95 | float rh = tempRH - 6.0; //From page 14 96 | 97 | return (rh); 98 | } 99 | 100 | //Read the temperature 101 | /*******************************************************************************************/ 102 | //Calc temperature and return it to the user 103 | //Returns 998 if I2C timed out 104 | //Returns 999 if CRC is wrong 105 | float HTU21D::readTemperature(void) 106 | { 107 | uint16_t rawTemperature = readValue(TRIGGER_TEMP_MEASURE_NOHOLD); 108 | 109 | if(rawTemperature == ERROR_I2C_TIMEOUT || rawTemperature == ERROR_BAD_CRC) return(rawTemperature); 110 | 111 | //Given the raw temperature data, calculate the actual temperature 112 | float tempTemperature = rawTemperature * (175.72 / 65536.0); //2^16 = 65536 113 | float realTemperature = tempTemperature - 46.85; //From page 14 114 | 115 | return (realTemperature); 116 | } 117 | 118 | //Set sensor resolution 119 | /*******************************************************************************************/ 120 | //Sets the sensor resolution to one of four levels 121 | //Page 12: 122 | // 0/0 = 12bit RH, 14bit Temp 123 | // 0/1 = 8bit RH, 12bit Temp 124 | // 1/0 = 10bit RH, 13bit Temp 125 | // 1/1 = 11bit RH, 11bit Temp 126 | //Power on default is 0/0 127 | 128 | void HTU21D::setResolution(byte resolution) 129 | { 130 | byte userRegister = readUserRegister(); //Go get the current register state 131 | userRegister &= B01111110; //Turn off the resolution bits 132 | resolution &= B10000001; //Turn off all other bits but resolution bits 133 | userRegister |= resolution; //Mask in the requested resolution bits 134 | 135 | //Request a write to user register 136 | writeUserRegister(userRegister); 137 | } 138 | 139 | //Read the user register 140 | byte HTU21D::readUserRegister(void) 141 | { 142 | byte userRegister; 143 | 144 | //Request the user register 145 | _i2cPort->beginTransmission(HTU21D_ADDRESS); 146 | _i2cPort->write(READ_USER_REG); //Read the user register 147 | _i2cPort->endTransmission(); 148 | 149 | //Read result 150 | _i2cPort->requestFrom(HTU21D_ADDRESS, 1); 151 | 152 | userRegister = _i2cPort->read(); 153 | 154 | return (userRegister); 155 | } 156 | 157 | void HTU21D::writeUserRegister(byte val) 158 | { 159 | _i2cPort->beginTransmission(HTU21D_ADDRESS); 160 | _i2cPort->write(WRITE_USER_REG); //Write to the user register 161 | _i2cPort->write(val); //Write the new resolution bits 162 | _i2cPort->endTransmission(); 163 | } 164 | 165 | //Give this function the 2 byte message (measurement) and the check_value byte from the HTU21D 166 | //If it returns 0, then the transmission was good 167 | //If it returns something other than 0, then the communication was corrupted 168 | //From: http://www.nongnu.org/avr-libc/user-manual/group__util__crc.html 169 | //POLYNOMIAL = 0x0131 = x^8 + x^5 + x^4 + 1 : http://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks 170 | #define SHIFTED_DIVISOR 0x988000 //This is the 0x0131 polynomial shifted to farthest left of three bytes 171 | 172 | byte HTU21D::checkCRC(uint16_t message_from_sensor, uint8_t check_value_from_sensor) 173 | { 174 | //Test cases from datasheet: 175 | //message = 0xDC, checkvalue is 0x79 176 | //message = 0x683A, checkvalue is 0x7C 177 | //message = 0x4E85, checkvalue is 0x6B 178 | 179 | uint32_t remainder = (uint32_t)message_from_sensor << 8; //Pad with 8 bits because we have to add in the check value 180 | remainder |= check_value_from_sensor; //Add on the check value 181 | 182 | uint32_t divsor = (uint32_t)SHIFTED_DIVISOR; 183 | 184 | for (int i = 0 ; i < 16 ; i++) //Operate on only 16 positions of max 24. The remaining 8 are our remainder and should be zero when we're done. 185 | { 186 | //Serial.print("remainder: "); 187 | //Serial.println(remainder, BIN); 188 | //Serial.print("divsor: "); 189 | //Serial.println(divsor, BIN); 190 | //Serial.println(); 191 | 192 | if ( remainder & (uint32_t)1 << (23 - i) ) //Check if there is a one in the left position 193 | remainder ^= divsor; 194 | 195 | divsor >>= 1; //Rotate the divsor max 16 times so that we have 8 bits left of a remainder 196 | } 197 | 198 | return (byte)remainder; 199 | } -------------------------------------------------------------------------------- /Libraries/Arduino/src/SparkFunHTU21D.h: -------------------------------------------------------------------------------- 1 | /* 2 | HTU21D Humidity Sensor Library 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: September 22nd, 2013 6 | License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). 7 | 8 | Get humidity and temperature from the HTU21D sensor. 9 | 10 | This same library should work for the other similar sensors including the Si 11 | 12 | */ 13 | 14 | 15 | #if defined(ARDUINO) && ARDUINO >= 100 16 | #include "Arduino.h" 17 | #else 18 | #include "WProgram.h" 19 | #endif 20 | 21 | #include 22 | 23 | #define HTU21D_ADDRESS 0x40 //Unshifted 7-bit I2C address for the sensor 24 | 25 | #define ERROR_I2C_TIMEOUT 998 26 | #define ERROR_BAD_CRC 999 27 | 28 | #define TRIGGER_TEMP_MEASURE_HOLD 0xE3 29 | #define TRIGGER_HUMD_MEASURE_HOLD 0xE5 30 | #define TRIGGER_TEMP_MEASURE_NOHOLD 0xF3 31 | #define TRIGGER_HUMD_MEASURE_NOHOLD 0xF5 32 | #define WRITE_USER_REG 0xE6 33 | #define READ_USER_REG 0xE7 34 | #define SOFT_RESET 0xFE 35 | 36 | #define USER_REGISTER_RESOLUTION_MASK 0x81 37 | #define USER_REGISTER_RESOLUTION_RH12_TEMP14 0x00 38 | #define USER_REGISTER_RESOLUTION_RH8_TEMP12 0x01 39 | #define USER_REGISTER_RESOLUTION_RH10_TEMP13 0x80 40 | #define USER_REGISTER_RESOLUTION_RH11_TEMP11 0x81 41 | 42 | #define USER_REGISTER_END_OF_BATTERY 0x40 43 | #define USER_REGISTER_HEATER_ENABLED 0x04 44 | #define USER_REGISTER_DISABLE_OTP_RELOAD 0x02 45 | 46 | class HTU21D { 47 | 48 | public: 49 | HTU21D(); 50 | 51 | //Public Functions 52 | void begin(TwoWire &wirePort = Wire); //If user doesn't specificy then Wire will be used 53 | float readHumidity(void); 54 | float readTemperature(void); 55 | void setResolution(byte resBits); 56 | 57 | byte readUserRegister(void); 58 | void writeUserRegister(byte val); 59 | 60 | //Public Variables 61 | 62 | private: 63 | //Private Functions 64 | TwoWire *_i2cPort; //The generic connection to user's chosen I2C hardware 65 | 66 | byte checkCRC(uint16_t message_from_sensor, uint8_t check_value_from_sensor); 67 | uint16_t readValue(byte cmd); 68 | 69 | //Private Variables 70 | 71 | }; 72 | -------------------------------------------------------------------------------- /Libraries/README.md: -------------------------------------------------------------------------------- 1 | SparkFun HTU21D Libraries 2 | ================================= 3 | 4 | Libraries for use in different environments. 5 | 6 | 7 | Directory Contents 8 | ------------------- 9 | Arduino - [Arduino IDE](httpwww.arduino.ccenMainSoftware) libraries 10 | 11 | 12 | License Information 13 | ------------------- 14 | This product is open source! 15 | The code is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round! 16 | Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. 17 | 18 | Distributed as-is; no warranty is given. 19 | 20 | - Your friends at SparkFun. 21 | 22 | Update Library Instructions: 23 | ---------------------------- 24 | To get the most up-to-date version of the library, you must run the following git subtree commands. 25 | 26 | $git subtree pull -P Libraries/Arduino --squash https://github.com/sparkfun/SparkFun_HTU21D_Breakout_Arduino_Library.git master -------------------------------------------------------------------------------- /Production/README.md: -------------------------------------------------------------------------------- 1 | SparkFun Production Files 2 | ========================================= 3 | 4 | 5 | These are the production files SparkFun uses for printing PCBs. 6 | 7 | 8 | License Information 9 | ------------------- 10 | This product is open source! 11 | 12 | The hardware is released under [Creative Commons ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). 13 | 14 | Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. 15 | 16 | Distributed as-is; no warranty is given. 17 | 18 | - Your friends at SparkFun. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **NOTE:** *This product has been retired from our catalog. If you are looking for more up-to-date info, please check out some of these resources to see how other users are still hacking and improving on this product.* 2 | * *[SparkFun Forum](https://forum.sparkfun.com/)* 3 | * *[Comments Here on GitHub](https://github.com/sparkfun/HTU21D_Breakout/issues)* 4 | 5 | *We recommend looking at the [Si7021](https://www.sparkfun.com/products/13763), which is a drop-in replacement for the HTU21D. It uses the same address and methods to read the sensor.* 6 | 7 | SparkFun Humidity and Temperature Sensor Breakout - HTU21D 8 | =========================================================== 9 | 10 | ![SparkFun Humidity and Temperature Sensor Breakout - HTU21D](https://dlnmh9ip6v2uc.cloudfront.net/images/products/1/2/0/6/4/12064-04.jpg) 11 | 12 | [*SparkFun Humidity and Temperature Sensor Breakout - HTU21D (SEN-12064)*](https://www.sparkfun.com/products/12064) 13 | 14 | This is a breadboard friendly breakout board for the Measurement Specialties high-precision, low-power digital humidity sensor. 15 | 16 | Repository Contents 17 | ------------------- 18 | * **/Firmware** - Example code 19 | * **/Hardware** - Eagle design files (.brd, .sch) 20 | * **/Libraries** - Libraries for use with the 21 | * **/Production** - Production panel files (.brd) 22 | 23 | Documentation 24 | -------------- 25 | * **[Library](https://github.com/sparkfun/SparkFun_HTU21D_Breakout_Arduino_Library)** - Arduino library for the HTU21D. 26 | * **[Hookup Guide](https://learn.sparkfun.com/tutorials/htu21d-humidity-sensor-hookup-guide)** - Basic hookup guide for the HTU21D. 27 | * **[SparkFun Fritzing repo](https://github.com/sparkfun/Fritzing_Parts)** - Fritzing diagrams for SparkFun products. 28 | * **[SparkFun 3D Model repo](https://github.com/sparkfun/3D_Models)** - 3D models of SparkFun products. 29 | 30 | 31 | License Information 32 | ------------------- 33 | This product is _**open source**_! 34 | 35 | The **hardware** is released under [Creative Commons ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). 36 | 37 | The **code** is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round! 38 | 39 | Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. 40 | 41 | Distributed as-is; no warranty is given. 42 | 43 | - Your friends at SparkFun. 44 | -------------------------------------------------------------------------------- /firmware/HTU21D_SimpleSketch/HTU21D_SimpleSketch.ino: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | HTU21D Simple Sketch demo 4 | Dave@sparkfun 5 | SparkFun Electronics 6 | License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). 7 | 8 | Get humidity and temperature from the HTU21D sensor. 9 | 10 | Hardware Connections (Breakoutboard to Arduino): 11 | -VCC = 3.3V 12 | -GND = GND 13 | -SDA = A4 14 | -SCL = A5 15 | 16 | Serial.print it out at 9600 baud to serial monitor. 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | SoftwareSerial display(3, 2); 24 | 25 | //Create an instance of the object 26 | HTU21D myHumidity; 27 | 28 | char humstring[10]; 29 | char tmpstring[10]; 30 | 31 | float humidity; 32 | float temperature; 33 | 34 | int ihum; 35 | int itemp; 36 | 37 | void setup() 38 | { 39 | Wire.begin(); // Join i2c bus 40 | Serial.begin(9600); // Start serial for output 41 | 42 | myHumidity.begin(); // Get sensor online 43 | 44 | display.begin(9600); 45 | Serial.begin(9600); 46 | delay(500); 47 | 48 | display.write(254); // move cursor to beginning of first line 49 | display.write(128); 50 | 51 | display.write(" "); // clear display 52 | display.write(" "); 53 | } 54 | 55 | void loop() 56 | { 57 | humidity = myHumidity.readHumidity(); 58 | ihum = humidity; 59 | sprintf(humstring, "%2d", ihum); 60 | 61 | Serial.print("Humidity: "); 62 | Serial.println(humstring); 63 | Serial.print("%"); 64 | 65 | display.write("Humidity: "); 66 | display.write(humstring); 67 | 68 | display.write(254); // move cursor to beginning of first line 69 | display.write(128); 70 | 71 | delay(250); 72 | } 73 | 74 | -------------------------------------------------------------------------------- /firmware/README.md: -------------------------------------------------------------------------------- 1 | SparkFun HTU21D Firmware 2 | =================================== 3 | 4 | * **HTU21D_SimpleSketch** - Arduino simple sketch example. See video [here](https://youtu.be/HfNsybUKU6U). 5 | * **SparkFun_HTU21D_Example** - Arduino example sketch for getting started. No library required. 6 | 7 | 8 | -------------------------------------------------------------------------------- /firmware/SparkFun_HTU21D_Example/SparkFun_HTU21D_Example.ino: -------------------------------------------------------------------------------- 1 | /* 2 | HTU21D Humidity Sensor Example Code 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: September 15th, 2013 6 | License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). 7 | 8 | Get humidity and temperature from the HTU21D sensor. 9 | 10 | Hardware Connections (Breakoutboard to Arduino): 11 | -VCC = 3.3V 12 | -GND = GND 13 | -SDA = A4 14 | -SCL = A5 15 | 16 | Serial.print it out at 9600 baud to serial monitor. 17 | */ 18 | 19 | #include 20 | 21 | #define HTDU21D_ADDRESS 0x40 //Unshifted 7-bit I2C address for the sensor 22 | 23 | #define TRIGGER_TEMP_MEASURE_HOLD 0xE3 24 | #define TRIGGER_HUMD_MEASURE_HOLD 0xE5 25 | #define TRIGGER_TEMP_MEASURE_NOHOLD 0xF3 26 | #define TRIGGER_HUMD_MEASURE_NOHOLD 0xF5 27 | #define WRITE_USER_REG 0xE6 28 | #define READ_USER_REG 0xE7 29 | #define SOFT_RESET 0xFE 30 | 31 | byte sensorStatus; 32 | 33 | void setup() 34 | { 35 | Serial.begin(9600); 36 | Serial.println("HTU21D Example!"); 37 | 38 | Wire.begin(); 39 | } 40 | 41 | void loop() 42 | { 43 | unsigned int rawHumidity = htdu21d_readHumidity(); 44 | unsigned int rawTemperature = htdu21d_readTemp(); 45 | 46 | float temperature = calc_temp(rawTemperature); 47 | float relativeHumidity = calc_humidity(rawHumidity); //Turn the humidity signal into actual humidity 48 | 49 | Serial.print("Temperature: "); 50 | Serial.print(temperature, 1); //Print float with one decimal 51 | Serial.print(" C"); 52 | Serial.print(" Relative Humidity: "); 53 | Serial.print(relativeHumidity, 1); 54 | Serial.print(" %"); 55 | Serial.println(); 56 | delay(1000); 57 | } 58 | 59 | //Read the uncompensated temperature value 60 | unsigned int htdu21d_readTemp() 61 | { 62 | //Request the temperature 63 | Wire.beginTransmission(HTDU21D_ADDRESS); 64 | Wire.write(TRIGGER_TEMP_MEASURE_NOHOLD); 65 | Wire.endTransmission(); 66 | 67 | //Wait for sensor to complete measurement 68 | delay(60); //44-50 ms max - we could also poll the sensor 69 | 70 | //Comes back in three bytes, data(MSB) / data(LSB) / CRC 71 | Wire.requestFrom(HTDU21D_ADDRESS, 3); 72 | 73 | //Wait for data to become available 74 | int counter = 0; 75 | while(Wire.available() < 3) 76 | { 77 | counter++; 78 | delay(1); 79 | if(counter > 100) return 998; //Error out 80 | } 81 | 82 | unsigned char msb, lsb, crc; 83 | msb = Wire.read(); 84 | lsb = Wire.read(); 85 | crc = Wire.read(); //We don't do anything with CRC for now 86 | 87 | unsigned int temperature = ((unsigned int)msb << 8) | lsb; 88 | temperature &= 0xFFFC; //Zero out the status bits but keep them in place 89 | 90 | return temperature; 91 | } 92 | 93 | //Read the humidity 94 | unsigned int htdu21d_readHumidity() 95 | { 96 | byte msb, lsb, checksum; 97 | 98 | //Request a humidity reading 99 | Wire.beginTransmission(HTDU21D_ADDRESS); 100 | Wire.write(TRIGGER_HUMD_MEASURE_NOHOLD); //Measure humidity with no bus holding 101 | Wire.endTransmission(); 102 | 103 | //Hang out while measurement is taken. 50mS max, page 4 of datasheet. 104 | delay(55); 105 | 106 | //Read result 107 | Wire.requestFrom(HTDU21D_ADDRESS, 3); 108 | 109 | //Wait for data to become available 110 | int counter = 0; 111 | while(Wire.available() < 3) 112 | { 113 | counter++; 114 | delay(1); 115 | if(counter > 100) return 0; //Error out 116 | } 117 | 118 | msb = Wire.read(); 119 | lsb = Wire.read(); 120 | checksum = Wire.read(); 121 | 122 | unsigned int rawHumidity = ((unsigned int) msb << 8) | (unsigned int) lsb; 123 | rawHumidity &= 0xFFFC; //Zero out the status bits but keep them in place 124 | 125 | return(rawHumidity); 126 | } 127 | 128 | //Given the raw temperature data, calculate the actual temperature 129 | float calc_temp(int SigTemp) 130 | { 131 | float tempSigTemp = SigTemp / (float)65536; //2^16 = 65536 132 | float realTemperature = -46.85 + (175.72 * tempSigTemp); //From page 14 133 | 134 | return(realTemperature); 135 | } 136 | 137 | //Given the raw humidity data, calculate the actual relative humidity 138 | float calc_humidity(int SigRH) 139 | { 140 | float tempSigRH = SigRH / (float)65536; //2^16 = 65536 141 | float rh = -6 + (125 * tempSigRH); //From page 14 142 | 143 | return(rh); 144 | } 145 | 146 | //Read the user register 147 | byte read_user_register(void) 148 | { 149 | byte userRegister; 150 | 151 | //Request the user register 152 | Wire.beginTransmission(HTDU21D_ADDRESS); 153 | Wire.write(READ_USER_REG); //Read the user register 154 | Wire.endTransmission(); 155 | 156 | //Read result 157 | Wire.requestFrom(HTDU21D_ADDRESS, 1); 158 | 159 | userRegister = Wire.read(); 160 | 161 | return(userRegister); 162 | } 163 | 164 | //Write to the user register 165 | //NOTE: We disable all bits except for measurement resolution 166 | //Bit 7 & 0 = Measurement resolution 167 | //Bit 6 = Status of battery 168 | //Bit 5/4/3 = Reserved 169 | //Bit 2 = Enable on-board heater 170 | //Bit 1 = Disable OTP reload 171 | void write_user_register(byte thing_to_write) 172 | { 173 | byte userRegister = read_user_register(); //Go get the current register state 174 | userRegister &= 0b01111110; //Turn off the resolution bits 175 | thing_to_write &= 0b10000001; //Turn off all other bits but resolution bits 176 | userRegister |= thing_to_write; //Mask in the requested resolution bits 177 | 178 | //Request a write to user register 179 | Wire.beginTransmission(HTDU21D_ADDRESS); 180 | Wire.write(WRITE_USER_REG); //Write to the user register 181 | Wire.write(userRegister); //Write to the data 182 | Wire.endTransmission(); 183 | } 184 | 185 | //Give this function the 2 byte message (measurement) and the check_value byte from the HTU21D 186 | //If it returns 0, then the transmission was good 187 | //If it returns something other than 0, then the communication was corrupted 188 | //From: http://www.nongnu.org/avr-libc/user-manual/group__util__crc.html 189 | //POLYNOMIAL = 0x0131 = x^8 + x^5 + x^4 + 1 : http://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks 190 | #define SHIFTED_DIVISOR 0x988000 //This is the 0x0131 polynomial shifted to farthest left of three bytes 191 | 192 | unsigned int check_crc(uint16_t message_from_sensor, uint8_t check_value_from_sensor) 193 | { 194 | //Test cases from datasheet: 195 | //message = 0xDC, result is 0x79 196 | //message = 0x683A, result is 0x7C 197 | //message = 0x4E85, result is 0x6B 198 | 199 | uint32_t remainder = (uint32_t)message_from_sensor << 8; //Pad with 8 bits because we have to add in the result/check value 200 | remainder |= check_value_from_sensor; //Add on the check value 201 | 202 | uint32_t divsor = (uint32_t)SHIFTED_DIVISOR; 203 | 204 | for (int i = 0 ; i < 16 ; i++) //Operate on only 16 positions of max 24. The remaining 8 are our remainder and should be zero when we're done. 205 | { 206 | //Serial.print("remainder: "); 207 | //Serial.println(remainder, BIN); 208 | //Serial.print("divsor: "); 209 | //Serial.println(divsor, BIN); 210 | //Serial.println(); 211 | 212 | if( remainder & (uint32_t)1<<(23 - i) ) //Check if there is a one in the left position 213 | remainder ^= divsor; 214 | 215 | divsor >>= 1; //Rotate the divsor max 16 times so that we have 8 bits left of a remainder 216 | } 217 | 218 | return remainder; 219 | } 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /hardware/README.md: -------------------------------------------------------------------------------- 1 | SparkFun Design Files 2 | ===================================== 3 | 4 | The .sch and .brd files hare are Eagle CAD schematic and PCB design files from SparkFun Electronics. 5 | A freeware version of Eagle can be found [here](http://www.cadsoftusa.com/download-eagle/freeware/). 6 | 7 | 8 | License 9 | --------- 10 | This product is open source! 11 | The hardware is released under [Creative Commons ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). 12 | 13 | Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. 14 | 15 | Distributed as-is; no warranty is given. 16 | 17 | - Your friends at SparkFun. -------------------------------------------------------------------------------- /hardware/SparkFun_HTU21D_Breakout.brd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | GND 127 | SCL 128 | SDA 129 | HTU21D 130 | 3.3V 131 | + 132 | - 133 | CL 134 | DA 135 | N. Seidle 136 | v12 137 | Humidity 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | >NAME 201 | >VALUE 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | >NAME 216 | >VALUE 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | >NAME 243 | >VALUE 244 | PASTE 245 | 246 | 247 | 248 | 249 | 250 | <h3>SparkFun Electronics' preferred foot prints</h3> 251 | In this library you'll find anything that moves- switches, relays, buttons, potentiometers. Also, anything that goes on a board but isn't electrical in nature- screws, standoffs, etc.<br><br> 252 | We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. 253 | <br><br> 254 | <b>Licensing:</b> CC v3.0 Share-Alike You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. 255 | 256 | 257 | <b>Stand Off</b><p> 258 | This is the mechanical footprint for a #4 phillips button head screw. Use the keepout ring to avoid running the screw head into surrounding components. SKU : PRT-00447 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | <h3>SparkFun Electronics' preferred foot prints</h3> 270 | In this library you'll find non-functional items- supply symbols, logos, notations, frame blocks, etc.<br><br> 271 | We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. 272 | <br><br> 273 | <b>Licensing:</b> CC v3.0 Share-Alike You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | Released under the Creative Commons Attribution Share-Alike 3.0 License 602 | http://creativecommons.org/licenses/by-sa/3.0 603 | Designed by: 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | <h3>SparkFun Electronics' preferred foot prints</h3> 646 | In this library you'll find sensors- accelerometers, gyros, compasses, magnetometers, light sensors, imagers, temp sensors, etc.<br><br> 647 | We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. 648 | <br><br> 649 | <b>Licensing:</b> CC v3.0 Share-Alike You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. 650 | 651 | 652 | <b>Description:</b> HTU21D is a very small, low cost, I2C digital humidity and temperature sensor. 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | >Name 692 | >Value 693 | 694 | 695 | 696 | 697 | <h3>SparkFun Electronics' preferred foot prints</h3> 698 | In this library you'll find connectors and sockets- basically anything that can be plugged into or onto.<br><br> 699 | We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. 700 | <br><br> 701 | <b>Licensing:</b> CC v3.0 Share-Alike You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | >NAME 735 | >VALUE 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | <b>EAGLE Design Rules</b> 754 | <p> 755 | The default Design Rules have been set to cover 756 | a wide range of applications. Your particular design 757 | may have different requirements, so please make the 758 | necessary adjustments and save your customized 759 | design rules under a new name. 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | -------------------------------------------------------------------------------- /hardware/SparkFun_HTU21D_Breakout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkfun/HTU21D_Breakout/3bc9c7be3cb5416a954aef5434316ab8740b9872/hardware/SparkFun_HTU21D_Breakout.pdf --------------------------------------------------------------------------------