YouTube Subscriber Counter

3,585

44

7

Introduction: YouTube Subscriber Counter

About: I'm a computer enthusiastic who likes to share my knowledge and work to the world, and help in whatever I can to make the internet a better place. I mostly build electric-working engine models, and things wit…

I always wanted a YouTube Subscriber Counter that look good and clean. With the availability of e-paper displays for hobbyists like us, this idea became a reality and I've seen many people doing it, but I want to take my own approach and make the process as easy as possible for anyone that wants to build their own.

PCB sponsored by PCBWay - Full feature custom PCB prototype service: https://www.pcbway.com/

It runs on AA x4 batteries and thanks to the high efficiency of the components used, it can run for many months and even years without having to replace the batteries.

I include the sketch (code) file, the links to buy the parts, the STL files for 3D printing and I even include the gerber files so you can order the custom PCB to facilitate soldering the components.

Code Features:

  • It shows the amount of subscribers and views of your YouTube channel.
  • You can select to show the complete numbers or an abbreviation (1,234 → 1.23K). On 2019 YouTube started to abbreviate the subscriber count so even if you select to see the full amount, it's going to show a bunch of zeros to the right depending on the value (1,234,567 → 1,230,000).
  • It shows the date and time from the last update, using NTP servers.
  • Optimized to use as little power as possible, in case you use batteries. This includes turning OFF Wi-Fi when not in use, reducing CPU speed and going to deep sleep mode when waiting for the next refresh. Also, we can control the power of the display with a NPN transistor to be able to turn ON the display only when updating.
  • You can set to wake up and refresh the data every X amount of seconds or set the time of day (example: 3AM) where you want to update the screen. It uses the data taken from the time server to calculate for how long to stay sleep, depending on the set interval.
  • Warning Indicator - Connection:
    • No Wi-Fi: The icon is 4 bars with an X over it.
    • No Internet: The icon is a globe with an X over it.
  • Warning Indicator - Battery (optional):
    • Low Battery: The icon is a battery with a small line, as almost empty.
    • Battery Empty: The icon is a battery with nothing inside and an X over it.
  • The ESP32 will permanently sleep if the battery voltage is too low. This is to prevent draining the battery beyond the safe limit, and to avoid having an unstable situation where the ESP32 would crash for lack of power.
  • It tries multiple times to connect with the time server and YouTube API if necessary and it adds timeouts to make sure it doesn't wait forever.
  • You can select the date format as "MM/DD" or "DD/MM".
  • Screensaver: To prevent screen burn-in (ghosting) we can set to clear the screen multiple times before printing the stats screen.
  • It automatically adjusts the spacing and position of the values and icons on the display depending on the value of the view count.
  • Optionally show a grid to use as a guide to center the components.
  • Print to the serial monitor detailed data about what's doing.

Physical Features:

  • Compact design.
  • It can be hang in a wall or stand in a flat surface using the retractable leg.
  • Since we use a e-paper display, it doesn't produce light so it's not intrusive in the room is at.
  • Power consumption:
    • Average current when updating: 45mA
    • Current when deep sleep: 0.014mA
  • By my calculations and tests, it should run for over 2 years on alkaline AA batteries (x4).

Limitations:

  • Maximum amount of subscribers and views allowed is 999,999,999,999,999.
  • The wake up time can be off by several minutes or even hours.
  • The time shown when it refreshes after a long deep sleep can be off by several minutes. I'm not sure why this happens and I could not find a solution, but it shouldn't matter that much if you choose to wake up every day. When resets, we get an accurate time, but when it wakes up after deep sleep, the longer it stays sleep, the larger the time shown is off.
  • All the warning indicators can refresh only when we do a complete refresh cycle so don't expect them to update in real time.

Supplies

Parts:

Recommended tools for this project:

Note: As an Amazon Associate I earn from qualifying purchases.

Files:

Step 1: Test the Display

If you have an ESP32 Development Board (I recommend you do), or an arduino uno/nano, test the display with an example code or maybe the main sketch of this project.

Here's a video tutorial to help you with this:

Connection from the E-Paper Display to the ESP32:

  • BUSY = 4
  • RST = 16
  • DC = 17
  • CS = SS (5)
  • CLK = SCK (18)
  • DIN = MOSI (23)
  • GND = GND
  • 3.3V = 3.3V

If you never used an ESP32 on your Arduino IDE, you need to install the board going to "File > Preferences" and add this link in "Additional Boards Manager URLs": https://dl.espressif.com/dl/package_esp32_index.json

Then go to "Tools > Board > Boards Manager...", search for "ESP32" and install it.

Remember that you also need to install a few libraries:

Step 2: Get YouTube API Key and Channel ID

In the sketch you need to add, beside the network name and network password, the YouTube Channel ID and YouTube API Key for your channel.

To get your YouTube Channel API Key, go to the Google API webpage: https://console.developers.google.com and make sure you are logged in to your gmail account.

In the "Dashboard", click "Create Project". Choose a name for the project and click "Create".

You should see "Enable APIS and Services". Click that and then write in the search box for "YouTube Data API v3". Enable it and "Create Credentials". In the page to create credentials you'll see in small letters the link to create a "API key". Then click "API restrictions" and select "YouTube Data API v3". Click create and then you'll see your key, which you need to add on the sketch.

You also need your Channel ID. You can find it in your advanced account settings. In the top right, click your profile picture and then Settings. From the left Menu, select Advanced settings. You'll see your Channel ID.

Test the API is working by going to this address in your browser: https://www.googleapis.com/youtube/v3/channels?part=statistics&id=PutYourYoutubeID&key=PutYourYoutubeAPIKey

Replace "PutYourYoutubeID" with your YouTube ID and "PutYourYoutubeAPIKey" with your API key.

Step 3: Solder Components to the PCB

You could use an ESP32 development board, but they consume too much power when they are in deep sleep mode, and since I wanted to use batteries, I decided to use a bare ESP32 module and solder the minimum components to it. Sounds annoying, but it's not as complicated as you might think. I even solder everything with a traditional soldering iron, instead of a heat gun. To make it easier, I designed a PCB especially for this project, and you can order it from PCBWay (sponsor) using my gerber files.

It cost just $5 USD for 10 PCBs and the process is very simple.

I listed all the components that goes on the PCB, but there's one that requires some testing before soldering. I choose this voltage regulator (HT7333-A) because is very efficient consuming very little power while not having a load, but I discovered that not all units have the same performance. I bought a bunch of them and I measured the current without a load to see which one is the best to use in my PCB. This is because I want the batteries to last a long time and it's critical to get very low power consumption when the ESP32 is in deep sleep mode. So you should test them without a load and choose the one with least power consumption.

Step 4: Assembly - Display Frame

Remove the protective film from the display and attach the display to the [Display Frame] 3D printed part. I like to keep everything in a way that allows taking everything apart, just in case, so I recommend using something like masking/painter's tape to attach the E-Paper Display to the [Display Frame].

Step 5: Assembly - Display Ribbon Flex Cable Adapter

Screw the small Ribbon Flex Cable Adapter to the [Display Board Support] 3D printed part using the M3x4mm HEX screws. It should go directly into the plastic so there's no need for nuts.

Step 6: Assembly - Display Board Support

Glue (I recommend Loctite Super Glue) the [Display Board Support] to the [Display Frame] in a way that the Ribbon Flex Cable, when connected to the display, has a natural curvature and aligned correctly. This cable is usually not perfectly centered in the display so that's why we need to glue this part accordingly to each display.

Step 7: Assembly - Spacers

Glue one [Spacer] on each corner of the [Display Frame]. Make sure they don't come out from the frame because then it would not let the frame fit the Shadow Box.

Step 8: Assembly - Battery Holder

Place the Battery Holder on the [Back Cover] and apply glue around the sides. The Battery Holder should fit flat and level in the inside edges of the [Back Cover].

Step 9: Assembly - Modify the UART Module

Prepare the UART Module for installation. First, drill 2mm holes where the screws go, since the holes that come by the factory are too small to be useful. The second thing to modify is to reinforce the USB connector, adding more solder on the pads on each side of the USB connector.

Step 10: Assembly - UART Module

Screw the UART Module to the [Back Cover]. Use M2x6mm HEX screws for that. It should go directly to the plastic so there's no need for nuts.

Step 11: Assembly - Buttons

Glue the [Buttons] to the [Back Cover].

Step 12: Assembly - Wall Mount Cover

Glue the [Wall Mount Cover] to the [Back Cover].

Step 13: Assembly - Modify the Display SPI Module

The E-Paper Display should come with a module that adapts the Ribbon Flex Cable to the SPI protocol. This module is a bit too thick so we need to modify it by removing the Raspberry Pi connector. It's surprisingly easy to remove. Just use pliers and pull it off. Remove also the little pieces of metal from the connector that might remain in the module.

Step 14: Assembly - Display SPI Module

Install the Display SPI Module to the [Back Cover] using 4 M3x12mm HEX screws and 4 M3 nuts. The nuts should go in the inside part of the [Back Cover], leaving the screw heads on the outside.

Step 15: Assembly - Main PCB

Screw the main PCB with all the electronic components to the [Back Cover] using 4 M3x12mm HEX screws and 4 M3 nuts. The nuts should go in the inside part of the [Back Cover], leaving the screw heads on the outside.

Step 16: Assembly - Cables

Place all the cables and secure them with zip ties. It's also a good idea to label the connectors, if you choose to use connectors. Make sure to test everything again.

Step 17: Assembly - Leg

Join the [Leg] and [Leg Support] and put them on the [Back Cover] with 4 M3x8mm HEX screws and 4 M3 nuts. The nuts should go in the inside part of the [Back Cover], leaving the screw heads on the outside.

Step 18: Assembly - Lock Clips

To install each [Lock Clip] on the [Back Cover], make sure to place the hardware in the right position. First you put a 3x7mm washer in a M3x12mm HEX screw, then insert on a [Lock Clip], after that it goes another washer. Place it on one of the corresponding holes of the [Back Cover] and put 2 M3 nuts on the other side. We use two nuts to lock them to each other and prevent them from unscrewing them-selves accidentally.

Step 19: Assembly - Hole on Shadow Box for Lock Clips

My shadow box came with some flaps that I removed because they brake too easily after bending them a few times. Now we are ready to put the display assembly and the back cover assembly into the Shadow Box. Remember to place the Frame Mat too. All this will allow us to mark where the holes should be made for the locking clips to extend and support the back cover assembly against the Shadow Box.

Step 20: Final Assembly and Stickers

Connect everything and put everything on the Shadow Box in the following order:

  1. Transparent Front Cover (make sure to remove the protective film on each side)
  2. Frame Mat
  3. Display Assembly
  4. Connect the Ribbon Flex Cable for the display
  5. Turn the Battery Holder (switch) ON and put the [Back Cover] on the Shadow Box

The last touch is adding some stickers in the [Back Cover] to indicate the buttons and the USB connector.

1 Person Made This Project!

Recommendations

  • Metal Contest

    Metal Contest
  • Maps Challenge

    Maps Challenge
  • Fruit and Veggies Speed Challenge

    Fruit and Veggies Speed Challenge

7 Comments

0
adrian-smith31
adrian-smith31

4 months ago on Step 20

Thanks for sharing this. One of the best instructables I've seen; I might make this when my channel grows to a decent number of subscribers.

0
aguyngueran
aguyngueran

Question 5 months ago

Could you please provide pick and place file (centroid file) for the project?

Besides that, the project seems to be great, thanks for sharing.

0
InterlinkKnight
InterlinkKnight

Answer 5 months ago

I have no idea what file are you talking about. I provided all the files I have

0
KushagraK7
KushagraK7

1 year ago

Cool project! The e-paper display is a good power-saving addition that is easy on the eyes too.

0
Rocky2222
Rocky2222

1 year ago

Thanks to sharing such information..

0
sabarithedon
sabarithedon

1 year ago

This looks cool....gonna try it