Stephen Simon
Published © GPL3+

Arduino Uno + Electrical Device (Bulb) + Android Phone

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

EasyFull instructions provided1 hour8,396
Arduino Uno + Electrical Device (Bulb) + Android Phone

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Relay Module
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Android device
Android device
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

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 • 31 followers
Stephen is a Technical Evangelist & Microsoft Innovative Educator who often travels to deliver session & talk about trending technologies.

Comments

Add projectSign up / Login