Sunday, July 26, 2020

Flex Sensor And Accelerometer-based Gesture Controlled Robot With Robot...

This Robot Requires Two Sensors To Control The Steering And Arm Movements.

1. Flex Sensor Controls The Robot Arm Movements.
2. Accelerometer Sensor Controls The Speed, Steering Of The Robot.

I Have Used Bluetooth  Module To Transmit And Recieve The Data. The Robotic Arm Capable To Hold Upto 4KG Load.




Servo motor controlling using NodeMCU and Blynk App

Servo motor controlling using IoT.

Servo motor rotating angle can be controlled using NodeMCU And android app(Blynk).

Required components

  1. NodeMCU.
  2. Servo motor.
  3. power supply(you can use USB cable).

Schematic 


Result video


Code

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>
Servo myservo;  // create servo object to control a servo

char auth[] = "YOUR Blynk AUTH CODE";
char ssid[] = "YOUR WIFI NAME";
char pass[] = "YOUR WIFI PASSWORD";
BlynkTimer timer;

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  myservo.attach(D2);//Servo motor connecting pin,You can change pin but be sure about PWM availabilty on that pin.
}

void loop()
{
  Blynk.run();
  timer.run();
}

BLYNK_WRITE(V1)
{
  int x = param[0].asInt();
  int y = param[1].asInt();
  Serial.print("X = ");
  Serial.print(x);
  Serial.print("; Y = ");
  Serial.println(y);

  if (x <= 0 && y < 600)
{
    myservo.write(180);//left
  }

  else if (x == 1023 && y > 400) //right
  {
    myservo.write(0);
  }

  else if (x == 512 && y == 512) //stop
  {
    myservo.write(90);
  }

  else

  {

myservo.write(90);

  }
}

CIRCUITS WITH PROJECTS SOURCE CODES

Flex Sensor And Accelerometer-based Gesture Controlled Robot With Robot...