Having a display in any electronics project makes it more interesting as you can visualize data with it. With that in mind I thought it’d be useful if I have a small display, connected to the Internet in my work space. The plan is simple to connect my ESP module to Internet to fetch the Real time and Instagram stats then display them on my OLED display. This IOT enabled project makes a great inclusion to your workbench if you are an avid Instagram user.
COMPONENTS REQUIRED:
OLED DISPLAY:
I wanted this project to be small and compact size so I have gone with this 0.96″ OLED display module. It has a resolution of 128×64 pixel. It uses I2C communication protocol, so less wiring mess. We just need 4 wires to control it two wire for the I2C bus(SDA & SCL) and VCC and GND to power it up. And can show all sorts of alpha-numerical and graphical data. Perfect for my application.
ESP8266 MODULE:
Now to connect to Internet and control the display I will be using popular ESP8266 microcontroller. It has WiFi built-in. So we can connect to the Internet easily.
BATTERY:
We will also need a Li-Ion battery if we want to make it portable. But it’s totally optional and you can ignore them and use a regular DC power supply adapter to power this project.
TEST SETUP FOR IOT DISPLAY:
For testing purpose we use ESP8266 based NodeMCU board. Hookup everything on a breadboard according to this diagram.
Some of the displays may have the GND and VCC power pins swapped around. Be sure to check your display and connect the pins accordingly.
- VCC – NodeMCU 3.3V
- GND – NodeMCU GND
- SCL – NodeMCU D1 / GPIO5
- SDA – NodeMCU D2 / GPIO4
INSTALLING LIBRARIES:
Many libraries are available to control these displays. I find the Adafruit library very easy to understand and use in projects. I am going to use the AdaFruit library in this tutorial. You’ll need to install “adafruit_GFX.h” library and “adafruit_SSD1306.h” library. To download and install the library to your Arduino IDE, go to “Library manager” in your IDE and search for “adafruit_SSD1306” and “adafruit_gfx”
Select the latest version and hit the Install button. Once installed you can use these libraries in your program. Alternatively you can download both of these libraries from Github ( SSD1306 and GFX ). If you are downloading libraries from Github, copy the Adafruit_SSD1306 master folder from the downloaded zipped file into the Arduino libraries folder. This folder is usually found at Documents > Arduino > libraries on Windows systems.
INSTAGRAM COUNT WITH DIGITAL DISPLAY:
I wanted to make a Digital clock that can also display my current Instagram followers count.We will use NTP Server to get the real time and Instastat Library by Brian Lough to get the Instagram Followers count. You can download this Instastat library from here. Install the above downloaded library to the Arduino libraries folder.
CODE:
Now its time to upload the code for this project in your NodeMCU project. You can download this code from my GitHub page.
You will need to modify three things in the code.
- Your WiFi username in the line 36
- Your WiFi password in the line 37
- Instagram Username goes to the line 27
Upload the above code to your NodeMCU after making the corresponding changes. Now you should see that the current time and Follower count are showing on the display.
PCB DESIGN:
I have designed a PCB for this project to hook up the display in a single board to make it compact. You can download the Gerber files for this PCB design below. I have used ESP12F for this project and SMD components to reduce space. I solder everything on the PCB and connect a small battery as well.
Hope this Project guide was useful to you. If you have any queries do leave them in the comment box below also do not forget to share your feedback about this project. This project design and code was built by our team member Sayantan Pal.
please help me!!!!!
/Users/semyvolosalexandr/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /private/var/folders/kp/1smlv6k57v7bbxcn_9ssbdvh0000gn/T/arduino-sketch-9A1A16BEFD0C307E3A33A1567C7D33E4/sketch/Real_Time_IG_Stat.ino.cpp.o: in function `setup’:
/Users/semyvolosalexandr/Documents/Arduino/IOT-Display-master/Real_Time_IG_Stat/Real_Time_IG_Stat.ino:67: undefined reference to `_ZN14InstagramStats12getUserStatsE6String’
/Users/semyvolosalexandr/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /private/var/folders/kp/1smlv6k57v7bbxcn_9ssbdvh0000gn/T/arduino-sketch-9A1A16BEFD0C307E3A33A1567C7D33E4/sketch/Real_Time_IG_Stat.ino.cpp.o: in function `_ZN7BearSSL19WiFiClientSecureCtx11setInsecureEv’:
/Users/semyvolosalexandr/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h:69: undefined reference to `_ZN14InstagramStats12getUserStatsE6String’
/Users/semyvolosalexandr/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /private/var/folders/kp/1smlv6k57v7bbxcn_9ssbdvh0000gn/T/arduino-sketch-9A1A16BEFD0C307E3A33A1567C7D33E4/sketch/Real_Time_IG_Stat.ino.cpp.o: in function `loop’:
/Users/semyvolosalexandr/Documents/Arduino/IOT-Display-master/Real_Time_IG_Stat/Real_Time_IG_Stat.ino:128: undefined reference to `_ZN14InstagramStatsC1ER6Client’
/Users/semyvolosalexandr/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /private/var/folders/kp/1smlv6k57v7bbxcn_9ssbdvh0000gn/T/arduino-sketch-9A1A16BEFD0C307E3A33A1567C7D33E4/sketch/Real_Time_IG_Stat.ino.cpp.o: in function `_GLOBAL__sub_I_client’:
/Users/semyvolosalexandr/Documents/Arduino/IOT-Display-master/Real_Time_IG_Stat/Real_Time_IG_Stat.ino:165: undefined reference to `_ZN14InstagramStatsC1ER6Client’
collect2: error: ld returned 1 exit status
Несколько библиотек найдено для “Adafruit_SSD1306.h”
Используется: /Users/semyvolosalexandr/Documents/Arduino/libraries/Adafruit_SSD1306
Не используется: /Users/semyvolosalexandr/Documents/Arduino/libraries/Adafruit_SSD1306_Wemos_Mini_OLED
Не используется: /Users/semyvolosalexandr/Documents/Arduino/libraries/Adafruit_SSD1306_Wemos_OLED
Несколько библиотек найдено для “Wire.h”
Используется: /Users/semyvolosalexandr/Documents/Arduino/libraries/Wire
Не используется: /Users/semyvolosalexandr/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/Wire
exit status 1
Compilation error: exit status 1
Hi Frank,
When compiling your code, the following error message appears.
TimeLib.h: No such file or directory
Best regards
hi! amazing project which i have just made one myself and was working great but about 8 hours later the counter just say 0 even after i re upload the code.. do you know why?
thanks
ben
Hi Ben,
This code is built based on Instastat library by Brian Lough unfortunately it has stopped working. Perhaps Instagram changed the way it handles these request. We believe they are working to fix this will let you know once any solution is being announced.