Home > Projects > Motor Projects > YouTube Subscriber Counter Bubble Machine

YouTube Subscriber Counter Bubble Machine

Summary of YouTube Subscriber Counter Bubble Machine


This project is an interactive YouTube Subscriber Counter Bubble Machine designed to celebrate new subscriptions by blowing bubbles. Built around an ESP8266 microcontroller, it connects to Wi-Fi to fetch real-time subscriber data via the YouTube API and displays the count on an LED matrix. When a new subscriber is detected, the system triggers a motor-driven bubble machine for five seconds. The device features a custom wooden casing housing the electronics, a fan, and a rotating disk dipped in soapy water to generate bubbles, creating an engaging experience for Maker Faire visitors.

Parts used in the YouTube Subscriber Counter Bubble Machine:

  • ESP8266 ESP-12 module
  • ESP-12E Motor Shield
  • 5V DC motor (At least 5000 RPM)
  • 5V DC gear-motor (about 100 RPM)
  • Led Matrix 8x8 (between 3 to 8 units)
  • USB Cable with power supply (At least 1A)
  • Jumper wire
  • CD-ROM or DVD disc
  • Soldering machine
  • Plastic cap
  • Fan
  • Old wood wine box
  • Dish soap
  • Water

The idea was born after being selected to expose at Maker Faire Lille, a giant event around Science, inventions and the Do-It-Yourself mindset.

I wanted to build something that makes visitors want to subscribe to my YouTube channel YouLab.
I quickly though about a real time YouTube counter. However, it was lacking of interactivity with visitors.
That’s why, I’ve decided to make an action after each subscription : Making bubbles.

The two following instructables have inspired me in the realization of the YouTube Subscriber Counter Bubble Machine.
YouTube Counter :https://www.instructables.com/id/YouTube-Subscribe…
Bubble Machine : https://www.instructables.com/id/Bubble-Machine/

Let’s discover how I made this interactive counter.

Step 1: Electronic Material

To make this project, you will need the following electronic material.

  • ESP8266 ESP-12 module
  • ESP-12E Motor Shield
  • 5V DC motor (At least 5000 RPM)
  • 5V DC gear-motor (about 100 RPM)
  • Led Matrix 8×8 (between 3 to 8 units for a 3 to 8 digits counter)
  • USB Cable with power supply (At least 1A)

It can be purchase online for a very cheap price.

The ESP8266 is the brain of the circuit. This programmable board can connect to WIFI to get YouTube statistics, send commands to drive motors and pilot Led Matrix display.
As this module have limited current on output, a motor shield board must be added to drive motors.

Step 2: Electronic Circuit

First of all, plug the ESP8266 module on the motor shield board.

To power these boards you can either use a separate power supply for motors and EPS8266 alimentation either use the same power supply.

In order to simplify the circuit I have chosen a unique power supply. To do so, you just have to had a jumper between VIN and VM on the motor shield board.

Then connect the Led Matrix to the shield Board using the following table

Shield – Led Matrix
VIN – VCC
G – GND
7 – DIN
8 – CS
5 – CLK

Finally connect motors to A+/A- B+/B- and USB cable to VIN/GND

Step 3: Sketch Configuration : Librairies and Board

The ESP8266 module runs Arduino. Some librairies and board configuration are required to run this project :

  • Add following URL in Preferences > Additional Boards Manager URLs:
    http://arduino.esp8266.com/stable/package_esp8266com_index.json
  • Install ESP8266 v2.4.2 in Tools > Boards Manager
  • Select NodeMCU 1.0 (ESP-12E Module) in Tools > Boards
  • Install ArduinoJson 5.13.5 in Library Manager
  • Install YoutubeAPI 1.1.0 in Library Manager

Download the code attached to this step and open the file Youtube_counter_bubble_machine.ino

