Things used in this project

Hardware components:
Solar Yard Lamp
×1
PVC Pipe 2ft x 1.25 in
×2
Ardgen 101
Arduino 101 & Genuino 101
×1
Grove 20starter 20kit 20plus 20  20intel c2 ae 20iot2 01
SeeedStudio Grove starter kit plus for Intel Edison
×1
Metal Round Box for Wiring
×1
PVC Couple with Thread
×1
Threaded bolt for PVC coupler
×1
Friction Tape
×1
Adafruit industries ada80 image 75px
9V to Barrel Jack Connector
×1

Custom parts and enclosures

Sensor Carriage
Brackets

Code

sensorReadArduino
#include <CurieBLE.h>

BLEPeripheral blePeripheral;
BLEService customService("19B10000-E8F2-537E-4F6C-D104768A1216");

BLEUnsignedCharCharacteristic tempCharacteristic("5667f3b1-d6a2-4fb2-a917-4bee580a9c84", BLERead | BLENotify);
BLEUnsignedCharCharacteristic dustCharacteristic("5667f3b1-d6a2-4fb2-a917-4bee580a9c85", BLERead | BLENotify);
BLEUnsignedCharCharacteristic humidityCharacteristic("5667f3b1-d6a2-4fb2-a917-4bee580a9c86", BLERead | BLENotify);
BLEUnsignedCharCharacteristic carbonCharacteristic("5667f3b1-d6a2-4fb2-a917-4bee580a9c87", BLERead | BLENotify);

const int B = 4275;               // B value of the thermistor
const int R0 = 100000;            // R0 = 100k

void setup() {
  Serial.begin(9600);

  blePeripheral.setLocalName("Curie");
  blePeripheral.setAdvertisedServiceUuid(customService.uuid());

  blePeripheral.addAttribute(customService);
  blePeripheral.addAttribute(tempCharacteristic);
  blePeripheral.addAttribute(dustCharacteristic);
  blePeripheral.addAttribute(humidityCharacteristic);
  blePeripheral.addAttribute(carbonCharacteristic);

  tempCharacteristic.setValue(0);
  dustCharacteristic.setValue(0);
  humidityCharacteristic.setValue(0);
  carbonCharacteristic.setValue(0);

  blePeripheral.begin();
}

void loop() {
  BLECentral central = blePeripheral.central();

  if (central) {
    Serial.print("Connected to central: ");
    Serial.println(central.address());

    while (central.connected()) {
      int dust = analogRead(1);
      int humidity = analogRead(2);
      int carbon = analogRead(3);
      int a = analogRead(0);

      float R = 1023.0/a-1.0;
      R = R0*R;
  
      float temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15;
      tempCharacteristic.setValue(temperature);
      dustCharacteristic.setValue(dust);
      humidityCharacteristic.setValue(humidity);
      carbonCharacteristic.setValue(carbon);
    }
  }
}

Credits

11538128 10206900764620063 8671970473197845068 o
Moheeb Zara
20 projects • 79 followers
Community Manager at Octoblu. Board Member - HeatSync Labs. Co-founder - South West Maker Festival. Hardware hacker, artist, maker, robotics mentor, stage hand
Contact
18595588 10155303320488064 3313200314230886550 o zic5luliet
Prentice Bjerkeseth
0 projects • 2 followers
Web and Design Generalist
Contact
B3dd7ff2c1f1ddaee2c0d2a5a0bb12f6
Justin Lassen
0 projects • 0 followers
Award winning VR developer, Intel Innovator
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