Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Ethan SKhane cline
Published

TEAM 41 IOT ESD Temp & humi

Temp & humidity Sensor designed to monitor ESD controlled rooms.

IntermediateFull instructions provided34
TEAM 41 IOT ESD Temp & humi

Things used in this project

Hardware components

Photon 2
Particle Photon 2
×1
Adafruit FeatherWing OLED
×1
Adafruit STEMMA QT / Qwiic JST SH 4-Pin Cable
×1
Adafruit Sensirion SHT40 Temperature & Humidity Sensor
×1
Adafruit Lithium Ion Polymer Battery Ideal For Feathers - 3.7V 400mAh
×1
Adafruit FeatherWing Doubler - Prototyping Add-on For All Feather Boards
×1

Software apps and online services

ThingSpeak API
ThingSpeak API

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

Case for IOT Project

2 parts of the IOT project case

Schematics

Circuit Schematics

Code

Code for Photon 2

C/C++
This the code I used for my photon 2
void setup() {
  Particle.variable("temp", tempC);
  Particle.variable("humi", humi);
  Particle.variable("batt", battV);
  pinMode(S5, INPUT_PULLUP);
  pinMode(D7, OUTPUT);
  Serial.begin(115200);
  initSHT40();
  display.begin(0x3C, true);
  display.clearDisplay();
  display.display();
  display.setRotation(1);
  display.setTextSize(1);
  display.setTextColor(SH110X_WHITE, SH110X_BLACK);
  display.setCursor(0, 0);
  Particle.subscribe("hook-response/TEMP & HUMI", myHandler, MY_DEVICES);
}

void myHandler(const char *event, const char *data) {}

void loop() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
    updateConsole();
  }
  String data = String(humi);
  Particle.publish("TEMP & HUMI", data, PRIVATE);
  delay(10000);
}

void drawConsole() {
  display.drawLine(42, 0, 42, 44, SH110X_WHITE);
  display.drawLine(84, 0, 84, 44, SH110X_WHITE);
  display.drawLine(0, 14, 128, 14, SH110X_WHITE);
  display.drawLine(0, 44, 128, 44, SH110X_WHITE);
  display.setCursor(10, 4);
  display.print("Temp");
  display.setCursor(54, 4);
  display.print("Humi");
  display.setCursor(96, 4);
  display.print("Batt");
  display.display();
}

void updateConsole() {
  sensors_event_t humidity, temp;
  sht4.getEvent(&humidity, &temp);
  tempC = temp.temperature;
  humi = humidity.relative_humidity;
  battV = (analogRead(A6) * 5.0) / 4095;
  display.setCursor(0, 50);
  display.print("  Ethan & Khane 3171");
  display.setCursor(6, 20);
  display.print(tempC * (1.8) + 32);
  display.setCursor(20, 32);
  display.print("F");
  display.setCursor(50, 20);
  display.print(humi);
  display.setCursor(56, 32);
  display.print("%rH");
  display.setCursor(92, 20);
  display.print(battV / 3.7 * 100);
  display.setCursor(102, 32);
  display.print("%");
  display.display();
}

Credits

Ethan S
1 project • 0 followers
Contact
Khane cline
0 projects • 0 followers
Contact
Thanks to Mohit Bhoite.

Comments

Please log in or sign up to comment.