caramoan tour package

caramoan tour package

Author Topic: controlling 2 servos using 2 potentiometers over bluetooth/xbee connection...  (Read 1843 times)

Offline graffikel2010

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
Hello po mga roboticists!

May nalalaman po ba kayo na way kung paano mahihiwalay yung value ng dalawang potentiometer over wireless connection?

and paano ko rin po kokontrolin yung dalawang servo gamit yung dalawang potentiometer?

btw, ARDUINO po gamit ko :))

Maraming Salamat!

Philippine Electronics Forum


Offline e-tronix

  • Lead Acid Battery
  • *******
  • Posts: 981
  • Pogi/Ganda Points: 26
d ko mgets ito, y need to control a servo using potentio, use your ARDUINO alone to control it.

Philippine Electronics Forum


Offline graffikel2010

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
project ko po is robot arm eh..... gusto ko po kontrolin every joint with a potentiometer for more accurate results...

kung arduino alone po ang gagamitin, paano ko po gagawin yun?

Philippine Electronics Forum


Offline RiDdLeR???

  • Hydroelectric
  • ***
  • Posts: 3032
  • Pogi/Ganda Points: 208
1. Connect your pot to a 5V source.
2. Connect the wiper arm to the analog input of the arduino.
3. Use consecutive analog read to read the value of each pot.
4. Each of the pot will have a corresponding digital readout value.
5. You send this via uart (using any wireless medium like bt, nrlf, zigbee, etc etc).
6.  On the receing arduino, you also receive the values via uart.
7.  Parse the received data via uart and write the values to the analog write.
8.  Connect your servo control pin to the pwm output pin of the arduino.

Madali lang yan gawin.  If I have time, I can provide you a demo video since I have all the materials  in my parts bin.

Philippine Electronics Forum


Offline graffikel2010

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
pwede nio po ba ako tulungan sa code?

Philippine Electronics Forum


Offline bravokilo

  • Gas Turbine
  • **
  • Posts: 2230
  • Pogi/Ganda Points: 105
Graf....my ten cents worth of inputs:

     The servo was built to respond to pulses whose width varies from 1 to 2 MS(millisecond). The center is at 1.5MS. Am not familiar with arduino but just the same , what has to be coming out of your receiver is pulse train which goes to a decoder to separate the 2 commands. The pulse train is sent serially and the command for servo2 follows that for servo1. A flip flop or a shift register breaks it up into different channels. Baga from serial to parallel.

     Now, on you computer or arduino, you have to have a way to control the pulse width for servo1 and servo2. You are on the right tract in thinking of using external pots.

      You know, you might be just overdoing it using arduino when a simple multi channel radio will do. I have solid background in RC electronics.


BK 0922 281 0680

Offline e-tronix

  • Lead Acid Battery
  • *******
  • Posts: 981
  • Pogi/Ganda Points: 26
1. Connect your pot to a 5V source.
2. Connect the wiper arm to the analog input of the arduino.
3. Use consecutive analog read to read the value of each pot.
4. Each of the pot will have a corresponding digital readout value.
5. You send this via uart (using any wireless medium like bt, nrlf, zigbee, etc etc).
6.  On the receing arduino, you also receive the values via uart.
7.  Parse the received data via uart and write the values to the analog write.
8.  Connect your servo control pin to the pwm output pin of the arduino.

Madali lang yan gawin.  If I have time, I can provide you a demo video since I have all the materials  in my parts bin.

demo mo na sir.

Offline lightelectro

  • Lead Acid Battery
  • *******
  • Posts: 678
  • Pogi/Ganda Points: 51
  • Gender: Male
    • Android Tablet Lover
Subscribing. 8)
LATEST ANDROID TABLET NEWS
http://androidtabletlover.blogspot.com/

Offline graffikel2010

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
1. Connect your pot to a 5V source.
2. Connect the wiper arm to the analog input of the arduino.
3. Use consecutive analog read to read the value of each pot.
4. Each of the pot will have a corresponding digital readout value.
5. You send this via uart (using any wireless medium like bt, nrlf, zigbee, etc etc).
6.  On the receing arduino, you also receive the values via uart.
7.  Parse the received data via uart and write the values to the analog write.
8.  Connect your servo control pin to the pwm output pin of the arduino.