You will find three information to be customized in the code in the section ‘Custom configuration to be replaced’:

  1. Customize WIFI
    It correspond to the WIFI network that will be used by the ESP8266.
    Update WIFI SSID and Password fields with your network informations
  2. Customize Channel ID
    This field correspond to the YouTube channel that will be used to get subscribers statistics.
    Your Channel ID can be found in the URL of your web browser when you are on the main page of your YouTube channel.
    For example the URL of YouLab Youtube page is :https://www.youtube.com/channel/UCQVsjlyPMlN4tZ7cGd5NnnA
    YouLab Channel ID is UCQVsjlyPMlN4tZ7cGd5NnnA
  3. Customize Google API_Key
    Some Youtube API are used to get subscriber count of a channel. An API_Key is required to use Youtube APIs.
    With a logged in google acount go tohttps://console.developers.google.comIn Dashboard select create project and in credentials select create credentials – API Key.In Library select YouTube Data API v3 and enable.
    Copy the API Key in the Youtube counter code.

Step 5: Transfer Firmware and Test Boards

Let’s try the firmware on the hardware.

First connect the ESP8266 to your computer by USB and select the upload button. The firmware will be sent to your board.
When finished, your Led Matrix should display INIT.

After 3 to 5 seconds the Led Matrix should display the number of subscribers of your YouTube channel.
Try to subscribe an check that the display is updated and motors start to run for 5 seconds.

If you face some troubles, open the serial monitor that will provide useful logs and help you debug your hardware or software.

Step 6: The Code

The code is divided in two parts, the setup phase and the loop phase.

The setup consist in initializing the Matrix Led, the WIFI and the two motors.

The loop phase repeat every two seconds :

  • Call YouTube API
  • Update Led Matrix
  • If new subscriber gain Power motors for 5 seconds

Step 7: Bubble Machine

The bubble machine part is quit simple.

A disk full of holes will dive into a dish soap liquid then rotate in front of a fan. It will create a lot of bubbles.

The disk is a CD-ROM or a DVD.
Make some holes in it with a soldering machine.
Then plug the disk on the gear-motor using a plastic cap to make the interface.

Step 8: Casing

The casing is based on an old wood wine box that originally contained 3 bottles.

Make a rectangle hole for the led matrix, a circular hole for the fan and a small hole for the gear motor axis.
Attach a container on the bottom front of the wood box. It will contain the soap liquid.
Plug the disk on the gear motor from the front of the wood box.
Finally fill the container with some dish soap mixed to water.

Your YouTube counter Bubble Machine is ready.

Source: YouTube Subscriber Counter Bubble Machine

Quick Solutions to Questions related to YouTube Subscriber Counter Bubble Machine:

  • What inspired the creation of this project?
    The idea was born after being selected to expose at Maker Faire Lille, aiming to make visitors want to subscribe to the YouLab YouTube channel.
  • How does the device interact with visitors when they subscribe?
    It makes bubbles by powering motors for 5 seconds after each subscription is detected.
  • Which libraries are required to run the code?
    You must install ArduinoJson 5.13.5 and YoutubeAPI 1.1.0 in addition to the ESP8266 board package.
  • Where can I find my YouTube Channel ID?
    Your Channel ID is found in the URL of your web browser when you are on the main page of your YouTube channel.
  • How do I obtain the Google API Key needed for the code?
    Create a project in the Google Developers Console, select credentials to create an API Key, and enable the YouTube Data API v3.
  • What happens if the firmware upload fails?
    You should open the serial monitor which will provide useful logs to help debug hardware or software issues.
  • How is the bubble generation mechanism constructed?
    A disk full of holes made from a CD-ROM or DVD dives into dish soap liquid and rotates in front of a fan.
  • What material is used for the casing of the machine?
    The casing is based on an old wood wine box that originally contained 3 bottles.
  • How often does the loop phase update the subscriber count?
    The loop phase repeats every two seconds to call the YouTube API and update the display.
  • What components drive the bubble disk rotation?
    The disk is plugged onto a 5V DC gear-motor using a plastic cap to make the interface.

About The Author

Scroll to Top