Things used in this project

Hardware components:
Solar Yard Lamp
×1
PVC Pipe 2ft x 1.25 in
×2
Ardgen 101
Arduino 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

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

Web and Design Generalist

Contact
B3dd7ff2c1f1ddaee2c0d2a5a0bb12f6
Justin Lassen

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

Similar projects you might like

LED Roulette Game
Easy
  • 111
  • 5

Full instructions

A fun pocket-sized travel game for any age. Try your luck and make the light stop on the green LED.

Using 9 Axes Motion Shield with Arduino
Easy
  • 78
  • 4

Protip

The Arduino 9 Axes Motion Shield allows your Arduino to measure movement: orientation, acceleration and magnetic field.

Guess the Number With Arduino KeyPad
Easy
  • 126
  • 3

Full instructions

A simple and funnies project with an Arduino UNO and the famous keypad shield. Arduino selects a random number, you guess the number.

Potentiometer with RGB LED
Easy
  • 56
  • 2

This uses potentiometers to control a RGB LED.

Know the Temp of Your Home From Anywhere with Arduino Cloud!
Easy
  • 2,169
  • 11

Full instructions

Ever wanted to know the temperature of your home from somewhere? Here's an easy way to do it with Arduino Cloud and the Yun Shield!

Bluetooth Control Multitap
Easy
  • 159
  • 2

This is a multi-tap that can be linked to a smartphone and Bluetooth to control the supply of electricity to a smartphone

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog