Katie Kristoff
Published

Hackster Live April 2017 Workshop - Optional - Easy Add-on

Adapt your home automation project from our March 2017 workshop to be controlled through BLE using the Blynk app on your phone.

BeginnerFull instructions provided30 minutes1,637
Hackster Live April 2017 Workshop - Optional - Easy Add-on

Things used in this project

Hardware components

Arduino 101
Arduino 101
×1
Arduino UNO Click Shield
MikroE Arduino UNO Click Shield
Optional for Extension Project - See Hackster Live March 2017 Workshop Tutorial
×1
RELAY click
MikroE RELAY click
Optional for Extension Project - See Hackster Live March 2017 Workshop Tutorial
×1
LED (generic)
LED (generic)
×2
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×3
Resistor 330 ohm
Resistor 330 ohm
×2
USB-A to B Cable
USB-A to B Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Story

Read more

Schematics

Fritzing Schematic

Code

Arduino_101_BLE_Blynk.ino

Arduino
/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Sketch generator:           http://examples.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 *
 * This example shows how to use Arduino 101 CurieBLE
 * to connect your project to Blynk.
 *
 * Note: This requires CurieBLE library
 *   from http://librarymanager/all#CurieBLE
 *
 * NOTE: BLE support is in beta!
 *
 **************************************************************/

//#define BLYNK_USE_DIRECT_CONNECT

#define BLYNK_PRINT Serial

#include <BlynkSimpleCurieBLE.h>
#include <CurieBLE.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

BLEPeripheral  blePeripheral;

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

  blePeripheral.setLocalName("Blynk");
  blePeripheral.setDeviceName("Blynk");
  blePeripheral.setAppearance(384);

  Blynk.begin(blePeripheral, auth);

  blePeripheral.begin();

  Serial.println("Waiting for connections...");
}

void loop() {
  Blynk.run();
  blePeripheral.poll();
}

Credits

Katie Kristoff

Katie Kristoff

4 projects • 126 followers
Educator and enthusiastic crafter.

Comments