Control LED Strip Using ESP32 and Blynk App

Let's add beautiful colour in your life!

INTRODUCTION

Do you know that you can control the colour of your LED strip using a mobile phone? With a simple hardware connection, you can now light up the LED strips to the colour that you like. Watch this video to know how to control the LED strip using ESP32 and Blynk app.

HARDWARE PREPARATION

This tutorial use :

Software Preparation.

  1. Open the Arduino IDE. Please make sure that your Arduino IDE is version 1.6.9 and above.
  2. Then, click at the on Sketch – Include Library – Manage Libraries… Search for “blynk” and install the latest version of Blynk.
  3. Next, we need to install ESP32 development board.
  4. Insert this link into the Arduino preference “https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json”.
  5. Go to Tools>Boards>Board Manager and install the ESP32 board.

Sample Code

This is the sample code used for this tutorial. Try it!

#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Adafruit_NeoPixel.h>
#include <SPI.h>
#define PIN 27
#define NUMPIXELS 30
#define BLYNK_PRINT Serial
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
BLYNK_WRITE(V2)
{
int R = param[0].asInt();
int G = param[1].asInt();
int B = param[2].asInt();
Serial.println(R);
Serial.println(G);
Serial.println(B);
for (int i = 0; i < NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(R, G, B));
pixels.show();
}
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pixels.begin();
}
void loop()
{
Blynk.run();
}
view raw stripESP32.ino hosted with ❤ by GitHub

Thank you

Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiries, please post at Cytron Technical Forum.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Send Data to Firebase Using Arduino Uno WiFi Rev2
Simple Alarm System Using Maker Nano
Program Cucumber ESP32-S2 Using CircuitPython
Face Recognition Using OpenCV on Raspberry Pi 400
Turned Your Tablet as a Display for the Raspberry Pi 400
Scroll to Top