Rabia Ali Sher
Published

Automation for Instagram with Arduino & ESP-01

This simple yet powerful setup allows you to automate physical actions based on your social media performance.

AdvancedProtip224
Automation for Instagram with Arduino & ESP-01

Things used in this project

Story

Read more

Schematics

Circuit diagram for an idea to connect Arduino, ESP-01 & Servo motor

Code

ESP-01 Code (to get data from Instagram and send to Arduino)

C/C++
#include <ESP8266WiFi.h>

const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

// Instagram data retrieval setup here...

void setup() {
  Serial.begin(9600);
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  
  Serial.println("Connected to WiFi.");
  
  // Add the follower count fetching logic here
}

void loop() {
  // Once the follower count is fetched, send it via serial to Arduino
  int followerCount = getFollowerCount(); // Replace with actual method
  Serial.println(followerCount);
  delay(60000);  // Check every minute
}

Arduino Code (to control the servo motor)

C/C++
#include <Servo.h>

Servo myservo;  
int followerCount;

void setup() {
  Serial.begin(9600);
  myservo.attach(9);  // Attach the servo to pin 9
}

void loop() {
  if (Serial.available() > 0) {
    followerCount = Serial.parseInt();
    Serial.println(followerCount);
    
    if (followerCount >= 1000) {  // Example threshold for action
      myservo.write(90);  // Move to 90 degrees
    } else {
      myservo.write(0);   // Move back to 0 degrees
    }
  }
}

Credits

Rabia Ali Sher
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.