|
|
Wemos D1 mini ESP8266 |
x 1 | |
|
|
8 Digit 7segment MAX7219 module |
x 1 | |
|
|
LED 3mm white diffused |
x 3 | |
|
|
R 100 ohm 1/4w |
x 1 | |
|
|
Active Buzzer 5V |
x 1 | |
|
|
Slide Switch SPDT SS-12D00G3 |
x 1 | |
|
|
Battery Holder AA |
x 1 |
YouTube Subscriber Counter ESP8266 Wemos
#include <YoutubeApi.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <ArduinoJson.h>
//Outputs
#define MAX7219_Data_IN D7 //D4 of WeMos
#define MAX7219_Chip_Select D6 //D3 of WeMos
#define MAX7219_Clock D5 //D2 of WeMos
int buzzer = D8; //D8 of WeMos
//Variabels
byte adr = 0x08;
byte num = 0x00;
int i = 0;
long subs = 0;
String thisString_prev;
//////////////////////////////////////////////////////////////////////////////////
//------- Replace the following! ------
char ssid[] = ""; // your network SSID (name)
char password[] = ""; // your network key
#define API_KEY ""
#define CHANNEL_ID "" // makes up the url of channel
WiFiClientSecure client;
YoutubeApi api(API_KEY, client);
unsigned long api_mtbs = 10000; //mean time between api requests
unsigned long api_lasttime; //last time api request has been done
void shift(byte send_to_address, byte send_this_data)
{
digitalWrite(MAX7219_Chip_Select, LOW);
shiftOut(MAX7219_Data_IN, MAX7219_Clock, MSBFIRST, send_to_address);
shiftOut(MAX7219_Data_IN, MAX7219_Clock, MSBFIRST, send_this_data);
digitalWrite(MAX7219_Chip_Select, HIGH);
}
void setup() {
Serial.begin(115200);
delay(100);
pinMode(buzzer, OUTPUT);
digitalWrite(buzzer, LOW);
delay(100);
//Define the pins as outputs and disable CS
pinMode(MAX7219_Data_IN, OUTPUT);
pinMode(MAX7219_Chip_Select, OUTPUT);
pinMode(MAX7219_Clock, OUTPUT);
digitalWrite(MAX7219_Chip_Select, HIGH);
delay(200);
//Setup of the 7seg module
shift(0x0f, 0x00); //display test register - test mode off
shift(0x0c, 0x01); //shutdown register - normal operation
shift(0x0b, 0x07); //scan limit register - display digits 0 - 7
shift(0x0a, 0x0f); //intensity register - max brightness
shift(0x09, 0xff); //decode mode register - CodeB decode all digits
// Set WiFi to station mode and disconnect from an AP if it was Previously
// connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
// Attempt to connect to Wifi network:
Serial.print("Connecting Wifi: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
IPAddress ip = WiFi.localIP();
Serial.println(ip);
client.setInsecure();
}
void loop() {
if (millis() - api_lasttime > api_mtbs) {
if(api.getChannelStatistics(CHANNEL_ID))
{
unsigned long Count = api.channelStats.subscriberCount;
Serial.println(Count);
String thisString = String(Count, DEC);
if(thisString != thisString_prev)
{
digitalWrite(buzzer,200);
delay(1000);
digitalWrite(buzzer,LOW);
}
thisString_prev = thisString;
i = thisString.length();//This variable will go character by cahracter and send the value to the 7 segment display
if(i==8)
{
shift(0x0b, 0x07); //scan limit register - display digits 0 thru 7
adr=0x01;
}
if(i==7)
{
shift(0x0b, 0x06); //scan limit register - display digits 0 thru 7
adr=0x01;
}
if(i==6)
{
shift(0x0b, 0x05); //scan limit register - display digits 0 thru 7
adr=0x01;
}
if(i==5)
{
shift(0x0b, 0x04); //scan limit register - display digits 0 thru 7
adr=0x01;
}
if(i==4)
{
shift(0x0b, 0x03); //scan limit register - display digits 0 thru 7
adr=0x01;
}
if(i==3)
{
shift(0x0b, 0x02); //scan limit register - display digits 0 thru 7
adr=0x01;
}
if(i==2)
{
shift(0x0b, 0x01); //scan limit register - display digits 0 thru 7
adr=0x01;
}
if(i==1)
{
shift(0x0b, 0x00); //scan limit register - display digits 0 thru 7
adr=0x01;
}
i=i-1;
while (i >= 0)
{
if(thisString[i] == '0')
{
num = 0x00;
}
if(thisString[i] == '1')
{
num = 0x01;
}
if(thisString[i] == '2')
{
num = 0x02;
}
if(thisString[i] == '3')
{
num = 0x03;
}
if(thisString[i] == '4')
{
num = 0x04;
}
if(thisString[i] == '5')
{
num = 0x05;
}
if(thisString[i] == '6')
{
num = 0x06;
}
if(thisString[i] == '7')
{
num = 0x07;
}
if(thisString[i] == '8')
{
num = 0x08;
}
if(thisString[i] == '9')
{
num = 0x09;
}
shift(adr, num);
adr=adr+0x01;
i=i-1;
}
}
api_lasttime = millis();
}
}
YouTube Subscriber Counter ESP8266 Wemos
Project images are for reference only. Actual production is based on the manufacturing files on the project page.
Please review the designer's notes (e.g., PCB thickness) and select the appropriate options.
PCBWay is not responsible
for issues caused by unsuitable parameter selections.
For more important ordering information, please refer to
Read More
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(7)
-
Engineer
Apr 30,2025
-
Engineer
Sep 10,2021
-
Brian Taudahl Boergesen
Dec 07,2020
-
Engineer
Sep 02,2020
-
(DIY) C64iSTANBUL
Aug 10,2020
-
Guang Ning
Aug 10,2020
-
Ahmed Elsmahy
Jul 28,2020
- 2 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
10usability
-
10creativity
-
10content
-
10design
-
10usability
-
10creativity
-
10content
More by Bluino Bluino
-
ESP32 IoT Starter Shield Version 3
Learn Basic IoT use ESP32 boards is very easy with ESP32 IoT Starter Kit board and following the 110...
-
ESP32-Cam Motor Driver Shield L293D
Android App: ESP32 Camera Wifi Robot CarTutorial Assembly:https://www.instructables.com/DIY-ESP32-Ca...
-
LED Blinking Robot Badge - Soldering Kit
This article is proudly sponsored by PCBWAY.PCBWAY make high quality prototyping PCBs for people all...
-
3 Panel LED Dot Matrix MAX7219 for Common Anode Dot Matrix
Part List per Panel:1 x PCB LED Dot Matrix MAX7219 (PCBWay)1 x Led Dot Matrix 8x8 Common Anode1 x IC...
-
2 Panel LED Dot Matrix MAX7219 for Common Anode Dot Matrix
Part List per Panel:1 x PCB LED Dot Matrix MAX7219 (PCBWay)1 x Led Dot Matrix 8x8 Common Anode1 x IC...
-
IoT Basic Kit ESP8266 Wemos D1 Mini
Part List:1 x PCB IoT Basic Kit (PCBWay)1 x ESP8266 Wemos D1 Mini board1 x OLED I2C 128x641 x Humidi...
-
ESP32 IoT Basic Shield
Part List:1 x PCB ESP32 Basic Shield (PCBWay)1 x ESP32 DEV KIT V1 board1 x LED 5mm1 x LED 3mm1 x Act...
-
Nodemcu Amica ESP8266 IoT Starter Shield
Learn Basic IoT use ESP8266 boards is very easy with Nodemcu IoT Starter Shield board and following ...
-
ESP32 Motor Shield 2WD
Control Robot Car 4WD Mecanum Wheel use app Android, install app here:https://play.google.com/store/...
-
ESP32 Motor Shield 4WD Mecanum Wheel
Control Robot Car 4WD Mecanum Wheel use app Android, install app here:https://play.google.com/store/...
-
ESP32 IoT Starter Shield Ver 2.0
The difference from the previous version is that there is an additional slot for the HCSR04 ultrason...
-
nanBluino - DIY Arduino Nano USB Type-C
Overview"Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use h...
-
Drawbot Wifi ESP32 GRBL - Drawing Robot Plotter Pen
OverviewThe Drawbot is a drawing art robot that can draw. You will needs two stepper motors, a micro...
-
Topeduino - DIY Arduino Uno USB Type-C use Solder Paste Stencil
Overview"Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use h...
-
Eggbot Wifi ESP32 - Drawing Robot Plotter Pen
OverviewThe Eggbot is a drawing art robot that can draw on spherical or egg-shaped objects. You coul...
-
ESP32 Balancing Robot Shield
Part list:1 x PCB ESP32 Balancing Robot Shield (PCBWay)1 x ESP32 DEVKIT V1 board2 x Stepper Motor Dr...
-
Pi Pico Starter Shield
Easy Way to Started learn Raspberry Pi Pico, based on official tutorial download Get Started Pi Pico...
-
ESP32 IoT Starter Kit
Learn Basic IoT use ESP32 boards is very easy with ESP32 IoT Starter Kit board and following the 110...
-
Programmable Mist Maker - XIAO / QT PY Extension
1074 2 1 -
RadioHAT - Raspberry Pi radio development platform
891 0 2 -
QWIIC-VL53L4CD Time-of-Flight Distance Sensor Module
1098 0 1 -
-
-
-
ARPS-2 – Arduino-Compatible Robot Project Shield for Arduino UNO
3334 0 6 -
-
A Compact Charging Breakout Board For Waveshare ESP32-C3
3945 3 8 -
AI-driven LoRa & LLM-enabled Kiosk & Food Delivery System
4335 2 2







