Do you get nightmares of losing your YouTube Subscribers? If you do, you are not the only one. Luckily I have made this "YouTube Desktop Notifier" to keep me up-to-date with my channels Subscriber and View Counts. This very simple DIY project cost me around $10 and it now keeps me in track with my channel. Other than displaying the Subscriber and View count this device also "Beeps and Glows" when my channel gains a new subscriber.
Do you get nightmares of losing your YouTube subscribers?
If you do, you're not the only one. Luckily I made this YouTube desktop
notifier to keep me up to date with my channel's subscriber
and view counts. This very simple DIY project cost me around $10
and it now keeps me in track with my channel. Other than displaying the
subscriber and view count, this device also beeps and glows
when my channel gains a new subscriber. For this project we need a mixture of
both electronic components and woodworking tools.
The electronic components include a perfboard,
NodeMCU, 220V AC to 5V DC buck step-down module,
a buzzer shield or a buzzer and a 100 ohm resistor,
SPDT switch, 4 TM1637 4-bit digital 7-segment displays,
couple of colored LEDs and equal amount of 220 ohm resistors,
few connecting cables, a USB cable to upload the code
and general soldering equipments. For the woodworking bit we need
pallet wood, pencil, measuring tape, handsaw or a chop saw,
hammer, nails, sanding tool and personal protective equipment for wood cutting.
I'm making the enclosure out of pallet wood as I have a massive pile of pallets
left over from my other DIY woodworking projects. You can
also make the box out of a cardboard or a plastic container
and paint it to give it an awesome look. I'll start the discussion by explaining
the plan to you guys, then I'll explain how the wiring is done
by explaining the project's schematic. This project uses quite a fair bit of
Arduino libraries and the Google API key. In this section
I'll show you how to download and install the libraries and generate the
API key for your project. Then I'll show you how I made the wooden box
and just before explaining the code I'll show you how I assembled
all the electronic components. In this section I'll explain the main bits of
the code and then I'll show you a live demo of
my project. And at the end I'll conclude the tutorial by explaining few things
that I'm going to add in the next version of the project.
Alright, so let's get started. The plan is to make a 24 by 10 centimeter box to
hold the circuitry in it. When the device is powered on it will
first connect to the specified Wi-Fi network using the SSID and the password
pair provided in the code. Once a connection is made the code uses a
combination of the Google API key and your YouTube channel's ID to fetch
the data from the YouTube server. The device then displays the view and
the subscriber count using the seven segment display.
After displaying the information it waits for five minutes before fetching
the next set of information from the YouTube server.
A variable is used to store the current subscriber's count. If the subscriber
count is greater than the old count the buzzer goes on
and the blue and the white light flashes alternatively.
The wiring is very simple. We'll start by connecting the seven segment display to
the microcontroller. Each of these displays have four pins,
two for the power and one for clock and the other one for data.
Connect the data and the clock pins to NodeMCU as per the instructions provided
on screen. Then we'll connect all the VCC pins of
the display to the 3.3 volt pin of NodeMCU. Next connect the buzzer shield
or the buzzer with the 100 ohm resistor to D8 pin.
After that connect the blue and the white LED to D9 and D10 pin with a 220
ohm current limiting resistor respectively. Now go ahead and link up
all the ground pins to the ground pin of NodeMCU.
Once all the pins are connected connect the switch to the VIN of NodeMCU
and ground to ground of the step-down converter. Here is the list of libraries
that we need for this project. You can download them all from GitHub.
I have provided the links in the description below.
Once downloaded unzip and rename the libraries by removing any special
character and the master from their names. Place
the folder in your Arduino's libraries folder.
You may need to create the libraries folder if this is your very first
library. Restart the IDE so that it properly loads the keywords file,
examples and adds the library to the libraries menu.
Along with the libraries you also need few unique identifiers for this project.
The first one is the SSID and the password of your wireless network.
The second thing you need is your YouTube channel's unique channel ID.
To get that sign into your YouTube account. In the top right click on the
account icon and then click on settings. From the left-hand panel click on the
advanced settings option. The channel's user and channel IDs are
listed under the account information section.
And finally you just need to generate the Google API key for your channel.
To generate the key Google search using API keys or open the link provided in
the description below. Scroll down and click on the APIs and
services credentials. If this is the very first time you are
accessing this page then you will have to create a new project by clicking on
the create button. Accept the terms and give your project a
name and then hit the create button to create the project.
Once a project is created you just need to click on the create credentials
drop down and then select the API key from there.
System will take its time and generate the key. Once generated it will show you
the key in a pop-up dialog. Copy and save it in your email or
something. Now click on the library option from the left-hand panel.
Scroll down and enable YouTube data API version 3
and YouTube reporting API by clicking on them and then hitting the enable button.
Wait for around 5 to 10 minutes and then you should be able to use the API keys
in your project. Let's start our project by assembling
the wooden box. As discussed earlier I'm going to cut two 24 by 10 centimeter and
two 10 by 6 centimeter side panels and one 24 by 10 centimeter
back panel. After cutting all the wooden blocks I'm
going to join and sand them to give the box a nice and smooth look.
At the back of the unit I'm going to drill two holes.
One of them would be for the power cord and the other one for the on and off
switch. Once the box is ready I'm going to solder
all the electronic components and install them in the box.
I'll start by soldering the NodeMCU. Then I'll solder the 100 ohm resistor to
the D8 pin of NodeMCU. After that I'll solder the buzzer to a
perf board and will link it up to the NodeMCU.
Next I'm going to solder the switch and install it at the back of the box.
As per the schematic one pin of the switch will connect to the VIN of NodeMCU
and the other one to the positive terminal of the step down converter.
The negative end of the converter will connect to the ground pin of NodeMCU.
Now I'm going to solder seven segments as per the schematic.
Next I'm soldering the blue and the white LED to the D9 and D10 pin of
NodeMCU. So this is how my faceplate looks like.
Let me do a quick test before installing the faceplate.
Looks like everything is working the way they should. Okay so let me install the
faceplate and then I'll explain the code to you guys.
These are the list of libraries that we need for this project. Now if you are
using the same schematic as mine you don't have to modify anything in the
code other than these few lines. You just need
to add the SSID and password of your Wi-Fi network
and the Google API key and the channel's ID here.
Rest you can leave as is and load the code to your NodeMCU.
The API underscore MTBS is the mean time between the API request made by the
microprocessor. Then I'm initializing the displays by
setting the clock and the data pins. After that I'm setting up the buzzer and
the two LEDs. In the startup section I'm setting up the
LED pin modes and turning the blue LED on at the startup. Then I'm clearing all
the seven segment displays and displaying zero on display number one
and three. After that the device will connect to the Wi-Fi network using the
provided credentials. In the loop section when the value of
the counter exceeds the API underscore MTBS or in simple terms
when the time comes to make the next request to the YouTube server
a API call with the channel ID is made and the result is displayed on the
serial monitor and the seven segment displays. You need
to calculate the mod of the count received to display the last four digits
and then subtract the mod value from the original value to get the first four
digits. One thing I've noticed is that if the
mod let's say is 24 then the display will only display 24
and not 0024. So we'll have to add the missing zeros to the display.
This bit of the code is to add the missing zeros. And finally
this bit of the code is to turn on the buzzer and the LEDs
when the new subscriber count becomes greater than the old subscriber count.
Note pin D9 and D10 are the RX and TX pins of the NodeMCU.
So if you connect the LEDs to these pins you'll not be able to get anything on
the serial monitor. So during the testing process do not
connect anything to the D9 and D10 pins and comment the bit that sets the pin
modes of these pins. You can download the code from the link
provided in the description below. Alright so now the interesting bit. Let's
go ahead and test this device. I accidentally cooked one of the seven
segment displays while soldering it on board.
So my box has a hole in it. Anyways I'm not even close to 10k subscribers so
it's okay for now until I get one ship from China.
And that's it. Bingo. Few things that I'm going to include in my upcoming version
are saving the daily count to a web server's database,
saving monthly count to a web server's database, generate a web interface to
display the daily and monthly analytics using bar and line graph, adding NeoPixel
instead of the blinking LEDs. If you guys have any other suggestion
please let me know in the comments below. Alright so what are you waiting for?
Go ahead and hit the subscribe button and let my desktop notifier
buzz and glow. Thanks again for watching this video. I hope it helps you.
If you want to support me you can subscribe to my channel and watch my
other videos. Thanks. See you again in my next video.
Bye now.