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:
- 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’:
- 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
- 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
- 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.