Introduction: Instagram Likes Speedometer by Arduino & ESP8266
It would fun to see how your Instagram posts perform in action! We are going to build a gauge that shows your Likes per minute speed. In this article, you will learn how to get data from web pages by ESP8266 and send them to Arduino to analyze and run other actuators. At the end of this article, you can :
- Connect the ESP8266 to the internet and get data from web pages.
- Use Arduino to read ESP8266 data and analyze them.
- Get data from social media such as Instagram.
- Make a gadget that can show you the speed of Instagram’s likes.
Step 1: An Introduction to ESP8266
Wireless interfacing, connecting to the web and remote controlling are features that can be very helpful in many projects. ESP-8266 is a low-cost microchip with full TCP/IP (Transmission Control Protocol and Internet Protocol), 32-bit MCU, 10-bit ADC and different interfaces like PWM, HSPI, and I2C that enables microcontrollers to connect to the Wi-Fi networks. It is one of the best solutions for adding wifi to projects and (but not the only one.)
This microchip comes with different types of the module like ESP-01, ESP-12 or other development boards and breakouts like NodeMCU devkit, Wemos, and Adafruit Huzzah. The difference is their pins, components needed for easier usage and also price. The microchip has 32 pins that 16 pins of it are GPIO; depending on the model, the number of GPIOs provided is different. For ESP-01 it is just two pins but other models like breakouts have all of them. When using ESP-8266, you will need a serial interface to communicate and program. Simple modules usually don’t have a serial converter (FTDI is usually suggested but other converters can be used, too) and it should be provided separately. Regulators, built-in LEDs, and pull-up or down resistors are other features that some models may have; the lowest cost between all of these modules is for ESP-01 and it’s our choice now.
ESP-01 is the first module that comes for esp-8266 and it has just two GPIO pin and needs 3.3V for power. It doesn’t have a regulator, so make sure to have a reliable power supply. It doesn’t have a converter, therefore you need USB to TTL converter. Converter for this module (and also other models of ESP) should be in 3.3V mode. The reason for this is the converter will make 0 and 1 via pulses, and voltage of these pulses should be recognizable for ESP, so check this before buying. Because of the limited quantity GPIO pins and also their low current (12mA per each one), we may need more pins or more current; so we can easily use Arduino with a module to access its IO pins (another way to access more GPIO pins is wiring out a very thin wire on the chip to the pin headers you need, but its not a good and safe solution). If you don’t want to use another board, you can design or use a circuit to increase current.
In this project, We want to connect ESP-01 to the Internet and get some data from Instagram pages. Then we send the data to Arduino and after processing it, Arduino changes the location of Servo pointer according to data. Let’s do it.
Step 2: Required Materials
Step 3: Circuit
Step 4: Code
First, we write a code for ESP-01 to get data from Instagram pages and send them to Arduino by the Serial port. Then we write another code for Arduino to get data from ESP-01 and control the servo motor. You can use Arduino IDE to compile both codes and Upload them to boards.
You must add the library and then upload the code. If it is the first time you run an Arduino board, don’t worry. Just follow these steps:
- Go to www.arduino.cc/en/Main/Software and download the software of your OS. Install the IDE software as instructed.
- Run the Arduino IDE and clear the text editor and copy the following code in the text editor.
- Choose the board in tools and boards, select your Arduino Board.
- Connect the Arduino to your PC and set the COM port in tools and port.
- Press the Upload (Arrow sign) button.
- You are all set!
Now its time to upload the ESP-01 code. We want to use Arduino IDE to upload the sketch to ESP. Before uploading the code, you should select ESP board for IDE.
Go to File>Preferences and put http://arduino.esp8266.com/stable/package_esp8266... in the additional boards. Then download and install it. Now you can see the ESP boards in Tools> Board. Select “Generic ESP8266 Module” and copy the code in a new sketch. Download the “InstagramStats” library and add it to IDE. Note that we have modified the library, So you should download it here. Then you should set USB to TTL Converter as Uploader hardware. Just plug the converter in and set the right port in Tools>Port. It’s ready to Upload.
Step 5: Assembling
Upload the code and wire up the circuit according to the picture. Now it’s time to make a frame for this circuit. we used a laser cutting machine to make a frame with plexiglass and designed a gauge sketch to stick on it. We have also made a pointer for the gauge with paper.
After assembling, just plug in the power supply and see the speed of likes.
Step 6: What’s Next?
You can improve this project as you wish. Here are a few suggestions:
- Change the InstagramStats library to receive other data such as the number of followers and so on.
- Change the speed of getting data to decrease your internet utilization.
- Try to get the data from videos posts on Instagram.
You can also read this project on ElectroPeak's official website: