background image

/*************************************************************
***************** 
SHT15 Example 
Joel Bartlett @ SparkFun Electronics 
16 Sept 2015 
https://github.com/sparkfun/SparkFun_ISL29125_Breakout_Arduino
_Library 

This example shows how to get the temperature in F or C and hu
midity 
Developed/Tested with: 
SparkFun RedBoard  
Arduino IDE 1.6.5 

Connections: 
GND  

­

> A2 

Vcc  

­

> A3 

DATA 

­

> A4 

SCK  

­

> A5 

Requires: 
SHT1X Arduino Library 
https://github.com/sparkfun/SHT15_Breakout/ 

This code is beerware. 
Distributed as

­

is; no warranty is given.  

**************************************************************
****************/
#include <SHT1X.h>

//variables for storing values
float tempC = 0;
float tempF = 0;
float humidity = 0;

//Create an instance of the SHT1X sensor
SHT1x sht15(A4, A5);//Data, SCK

//delacre output pins for powering the sensor
int power = A3;
int gnd = A2;

void setup()

  Serial.begin(9600); // Open serial connection to report valu
es to host

pinMode(power, OUTPUT);
pinMode(gnd, OUTPUT);

digitalWrite(power, HIGH);
digitalWrite(gnd, LOW);


//

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

void loop()

readSensor();
printOut();
delay(1000);


//

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

void readSensor()

Page 6 of 7

Содержание SHT15

Страница 1: ...ated sensors for relative humidity temperature Digital 2 wire interface Not I C but similar Measurement range 0 100 RH Absolute RH accuracy 2 RH 10 90 RH Repeatability RH 0 1 RH Temp accuracy 0 3 C 25...

Страница 2: ...ns that need to be hooked up in order to start using this sensor in a project One for VCC one for GND and two data lines VCC 3 3V or 5V GND GND Data Any I O Pin SCK Any I O Pin You can connect this se...

Страница 3: ...SHT15 hooked up to any two pins at a given time The 2 wire protocol used for this sensor does not allow for multiple of the same sensor to be on the bus but it does allow multiple I C devices to shar...

Страница 4: ...SparkFun_ISL29125_Breakout_Ardu This example shows how to get the temperature in F or C and Developed Tested with SparkFun RedBoard Arduino IDE 1 6 5 Connections GND A2 Vcc A3 DATA A4 SCK A5 Requires...

Страница 5: ...s directly from the button below SHT15 ARDUINO LIBRARY Need help using the Library Manager or want to install the library the old fashioned way Visit our Arduino Library tutorial for more information...

Страница 6: ...com sparkfun SHT15_Breakout This code is beerware Distributed as is no warranty is given include SHT1X h variables for storing values float tempC 0 float tempF 0 float humidity 0 Create an instance o...

Страница 7: ...dea of how to add humidity and temperature sensing into your next project Need some inspiration Check out these other tutorials Make an automated terrarium that manages heat and humidity levels Build...

Отзывы: