Stephen Simon
Published © GPL3+

Arduino Uno + Electrical Device (Bulb) + Android Phone

Connecting an electrical bulb with Arduino Uno and accessing it from Android Phone.

BeginnerFull instructions provided1 hour16,588
Arduino Uno + Electrical Device (Bulb) + Android Phone

Things used in this project

Story

Read more

Code

Code

Arduino
/*
*
 * 1. Optional, but recommended.
 *    Connect additional USB-serial adapter to see the prints.
 *
 * 2. Edit auth token and upload this sketch.
 *
 * 3. Run the script (script located in "scripts" folder of library root,
 *    e.g. 'blynk-library/scripts') for redirecting traffic to server:
 *
 *      for Windows:
 *                     1. Open cmd.exe
 *                     2. Write (put your path to the blynk-ser.bat folder):
 *                          cd C:\blynk-library\scripts
 *                     3. Write (COM4 is port with your Arduino):
 *                          blynk-ser.bat -c COM4
 *                     4. And press "Enter", press "Enter" and press "Enter"
 *
 *
 * 4. Start blynking! :)
 *
 **************************************************************/

#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX

#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>

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

void setup()
{
  // Debug console
  DebugSerial.begin(9600);

  // Blynk will work through Serial
  Serial.begin(9600);
  Blynk.begin(auth, Serial);
}

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

Credits

Stephen Simon

Stephen Simon

3 projects • 46 followers
Stephen is a Technical Evangelist & Microsoft Innovative Educator who often travels to deliver session & talk about trending technologies.

Comments