Things used in this project

Hardware components:
Adafruit NeoPixel Jewel - 7 x 5050 RGB LED with Integrated Drivers
×1
SainSmart MQ135 Sensor Air Quality Sensor Hazardous Gas Detection
×1
13676 01
SparkFun Atmospheric Sensor Breakout - BME280
×1
10167 01
DHT22 Temperature Sensor
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
12002 04
Breadboard (generic)
×1
826 04
Male/Female Jumper Wires
×20
Software apps and online services:
particle build
Fritzing
Hand tools and fabrication machines:
Lasercutter
Laser cutter (generic)

Custom parts and enclosures

Enclosure
It is a clear acrylic box with the dimensions 7"x 4" x 3". We used it to hold the node inside so it didn't get damaged inside of the aquaponics lab. We left holes on the top and sides so the air could come through for the temperature, humidity, and co2. The clear acrylic let the light come through the box. Sketched on the front side is our group number, 707, and there is nothing on the box so we can adhesive it to a surface. Finally, on the top there is a little box opening so we can insert a power chord to the node.
Img 1486 28h8qmrh80
Enclosure Illustrator File
707_-_loft_jMAuoAAEXE.ai
Enclosure File image
Screen shot 2017 04 24 at 1 59 47 pm fmrwuiphw1

Schematics

Fritzing Diagram
This is our fritzing diagram. We use this to push out the data from each different sensor.
loft_axTrGkSlY1.fzz
Fritzing
Screen shot 2017 04 24 at 1 59 12 pm 62qvkqensj

Code

Group 707JavaScript
This is our code that was used to determine the Temperature, Humidity, CO2, and amount of light in the room, along with some bits of code to flash the NeoPixel if the Humidity in the room is idle/safe to be in.
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_TSL2561_U.h>

// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h> //jewel sensor
#include <neopixel.h>
#define PIXEL_PIN D4        //location
#define PIXEL_COUNT 7       //Amount of leds
#define PIXEL_TYPE WS2812B  //Type of LED
#include <Wire.h>

Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIXEL_PIN, PIXEL_TYPE);

//Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
void rainbow(uint8_t wait);
uint32_t Wheel(byte WheelPos);
SYSTEM_MODE(AUTOMATIC);


// This #include statement was automatically added by the Particle IDE.
#include <MQ135.h> //CO2 Sensor

// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT.h> //Temp+Hum Sensor
#include "application.h"

#define DHTPIN 3  //Using #define to open communication with that pin
// If connecting the Temp+Hum sensor, make sure to include it's model number " DHT 22 (AM2302) " So the arduino knows what it is dealing with.
#define DHTTYPE DHT22 // DHT22 is the model of the Temp+Hum sensor

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561_U.h>

/* This driver uses the Adafruit unified sensor library (Adafruit_Sensor),
   which provides a common 'type' for sensor data and some helper functions.
   
   To use this driver you will also need to download the Adafruit_Sensor
   library and include it in your libraries folder.

   You should also assign a unique ID to this sensor for use with
   the Adafruit Sensor API so that you can identify this particular
   sensor in any data logs, etc.  To assign a unique ID, simply
   provide an appropriate value in the constructor below (12345
   is used by default in this example).
   
   Connections
   ===========
   Connect SCL to analog 5
   Connect SDA to analog 4
   Connect VDD to 3.3V DC
   Connect GROUND to common ground

   I2C Address
   ===========
   The address will be different depending on whether you leave
   the ADDR pin floating (addr 0x39), or tie it to ground or vcc. 
   The default addess is 0x39, which assumes the ADDR pin is floating
   (not connected to anything).  If you set the ADDR pin high
   or low, use TSL2561_ADDR_HIGH (0x49) or TSL2561_ADDR_LOW
   (0x29) respectively.
    
   History
   =======
   2013/JAN/31  - First version (KTOWN)
*/
   
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);

/**************************************************************************/
/*
    Displays some basic information on this sensor from the unified
    sensor API sensor_t type (see Adafruit_Sensor for more information)
*/
/**************************************************************************/
void displaySensorDetails(void)
{
  sensor_t sensor;
  tsl.getSensor(&sensor);
  Serial.println("------------------------------------");
  Serial.print  ("Sensor:       "); Serial.println(sensor.name);
  Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
  Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
  Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println(" lux");
  Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println(" lux");
  Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println(" lux");  
  Serial.println("------------------------------------");
  Serial.println("");
  delay(500);
}

/**************************************************************************/
/*
    Configures the gain and integration time for the TSL2561
*/
/**************************************************************************/
void configureSensor(void)
{
  /* You can also manually set the gain or enable auto-gain support */
  //tsl.setGain(TSL2561_GAIN_1X);      /* No gain ... use in bright light to avoid sensor saturation */
   tsl.setGain(TSL2561_GAIN_16X);     /* 16x gain ... use in low light to boost sensitivity */
  //tsl.enableAutoRange(true);            /* Auto-gain ... switches automatically between 1x and 16x */
  
  /* Changing the integration time gives you better sensor resolution (402ms = 16-bit data) */
  tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS);      /* fast but low resolution */
  // tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS);  /* medium resolution and speed   */
  // tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS);  /* 16-bit data but slowest conversions */

  /* Update these values depending on what you've set above! */  
  Serial.println("------------------------------------");
  Serial.print  ("Gain:         "); Serial.println("Auto");
  Serial.print  ("Timing:       "); Serial.println("13 ms");
  Serial.println("------------------------------------");
}

