mathparrachorenanbreis
Published © GPL3+

Bluethooth Mechanical Arm Made with Ice Cream Sticks

A simple yet interesting way to understand Bluetooth communication and apply it in Servos

IntermediateShowcase (no instructions)154
Bluethooth Mechanical Arm Made with Ice Cream Sticks

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×4
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1

Hand tools and fabrication machines

Breadboard, 270 Pin
Breadboard, 270 Pin
Servo Motor, Premium Male/Male Jumper Wires
Servo Motor, Premium Male/Male Jumper Wires

Story

Read more

Code

mechanicalArm

C/C++
#include <Servo.h>
#define pinServ1 11
#define pinServ2 10
#define pinServ3 9
#define pinServ4 8

Servo serv1 , serv2 , serv3 , serv4;

int motor1 = 90 ;
int motor2 = 52 ;
int motor3 = 67 ;
int motor4 = 0  ;


char buf;

void setup() {
  Serial.begin(9600);
  Serial.println("The device started, now you can pair it with bluetooth!");

  serv1.attach(pinServ1);
  serv2.attach(pinServ2);
  serv3.attach(pinServ3);
  serv4.attach(pinServ4);

  
}

void loop() {
  while(Serial.available() > 0)
  {
    buf = Serial.read();

    Serial.println(Serial.read());  
    
    if(buf == 'F'){
      serv1.write(motor1 += 4);
      delay(5);
    }
  
     if(buf == 'B'){
      serv1.write(motor1 -= 4);
      delay(5);
    }

    if(buf == 'L'){
      serv2.write(motor2 += 4);
      delay(5);
    }
  
     if(buf == 'R'){
      serv2.write(motor2 -= 4);
      delay(5);
    }

    if(buf == 'G'){
      serv3.write(motor3 += 4);
      delay(15);
    }
  
     if(buf == 'I'){
      serv3.write(motor3 -= 4);
      delay(15);
    }
    if(buf == 'H'){
      serv4.write(motor4 += 4);
      delay(15);
    }
  
     if(buf == 'J'){
      serv4.write(motor4 -= 4);
      delay(15);
    }


  delay(25);
  }

}

Credits

mathparracho
3 projects • 0 followers
renanbreis
4 projects • 0 followers

Comments