Madali lang yan gawin.  If I have time, I can provide you a demo video since I have all the materials  in my parts bin.

Waiting for this sir :)))

Offline RiDdLeR???

  • Hydroelectric
  • ***
  • Posts: 3032
  • Pogi/Ganda Points: 208
Tonight siguro if I have more time to spare   ...  demo using uart to uart working.  Now just need to replace the serial connections with BT devices.  Need some time to review and study again my BT modules  kung paano i-setup and connect to each other.  One BT (the one connected to the arduino with the pots) will be the master and the other BT (the one connected to the arduino w/ servos) will be the slave.

Medyo madugo ng konti as I have to use level converters pa since the BT modules are 3.3V).

Offline PlCUSER

  • Diesel Generator
  • *
  • Posts: 1911
  • Pogi/Ganda Points: 153
3 x 10k resistor gamit ko madalas sa matching ng 5v mcu at 3.3v device. Madami kasi akong 10k. Hehehe

Offline graffikel2010

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
cge po sir :)) (excited much) XD

Offline graffikel2010

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
UP! on going pa po itong thread! Please post your ideas :))

Offline carlsberg11

  • Lead Acid Battery
  • *******
  • Posts: 526
  • Pogi/Ganda Points: 30
  • Gender: Male
3 x 10k resistor gamit ko madalas sa matching ng 5v mcu at 3.3v device. Madami kasi akong 10k. Hehehe

yun oh! malaking tulong to sir PICUSER! maraming salamat po at subscribing na din :D
Anyone who has never made a mistakes has never tried anything new.

-Albert Einstein

Offline graffikel2010

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
BTW, eto po ung setup ko for 1 pot controlling a servo over bt connection:

Sender arduino:

int potpin = 0;

void setup(){
     Serial.begin(115200);
     
}


void loop(){
  int  potval1 = analogRead(potpin)
 
  byte servoval = map(potval, 0, 1023, 0, 180);
  Serial.print(servoval);
  delay(10);
}



receiving arduino:

#include <Servo.h>

Servo myservo;

void setup(){
   Serial.begin(115200);
   myservo.attach(9);
}

void loop(){
   if(Serial.available()){
    byte servoAng = Serial.read();
    myservo.write(servoAng);
}




Yan po ung working code ko for now... Pero wla po akong idea kung paano ako magdadagdag ng another pot and separate its value from the other pot.... May idea po ba kau?


Offline Interlock()

  • Size C Battery
  • *****
  • Posts: 214
  • Pogi/Ganda Points: 16
  • Gender: Male
  • Puppet.Xander
subscribing...I have almost the same project and almost same approach pero mas simple lng ginawa ko...
Zilog ung MCU ko that time at hindi Arduino... :D
waiting for more...
Everything Under CONTROL.
Just Master the Basics.
In every action there's always an equal reaction.
- Newton's 3rd Law of Motion

Offline tiktak

  • Gas Turbine
  • **
  • Posts: 2861
  • Pogi/Ganda Points: 203
  • Gender: Male
    • Tiktakx's Blog
do something like this:  STX POT1 POT2 ... POTn ETX , STX usually ay 0x02 at ETX 0x03, then sa kabilang side abangan mo yung STX at store sa isang array then lagay mo na value sa servo
8051 stuff

Offline insomartin

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4829
  • Pogi/Ganda Points: 320
  • Gender: Male
  • Nalulunod lang...
offtopic:
nauuso na naman yang STX - ETX na yan ah...
mag checksum kayo!

Offline tiktak

  • Gas Turbine
  • **
  • Posts: 2861
  • Pogi/Ganda Points: 203
  • Gender: Male
    • Tiktakx's Blog
^ CRC :D
8051 stuff

Offline insomartin

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4829
  • Pogi/Ganda Points: 320
  • Gender: Male
  • Nalulunod lang...
@graffikel2010
don't wait for someone na may mag code para sayo.
may sample code kna. para mag start with something.
tama yung kay tiktak na suggestion kasi ayan din madalas kong gawin.

Philippine Electronics Forum


 

Privacy Policy

Contact Us: elabph@yahoo.com