International Journal of Civil Engineering and Technology (IJCIET) Volume 9, Issue 11, November 2018, pp. 1041 1047, Article ID: IJCIET_09_11_098 Available online at http://www.iaeme.com/ijciet/issues.asp?jtype=ijciet&vtype=9&itype=10 ISSN Print: 0976-6308 and ISSN Online: 0976-6316 IAEME Publication Scopus Indexed PROGRAMMING SERVO MOTORS OF ROBOT ARM TO CONTROLLED DIRECTIONS VIA WII NUNCHUK JOYSTICK Intisar Mohsin Saadoon Department of Computer Science, Mustansiriyah University, Baghdad, Iraq Israa M.Abdal Ameer Al-Khafaji Department of Computer Science, Mustansiriyah University, Baghdad, Iraq Khalida Ali Ahmed Department of Computer Science, Mustansiriyah University, Baghdad, Iraq ABSTRACT As we know that the most famous parts of the industry Robort are a robotic arm.a robotic arm is one of the types of a mechanical arm. It is usually programmed to execute particular functions. In this a research project, we are studying the connection of the robotic arm via the Wii Nunchuk to control the moves of the robotic arm with Arduino (UNO). The goal of this project is to control the four directions (left, right, up & down) and open - close the hands of the robotic arm by using two buttons (C&Z). Key words: Wii Nunchuk, robotic arm, Arduino Cite this Article: Intisar Mohsin Saadoon, Israa M.Abdal Ameer Al-Khafaji, Khalida Ali Ahmed, Programming Servo Motors of Robot Arm to Controlled Directions via Wii Nunchuk Joystick, International Journal of Civil Engineering and Technology (IJCIET) 9(11), 2018, pp. 1041 1047. http://www.iaeme.com/ijciet/issues.asp?jtype=ijciet&vtype=9&itype=11 1. INTRODUCTION The robotic arm is made up of four metal segments, joined by three knuckles. The Wii Nunchuk controls the robotic arm by rotating individual servo motors connected to each joint to move the robotic arm very precisely. http://www.iaeme.com/ijciet/index.asp 1041 editor@iaeme.com
Intisar Mohsin Saadoon, Israa M.Abdal Ameer Al-Khafaji, Khalida Ali Ahmed The mains objective of this project was to control the robotic arm to move the four directions, open and close the hands of the robotic arm by using Wii Nunchuk with Arduino UNO. 2. ARDUINO UNO The Arduino is open-source have ARM processor, can be configured by using the software in a development environment, used to collect and analyze the data to use it in real-time or stored for future analyze. 3. WII NUNCHUK The Nunchuk uses I2C as a transportation protocol. It has a two-axis joystick, two buttons (C&Z) and accelerometer sensible movements to all three dimensions. http://www.iaeme.com/ijciet/index.asp 1042 editor@iaeme.com
Programming Servo Motors of Robot Arm to Controlled Directions via Wii Nunchuk Joystick 3.1. Wii Nunchuk Interface The Wii Nunchuk connect with six pins as follows: The frequency used to communicate with the Wii Nunchuk is100khz. 3.2. Wii Nunchuk Output The Wii Nunchuk is a slave I2C bus device as a transportation protocol that outputs six bytes of data as follows: 4. SERVO MOTOR The internal servo motor of a "mostly controlled" control circuit. When the engine gives pulses at a certain time constant, the motor rotates to the angle according to this time constant. In each type, the amount of fixed time varies from engine to engine depending on the manufacturer and technical bulletin that comes with the servo motor. http://www.iaeme.com/ijciet/index.asp 1043 editor@iaeme.com
Intisar Mohsin Saadoon, Israa M.Abdal Ameer Al-Khafaji, Khalida Ali Ahmed Servo Motor 5. HARDWARE REQUIRED Arduino UNO Wii Nunchuk x1 (Master) Metal segments x4 Servo motors x3 (Slave) USB Cable for Arduino Power supply http://www.iaeme.com/ijciet/index.asp 1044 editor@iaeme.com
Programming Servo Motors of Robot Arm to Controlled Directions via Wii Nunchuk Joystick Breadboard Jumper wires 6. WII NUNCHUK /ROBOTIC ARM INTERFACE Wii Nunchuk / robotic arm interface is a system that measures Nunchuk activity and transforms this activity into outputs (robotic arm) by transportation protocol 7. CODING #include "Wire.h" #include "Servo.h" int x_axis; int y_axis; int z_axis; Servo servolr; Servo servoud; Servo servoro; static uint8_t nunchuckza_buf[6]; void setup() Serial.begin(19200); servolr.attach(9); servoro.attach(10); servoud.attach(11); nunchuckza_setpowerpins(); nunchuckza_init(); Serial.print ("Finished setup\n"); void loop() nunchuckza_get_data(); x_axis = map(nunchuckza_buf[0], 0, 255, 180, 0); http://www.iaeme.com/ijciet/index.asp 1045 editor@iaeme.com
Intisar Mohsin Saadoon, Israa M.Abdal Ameer Al-Khafaji, Khalida Ali Ahmed y_axis = map(nunchuckza_buf[1], 0, 265, 0, 180); if ((nunchuckza_buf[5] >> 1) & 1) z_axis=map(nunchuckza_buf[5], 43, 44, 180, 0); else z_axis=map(nunchuckza_buf[5], 44, 45, 0, 180); servolr.write(x_axis); servoud.write(y_axis); servoro.write(z_axis); x_axis =0; y_axis =0; static void nunchuckza_setpowerpins() #define pwrpin PORTC3// #define gndpin PORTC2// DDRC = _BV(pwrpin) _BV(gndpin);// PORTC &=~ _BV(gndpin); PORTC = _BV(pwrpin); delay(101); void nunchuckza_init() Wire.begin(); Wire.beginTransmission(0x52); Wire.write(0x40); Wire.write(0x00); Wire.endTransmission(); void nunchuckza_send_request() Wire.beginTransmission(0x52); Wire.write(0x00); Wire.endTransmission(); int nunchuckza_get_data() http://www.iaeme.com/ijciet/index.asp 1046 editor@iaeme.com
Programming Servo Motors of Robot Arm to Controlled Directions via Wii Nunchuk Joystick int cnt=0; Wire.requestFrom (0x52, 6); // while ((Wire.available ())) nunchuckza_buf[cnt] = (Wire.read() ^ 0x17) + 0x17;// cnt++; nunchuckza_send_request(); if (cnt >= 5) return 1; return 0; 8. CONCLUSIONS The objective of the project is using the robotic arm in industrial works and dangerous duty by controlling the directions (left, right, up & down) and open - close the hands of the robotic arm by using two buttons (C&Z). REFERENCES [1] Erin Sullivan, Wii Nunchuk Interface.PDF https://support.activision.com/servlet/servlet. [2] Using wii nunchuk with Arduino Robert Eisele Engineer, Systems Architect and DBA December 19th, 2016 [3] Arduino Servo https://www.arduino.cc/en/reference/servo [4] Servomotor Wikipedia https://en.wikipedia.org/wiki/servomotor [5] NUNCHUK CONTROLLED ROBOTIC ARM (WITH ARDUINO) By IgorF2 in TechnologyRobots Feb. 20, 2018 [6] Control Servos using Wii NunchukMark Tashiro. Hackster.io February 27, 2016 http://www.iaeme.com/ijciet/index.asp 1047 editor@iaeme.com