Richie Van KurenFabio Arauz
Published

Workspace Environment Device

This a device that will monitor the ambient sound and temperature of a workspace environment.

BeginnerFull instructions provided166
Workspace Environment Device

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Argon
Particle Argon
×1
Jumper wires (generic)
Jumper wires (generic)
×7
Elegoo big sound sensor
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Maker service
IFTTT Maker service

Story

Read more

Schematics

Schematic Drawing

Flowchart

Code

Big Sound Sensor Code

C/C++
int sensorPin = A0; 
int sensorValue = 0; 

void setup() 
{
    Serial.begin(9600);
    
    // Subscribing to integration response event
    Particle.subscribe("hook-response/SOUND", myHandler, MY_DEVICES);
}

void myHandler(const char *event, const char *data) {
  // Handling integration response
}

void loop()
{
    sensorValue = analogRead(sensorPin);
    Serial.println(String(sensorValue) );//print analog value onto serial monitor
    delay(250);
    
    // Recieve Data
    String data = String(sensorValue);
    // Trigger integration
    Particle.publish("SOUND", data, PRIVATE);
    // Wait 5 seconds
    delay(5000);
}
WiFiSignal sig = WiFi.RSSI();
float quality = sig.getQualityValue();

Temperature Sensor Code

C/C++
// This #include statement was automatically added by the Particle IDE.

#include <Adafruit_DHT.h>

#define DHTPIN 7

#define DHTTYPE DHT11   // DHT 11

DHT dht1(DHTPIN,DHTTYPE);

int check = 0;
int cycle = 600000;
int temperature = 0;
int store = 0;


void setup()
{
  Serial.begin(9600);
  Particle.variable("TEMPERATURE1",store);
}

void loop()
{
    int temperature = int(dht1.getTempFarenheit());
    
    if (temperature < 100 && temperature > 20)
    {
        store = temperature;
    }
    
    //int temperature = int(dht1.getTempCelcius());
    
    //if (temperature < 38 && temperature > -7)
    //{
    //    store = temperature;
    //}
       
    if (millis() - check > cycle)
    {
        Particle.publish("TEMPERATURE1",String(store));
        check = millis();
    }
    
    Serial.println(store);
    delay(100);
}

Credits

Richie Van Kuren

Richie Van Kuren

1 project • 1 follower
MEGR-3171, UNCC
Fabio Arauz

Fabio Arauz

1 project • 1 follower

Comments