Servo Motor Control Via Bluetooth With Potentiometer

17,036

57

14

Introduction: Servo Motor Control Via Bluetooth With Potentiometer

About: Mechanical engineer, Entrepreneur, Maker, robotic systems expert and founder of Robimek and RobiBot

In this project, we will make the servo motor control with potentiometer via bluetooth.

Two will make the Arduino board via bluetooth wireless haberleştirerek control. Manages one of the modules for this (master) while the other managed (slaves) must be in mode. For both the master and the slave module settings, please click the link below.

http://www.robimek.com/hc-05-ile-hc-06-bluetooth-modullerin-haberlesmesi/

Step 1: Materials:

  • 2 Number Arduino (Nano enough)
  • servo-motor
  • 10k potentiometer
  • Hc-05 Bluetooth Module
  • Hc-06 Bluetooth Module

Step 2: Transmitter Circuit:

Let's connect the signal pins to the analog potentiometer 0 pins.
Hc-05 Bluetooth module 4.p the tx pin, RX pin of the 3.pi to my tie.

Step 3: Receiver Circuit:

10.pin let's connect the servo signal to the pin.Hc-06 module TX to RX pin of the pin 4.pin 3.pin to my tie.

Step 4: Transmitter Software:

//Yazılım Geliştirme By Robimek – 2015

//Yazılım Lisans By Robimek

//www.robimek.com

#include <SoftwareSerial.h>

#define BT_SERIAL_TX 4

#define BT_SERIAL_RX 3

SoftwareSerial BluetoothSerial(BT_SERIAL_TX, BT_SERIAL_RX);

İnt potpin = A0;

int val;

void setup()

{

Serial.begin(9600);

BluetoothSerial.begin(9600);

}

void loop()

{

val = analogRead(potpin);

val = map(val, 0, 1023, 0, 179);

BluetoothSerial.print(val);

delay(100);

}

Step 5: Receiver Software:

//Yazılım Geliştirme By Robimek – 2015

//Yazılım Lisans By Robimek

//www.robimek.com

#include <SoftwareSerial.h>

#define BT_SERIAL_TX 4

#define BT_SERIAL_RX 3

SoftwareSerial BluetoothSerial(BT_SERIAL_TX, BT_SERIAL_RX);

#include <Servo.h>

Servo myservo;

Servo myservo;char val = ‘ ‘;

void setup()

{

Serial.begin(9600);

BluetoothSerial.begin(9600);

myservo.attach(10);

}

void loop()

{

if (BluetoothSerial.available()>0)

{
val = BluetoothSerial.read();

int servoAng = val – ‘0’;

myservo.write(servoAng);

}

}

Step 6: Finally

After installing the software, you can manage your power engine now wirelessly via a potentiometer.

More Information: http://www.robimek.com/potansiyometre-ile-bluetooth-uzerinden-servo-motor-kontrolu/

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    14 Discussions

    0
    TMPK
    TMPK

    11 months ago

    Hi, Nice tutorial! But, please make a tutorial about how to control
    multiple servos with potmeters via bluetooth.

    0
    Keittiot
    Keittiot

    Question 1 year ago

    Hello, how do i "ramp" upp this configuration to handle bigger linear actuators like actuonix P16 for ex

    Kind regards
    Tom

    0
    DavidF21
    DavidF21

    1 year ago

    I am using 2 Arduino UNO's with 2 HC05's and connecting the HC05 TX with 1 and RX with 0I on the Uno I have tried connecting them the other way round and connection them on the UNO TX to 10 RX to 11. But cannot get anything transmitted or received.
    Please help

    0
    jmzagluba
    jmzagluba

    Question 1 year ago on Step 5

    Hi,
    I've been trying to this but with 3 servos to control.
    Can anyone help me with the sketch?
    Ive tried modifying it but there is always error.
    I am a newbie and have no experience on C+ language.

    Thanks

    0
    vipul.swamy
    vipul.swamy

    3 years ago

    Hi there!! thanks for the tutorial. But my (BluetoothSerial.available()>0) is not working, there is no serial communication between my Hc05 and my Hc06 please help.Thanks

    1
    siddiqui_saad
    siddiqui_saad

    3 years ago

    similarly if i have to control 4 servos with 4 potentiometer via Bluetooth can i get a code please help

    0
    muhammadd46
    muhammadd46

    4 years ago

    hc 05 bluetooth whether it could have sent some data sensors to control robot ?
    if it supports , can to do?

    0
    AnkitG27
    AnkitG27

    4 years ago

    I AM USING ARDUINO MEGA AND TWO HC05 MODULES TO CONTROL A SERVO USING POTENTIOMETER, BUT CANT ABLE TO DO IT..

    ANY HELP??

    0
    sezgingul
    sezgingul

    5 years ago

    phamb587 in Receiver Software change "char" to "int" and in transmitter software change "BluetoothSerial.print(val);" to "BluetoothSerial.write(val);"

    0
    sezgingul
    sezgingul

    5 years ago

    ohn Tan峻 2 HC-06 can not communicate. because only works in slave mode.

    one master to be able to do well in slave mode of communication must be other

    0
    John Tan峻
    John Tan峻

    5 years ago

    Is this also apply on 2 HC-06?

    0
    phamb587
    phamb587

    5 years ago

    Hey Sezgingul!
    Im using Board Uno connecting (HC-05) as master. And the other is Board Mega connecting (HC-05) as slaver. I also apply your code in both Uno and Mega, but I change the pin tx and rx

    Uno

    #define BT_SERIAL_TX 10

    #define BT_SERIAL_RX 11

    Mega

    #define BT_SERIAL_TX 4

    #define BT_SERIAL_RX 3

    But nothing happens after I twist the potentiometer Can you give me some advices

    Thanks

    0
    sezgingul
    sezgingul

    5 years ago

    yes but can not using lm7805 to arduino power.

    I am surprised no has said anything about the amount of current the nano can supply versus the current the servo will require? I set up something similar with a servo turning a potentiometer. I used an LM7805 to provide the power to the servo.