elciccio
Published © GPL3+

Smart Christmas tree

Have you ever dreamed to turn on or off your Christmas tree lights with just your voice? if the answer is "yes", just read this article.

IntermediateFull instructions provided622
Smart Christmas tree

Things used in this project

Hardware components

Relay (generic)
×1
ESP8266 ESP-01
Espressif ESP8266 ESP-01
with a working AT software
×1
Arduino UNO
Arduino UNO
×1
Breadboard power supply
×1
Light for christmas tree
It must be like the one in the link (USB)
×1
Jumper wires (generic)
Jumper wires (generic)
some wires
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
some wires
×1

Software apps and online services

Blynk
Blynk
Assistant SDK
Google Assistant SDK
Maker service
IFTTT Maker service
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
a simple screwdriver

Story

Read more

Schematics

Wiring diagram

Code

code

Arduino
#define BLYNK_PRINT Serial
#define EspSerial Serial1

#include <SoftwareSerial.h>
#include <SPI.h>
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// You should get Auth Token in the Blynk App.
char auth[] = "yourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourSSID";
char pass[] = "YourPassword";


SoftwareSerial EspSerial(2, 3); // RX, TX of ESP8266

String s;    //to store incoming text ingredient

BLYNK_WRITE(V0)     // it will run every time a string is sent by Blynk app
{
  s=param.asStr();
  Serial.print(s); //string sent by Blynk app will be printed on Serial Monitor
   if(s=="on")
  {
    digitalWrite(7, HIGH);       //Pin 7 has been set in setup()
  }
  else if(s=="off")
  {
    digitalWrite(7, LOW);
  }
  else{
    Serial.print("Say on or off");
  }
}
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(9600);
  pinMode(7, OUTPUT);       //Pin 7 is set to output
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);
 
  Blynk.begin(auth, wifi, ssid, pass);
}

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

Credits

elciccio

elciccio

0 projects • 2 followers

Comments

Add projectSign up / Login