Things used in this project

Hardware components:
Ardgen 101
Arduino 101 & Genuino 101
10167 01
DHT22 Temperature Sensor
09590 01
LED (generic)
11026 02
Jumper wires (generic)
08377 02 l
Resistor 330 ohm
1434509556 android phone color
Android device
12002 04
Breadboard (generic)
Adafruit industries ada62 image 75px
USB-A to B Cable
Mfr 25frf52 10k sml
Resistor 10k ohm
Software apps and online services:
Ide web
Arduino IDE
MIT App Inventor


Untitled sketch bb xh9hopiwcz


Arduino 101 code Arduino
My code
/*Made by Alexis Santiago Allende Last Update 17/03/17*/
#include <CurieBLE.h>
BLEPeripheral blePeripheral;//BLE Peripheral Device (Arduino Device)
BLEService demo111("19b10010-e8f2-537e-4f6c-d104768a1214"); // BLE demo111 Service

// BLE demo111 buttons Characteristic - custom 128-bit UUID, read and writable by central
BLEUnsignedCharCharacteristic buttons("19b10011-e8f2-537e-4f6c-d104768a1214", BLERead | BLEWrite);
// BLE sensor rate Characteristic"
BLEUnsignedIntCharacteristic sensors("19b10012-e8f2-537e-4f6c-d104768a1214", BLERead | BLENotify);
//DHT 22 library and things
#include "DHT.h"
#define DHTPIN 7
#define DHTTYPE DHT22

long previousMillis = 0;  // last time the sensor was checked, in ms
const int green = 13; // pin to use for the green light
const int red = 11;// pin to use for the red light
boolean a = LOW, b = LOW; //Control variables

void setup() {
  dht.begin();//sensor begin
  pinMode(green, OUTPUT);
  pinMode(red, OUTPUT);
  // set advertised local name and service UUID:
  // add service and characteristic:
  blePeripheral.addAttribute(buttons);// add the buttons characteristic
  blePeripheral.addAttribute(sensors); // add the sensor characteristic
  // set the initial value for the characeristic:
  // begin advertising BLE Light service:
  Serial.println("Demo111 service begin!");

void loop() {
  // listen for BLE peripherals to connect:
  BLECentral central = blePeripheral.central();
  digitalWrite(green, LOW);
  digitalWrite(red, LOW);
  // if a central is connected to peripheral:
  if (central) {
    Serial.print("Connected to central: ");
    // print the central's MAC address:

    // while the central is still connected to peripheral:
    while (central.connected()) {
      // if the remote device wrote to the characteristic,
      // use the value to control the leds:
      if (buttons.written()) {
        if (buttons.value() == '1' && a == LOW) { // 1 in ASCII

          digitalWrite(green, HIGH);         // will turn the LED on
          a = HIGH;
        } else if (buttons.value() == '1' && a == HIGH)  {  //when 1 was read again (second time)          

          digitalWrite(green, LOW);          // will turn the LED off
          a = LOW;

        if (buttons.value() == '2' && b == LOW) { // 2 in ASCII

          digitalWrite(red, HIGH);         // will turn the LED on
          b = HIGH;
        } else if (buttons.value() == '2' && b == HIGH)  { //when 2 was read again (second time)  

          digitalWrite(red, LOW);          // will turn the LED off
          b = LOW;

      long currentMillis = millis();
      // if 10s have passed, check the sensor:
      if (currentMillis - previousMillis >= 10000) {
        previousMillis = currentMillis;
    // when the central disconnects, print it out:
    Serial.print(F("Disconnected from central: "));
    digitalWrite(green, LOW);
    digitalWrite(red, LOW);


void updateSensor() {
  int temp=dht.readTemperature();//read temperature 
  sensors.setValue(temp);//send temperature value
  Serial.println(temp);//if you want check temperature i serial monitor
App Inventor Code, if you want try make, you can download
No preview (download only).


Soka cdsdtvc7fp
Alexis Santiago Allende

Im a person who since young feel a passion for electronics, I also like to cook pizza and travel. Now Im working on the internet of things



Love this project? Think it could be improved? Tell us what you think!

Give feedback


Similar projects you might like

Smart Garden
  • 1,013
  • 11

Smart Garden is plant environmental monitoring system.

Arduino Bike Blink Lights
  • 473
  • 8


Arduino nano bike bag signals, controlled by Wireless (RF) RC attached to front handle

Intel Curie TinyTILE Dress: Accelerometer + Optical Fibers
  • 331
  • 10

Full instructions

A dress using Intel Curie accelerometer on TinyTILE and its small form factor to control colors of the optical fibers with arm movements.

Control RGB LED by Dragging – Arduino 101 & App Inventor
  • 233
  • 4

Full instructions

This topic will teach you how to control a RGB LED on an Arduino 101 board with an Android device (MIT App Inventor).

WiDC: Wi-Fi-Controlled FPV Robot
  • 5,107
  • 32

Full instructions

What about using a Wi-Fi remote-controlled robot for exploring your surroundings, reaching inaccessible places, spying and take pictures?

Sienci Mill One - Simple and Affordable Desktop CNC
  • 7,739
  • 37

Full instructions

The Sienci Mill One is a powerful, open source desktop CNC machine to turn your digital 3D designs into real physical objects.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login