DHT dht(DHTPIN, DHTTYPE);

double hum;         //Hum levels
double temp;        //Temp levels
double light;       //Light (Lumilosity) Amount of light coming in in number

//CO2 Stuff
int number = 0;
int state = 0;
MQ135 gasSensor = MQ135(0);
int led = D7;
float rzero = gasSensor.getRZero();
int ppm = gasSensor.getPPM();         //Amount of CO2 levels coming in


void setup() 
{
    Serial.begin(9600);
    pinMode(DHTPIN, INPUT);
    strip.begin();          //Initialize pixels to be in ready mode
    strip.show(); // Initialize all pixels to 'off'
    Particle.variable("hum", hum);
    Particle.variable("temp", temp);
    Particle.variable("light", light);
    Particle.variable("CO2", ppm);
     Serial.println("Light Sensor Test"); Serial.println("");
  
  /* Initialise the sensor */
     if(!tsl.begin())
     {
      /* There was a problem detecting the TSL2561 ... check your connections */
      Serial.print("Ooops, no TSL2561 detected ... Check your wiring or I2C ADDR!");
      while(1);
     }
  
     /* Display some basic information on this sensor */
      displaySensorDetails();
     
     /* Setup the sensor gain and integration time */
     configureSensor();
  
      /* We're ready to go! */
    Serial.println("");
    
}

void loop() {
    
    //rainbow(30);
    //CO2 Sensor
    ppm = analogRead(0);       // read analog input pin 0
    Serial.println(ppm, DEC);  // prints the value read
    
    //More CO2 Stuff
    float rzero = gasSensor.getRZero();
    digitalWrite(led,HIGH);             // turn the ledPin on
    //delay(100);                         // stop the program for some time
    //digitalWrite(led, LOW);             // turn the ledPin off
    //delay(100);                         // stop the program for some time

    int co2_ppm = gasSensor.getPPM();
    int ppm = co2_ppm / 4;
    Spark.variable("ppm", & ppm, INT);                    

    //delay(10000);                       //No Delay Remove later, here for now
    
    //Temp+Hum Sensor
    double checkHum = dht.getHumidity();                //Seperate from light and CO2 inputs
    double checkTemp = dht.getTempFarenheit();
    
    if (checkHum > 0 && checkHum < 100)
        hum = checkHum;
        
    if (checkTemp > 32 && checkTemp < 100)
        temp = checkTemp;
    
    Serial.println("Temp: " + String(checkTemp));
    Serial.println("Hum: " + String(checkHum));
    
     /* Get a new sensor event */ 
      sensors_event_t event;
      tsl.getEvent(&event);
          
     //   Particle.variable("light", light);
 
      /* Display the results (light is measured in lux) */
      if (event.light)
      {
        Serial.print(event.light); 
        Serial.println(" lux");
        light = (event.light);
      }
      else
      {
        /* If event.light = 0 lux the sensor is probably saturated
           and no reliable data could be generated! */
        Serial.println("Sensor overload");
      }
      //delay(250);
      
      if(checkHum <= 50)
        {
            strip.setBrightness(10);
            strip.setPixelColor(0,0,255,0);
            strip.setPixelColor(1,0,255,0);
            strip.setPixelColor(2,0,255,0);
            strip.setPixelColor(3,255,0,0);
            strip.setPixelColor(4,0,255,0);
            strip.setPixelColor(5,0,255,0);
            strip.setPixelColor(6,0,255,0);
            strip.show();
            //delay(250);
        }
        else
        {
            strip.setBrightness(100);
            strip.setPixelColor(0,255,0,0);
            strip.setPixelColor(1,255,0,0);
            strip.setPixelColor(2,255,0,0);
            strip.setPixelColor(3,255,0,0);
            strip.setPixelColor(4,255,0,0);
            strip.setPixelColor(5,255,0,0);
            strip.setPixelColor(6,255,0,0);
            strip.show();
            //delay(250);
        }
}

Credits

104d355ea6d1274c066da2e4d49e6457
Jacob Berry

I am a male teenager. I am using this for my innovation and creation class at the moment.

Contact
Bad006ad7550dc20ceb13029891241a1
Andy Medina

I like guitar. I wear glasses and enjoy long walks on the beach.

Contact
9f714b3b03e22814f8d5a8e8e2600e5a
Daniel Alvarez

Group 707

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

Similar projects you might like

Lightweight Sliding Door Automator
Intermediate
  • 1,535
  • 7

Work in progress

Automate the opening and closing of a lightweight sliding door (e.g. a screen door), including remote controls on your phone.

Christmas Gift Box
Intermediate
  • 3,633
  • 595

Full instructions

Christmas Gift Box plays music and sends an email when it is opened.

Carbon Fiber Vacuum Chamber
Intermediate
  • 2,905
  • 94

Full instructions

Our project is a carbon fiber vacuum chamber that is monitored by multiple particle photons and various sensors.

ConnectTheDots with Particle Azure IoT Hub Integration
Intermediate
  • 841
  • 8

Protip

This project will allow you to connect your Particle device into an Azure IoT Hub for viewing data in real-time through an ASP.NET web app!

What should I wear outside?
Intermediate
  • 5,044
  • 67

Full instructions

A whimsical weather clock powered by Particle and forecast.io

Garage Door Opener with Blynk
Intermediate
  • 367
  • 2

Open, close and monitor a garage door opener with a smart phone using a Particle Photon and the Blynk application.

Add projectSign up / Login