Things used in this project

Hardware components:
Watch%20single
O Watch Sensor Kit
×1
Software apps and online services:
Ide web
Arduino IDE

Code

Humidity Sensor Demo for O Watch Sensor KitArduino
/*
 * This is a demo of the SI7021 Humidity Sensor
 * This demo is made for the O Watch kit - http://theowatch.com
 * 
 * This demo is based on the SI7021 library example
 * and uses by Marcus Sorensen <marcus@electron14.com>
 * https://github.com/mlsorensen/SI7021/blob/master/SI7021.h
 * licensed under the GNU GPL v2
 * 
 */

#include <TinyScreen.h>
#include <SI7021.h> //include the sensor library

SI7021 sensor; //declare the sensor
TinyScreen display = TinyScreen(TinyScreenPlus);

void setup(void) {
  Wire.begin();
  sensor.begin();
  display.begin();
  display.setFlip(1);
  display.on();
  display.setFont(liberationSans_10ptFontInfo);
}

void loop() 
{
  //get the temperature using the library function 
  //temperature is an integer in hundredths
  int tempHundredths = sensor.getCelsiusHundredths();
  float temperature = tempHundredths / 100.0;

  //get humidity from the libdary function
  // humidity is an integer representing percent
  int humidityvalue = sensor.getHumidityPercent();

  display.setCursor(5,5);
  display.print("Sensor Demo");
    
  //print humidity valye
  display.setCursor(5,25);
  display.print("Humidity: ");
  display.print(humidityvalue);
  display.print("%  ");
  
  //print temperature value
  display.setCursor(5,40);
  display.print("Temp: ");
  display.print((temperature*9/5+32-13)); //printing value converted to Fahrenheit
  display.print(" F  ");
  delay(2000);
}

Credits

Owatchlogofebsmall
O Watch
9 projects • 13 followers
Make your own smartwatch. Learn 3D design and Arduino coding.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog