Project tutorial
The Robot MARKUS for Your Business

The Robot MARKUS for Your Business © Apache-2.0

It's a low-cost and handmade robot with the mission to be attractive to the clients from businesses and help with the rate of services.

  • 1,247 views
  • 1 comment
  • 7 respects

Components and supplies

Necessary tools and machines

Apps and online services

About this project

Story

Introduction

Nowadays, all the companies of the world are facing new challenges according to the quality of the services and products that they offer, the question that all are asked is how to offer a quality product, that is profitable and of low price, for this, the companies use cyclical and inefficient service surveys with mobile equipment, which they give to the clients to know the perception of the service. This currently, no longer shows an interest of customers to participate, because they feel tedious, lost time and outdated.

Given this, a prototype interactive robot was developed. MARKUS aims to evaluate and record the perceptions of the services of any company or business in an interactive and attractive way with the clients of the companies, turning service times into moments of joy and satisfaction, with the mission that the client is first and that he returns soon.

Markus has an open, modular and connective platform, which allows it to adapt at low cost to the requirements of organizations.

Cost per device, security, scalability and reliability

The manufacturing cost of the Markus robot was $ 150, since it was built with very low cost recycled materials such as MDF, PVC, fiberglass, etc. The design and construction were made by hand with a maximum time of 10 days.

Markus is a reliable and safe product for companies since its "data" software architecture is in the cloud (UBIDOTS) which allows it to offer and guarantee that the registered information is not modified or altered. It can also be said that, being a modular product and easy to transport, companies have the opportunity to choose any database that companies want.

Markus has the possibility to register and control the responses of each client and to record the information of their results in any company in the world, since their control panels are customizable according to the requirements of each company.

Markus has the advantage of being scalable and connective remotely to provide a solution with quality and promptness for it has online message tools in the cloud and with phone calls. Each Markus is registered independently in the database in the cloud as well as each one is assigned its own control panel with its assigned permissions.

In accordance with the goals for sustainable development made by the UN, Markus contributes and collaborates with the following:

8. Decent work and economic growth

For the value proposition that Markus added to the companies, it will allow them to assure their clients and stand out from the competition of the services they offer, making the service experience unforgettable and soon to return.

9. Industry, innovation and infrastructure

Markus is a very low cost technological proposal with recyclable material, offering companies a modular, scalable and transportable solution to be implemented in the mission and vision of organizations.

12. Responsible and production

Markus is a crucial and strategic element within the organization that allows to interact effectively and with quality control (KPI) which alerts organizations when their products or processes are marked by bad service, MARKUS informs them via mobile devices in real time.

The robot Markus is a strategic value proposition and low cost, which will allow all the companies of the world, small, medium and large to have a new concept of innovation in the field of service robotics helping companies to reach your economic goals and insuring your clients.

Here is a video of the robot (Spanish version):

Fabrication process

Mold design

For the design of the molds are used squared rotation sheets of the big picture, the design is met by hand with measures 30 cm x 57 cm x 30 cm for the structure of the robot:

All the molds of the robot:

Development of the structure by fiberglass

For the fiberglass application, the following components were purchased: crystalline resin (model: PP-70), catalyst (model: K2000), to activate the resin, 1Kg of glass fiber and 2-inch brush for the application, in the images the mentioned components are shown.

Before starting the fiberglass application process, it is recommended to wear gloves, long shirt or gown, mask and safety glasses.

For the preparation and application of the mixture the following steps were followed:

Step 1. For each 100ml of resin, 2% catalyst must be applied, that is, 40 drops.

Step 2. Stir the mixture for about a minute.

Step 3. Apply a layer of the mixture with resin with the brush on the molds.

Step 4. The pieces of fiberglass are placed to the measure of the molds and pressure is applied on the fiber so that it adheres to the molds.

Step 5. Wet the brush with the resin and apply it on the fiberglass, making quick strokes from top to bottom until it covers the surface; noting that the fiberglass is covered in its entirety.

Step 6. Let it dry for 4 to 6 hours, preferably indoors and in a ventilated area.

Step 7. Once the resin is dried in all the molds, # 80 sandpaper is applied to eliminate imperfections.

Step 8. To close the pores and obtain a smooth finish in the fiberglass of all the molds, a paste called policar will be applied; which is obtained by mixing 100ml of paste with 2% catalyst and with an application time of 15 min.

Step 9. Let it dry for 2 to 3 hours, in a covered and ventilated area.

Step 10. Re-sand with the sandpaper # 80 the surface of the molds, then apply the sandpaper 180, back the sandpaper # 320 until you get a smooth surface and free of imperfections.

Development of interactive buttons

We used 2 metallic button push buttons, which have green and red lighting. The button system will be used to choose an answer to the question that the MARKUS robot makes; The evaluation of the question can be positive or negative.

Development of audio reproduction modules

For the multimedia reproduction of the questions for the evaluation of the service and reproduction of different messages that the robot will have, the DFPlayer mini module was used, with which through a microSD card or a USB it reproduces audio tracks in MP3 or WAV format

Development of voice commands

I developed an APP for mobile phones with S.O. Android, the application is connected by Bluetooth to the robot and with it you can give basic commands, such as: say hello, say goodbye, etc.

here is a link to download the APK

https://www.dropbox.com/s/h1tpwfr9fql4rm8/Robot_MARKUS.apk?dl=0

Development of capacitive sensors for physical interaction

Metallic adaptations will be made at the tip of the arms of the robot, so that when the robot is greeting the customer and the customer answers the greeting, a voltage variation is sent and a specific action is carried out afterwards.

Development of controllers for the actuators

A mechanical adaptation was made for the movement of the arms using 1 and 2 inch PVC pipes, which were assembled one on top of the other with their respective coupling, adapting it to the servo rotor.

And this is final result:

Configuration and personalization of the database in the cloud and communication is SORACOM.

The database was used in the cloud called UBIDOTS, which allows the real-time recording of the evaluation and perception of the services to be evaluated, synchronized with the interactive button system and the multimedia system.

the control panel that was used to display the positive and negative results of each question configured in the robot is attached

now here the SORACOM board will be shown where we can see all the information about the SIM CARD as the name the location and the connection status.

To connect our SORACOM card with the MARKUS robot, the following steps should be followed:

Step 1. Install the drivers. (Link: https://developers.soracom.io/en/start/iot-starter-kit/basic)

Step 2. Connect our SIM CARD to the computer through the USB port.

Step 3. Wait for the computer to recognize the device and assign it a network connection.

Step 4. In Windows, go to the configuration section, then to the internet and network and finally to the area with mobile wireless coverage.

Step 5. You select the network to which the SIM CARD is connected and you activate it.

Configuring service alerts

The UBIDOTS cloud database is programmed to alert perceptions of poor service; These alerts will be communicated by means ofmobile messaging (telegram) or email to personnel or areas responsible for customer service and telephone calls inetrnacionales and in any language.

IF YOU HAVE ANY DOUBT ABOUT IT, PLEASE SEND ME AN EMAIL: WICHOMW3@HOTMAIL.COM

Libraries

We just neede to add the libraries for the I2C communication, FDPlayer and capacitive sensor with the display so here it is the link to download.

Liquid Crystal I2C

https://www.dropbox.com/s/jkgmu8hgvvtdukp/LiquidCrystal_I2C-master.rar?dl=0

FDPlayer

https://www.arduinolibraries.info/libraries/df-player-mini-mp3-by-makuna

Capacitive sensor

https://playground.arduino.cc/Main/CapacitiveSensor/

Code

CODE FOR THE ARDUINO MEGAArduino
this is the code only for the arduino mega
/*DEVELOPER: LUIS EDUARDO ARENAS DESEANO
 * PUEBLA MEXICO
 * ALL RIGHTS RESERVED BY ROBOT MARKUS
 * WATCHDOG COMPANY
 */

#define SSID "Wicho"     // "SSID-WiFiname write here the name of you wifi connection" 
#define PASS "xnam9730"       // "password wirter here the password of your wifi modem

#define IP "translate.ubidots.com"// ubidots ip
String msgr = "markus/1.0|LV|";    //message to receive info
String msge = "markus/1.0|POST|";  //message to send info
String key="BBFF-lsw5wdRVxKN6tyfXuz0aun6RBvecrP";  //Default token of th ubidost account
String Device1="markus";      //device's name
String Variable1="pregunta1";     //variable's name of ubidots
String Variable2="pregunta11"; //variable's name of ubisots
String Variable3="pregunta2"; //variable's name of ubisots
String Variable4="pregunta22"; //variable's name of ubisots
String Variable5="servicio"; //variable's name of ubisots


#include <LiquidCrystal_I2C.h> // library to configure the I2C display 
LiquidCrystal_I2C lcd(0x27,20,4); // I2C adress for the I2C display

 #include <SoftwareSerial.h> // library toi declare a new serial port in the arduino
SoftwareSerial bluetooth(12,13); // name of the new port declared and with the pins

#include <Wire.h> //library to use the SDA and SCL port of the arduino (I2C connection)

#include <CapacitiveSensor.h> // library to configure two ports as capacitive sensor
 
CapacitiveSensor   sensor = CapacitiveSensor(4,3); // the name "sensor" correspon to the port of the capacitive sensor

 long lectura=0; // to read the capacitive sensor

#include <SoftwareSerial.h> // library to define a new serial port
#include <DFMiniMp3.h> // library to manipulate and configure the MP3 module
class Mp3Notify // a class to configure the mp3 module
{
public:
  static void OnError(uint16_t errorCode) // libraries neccesaries for the mp3 module just copy it
  {
    // see DfMp3_Error for code meaning
    Serial.println();
    Serial.print("Com Error ");
    Serial.println(errorCode);
  }

  static void OnPlayFinished(uint16_t globalTrack) // libraries neccesaries for the mp3 module just copy it
  {
    Serial.println();
    Serial.print("Play finished for #");
    Serial.println(globalTrack);   
  }

  static void OnCardOnline(uint16_t code) // libraries neccesaries for the mp3 module just copy it
  {
    Serial.println();
    Serial.print("Card online ");
    Serial.println(code);     
  }

  static void OnCardInserted(uint16_t code) // libraries neccesaries for the mp3 module just copy it
  {
    Serial.println();
    Serial.print("Card inserted ");
    Serial.println(code); 
  }

  static void OnCardRemoved(uint16_t code)// libraries neccesaries for the mp3 module just copy it
  {
    Serial.println();
    Serial.print("Card removed ");
    Serial.println(code);  
  }
};

DFMiniMp3<HardwareSerial, Mp3Notify> mp3(Serial1); // THIS IS AN IMPORTANT LINE; THIS IS TO ASSING THE SERIAL PORT TO THE MP3 MODULE


String mensaje;

int boton_verde=10; // variable to define the digital port for the green button
int boton_rojo=11; // variable to define the digital port for the red button
int corazon=2; // variable to define the digital port for the led of the heart

int valor_rojo=0; // variable to keep the data from the red button
int valor_verde=0; // variable to keep the data from the green button

int ban1=0; // flag variable to notice the change
int ban2=0; // flag variable to notice the change

int servicio1=0; // variable to know when there is a bad service
//int servicio2=0; 
//int servicio3=0;

int resp1=0; // variable to keep the value of the answer for the question number 1
int resp2=0; // variable to keep the value of the answer for the question number 2
// you can enter as much questions as you want 
//int resp3=0;
//int resp4=0;
//int resp5=0;

#define Pecho 6 // define the digital port for the echo pin of the ultrasonic sensor
#define Ptrig 7 // define the digital port for the trig pin of the ultrasonic sensor
#define Pecho2 8 // define the digital port for the echo pin of the ultrasonic sensor
#define Ptrig2 9 // define the digital port for the trig pin of the ultrasonic sensor
long duracion, distancia;  // variables to read the duration and the distance of the sensor
long duracion2, distancia2; // variables to read the duration and the distance of the sensor   


int tempo=0; // variable to measure the time passed to back to the original position
int activado=0; // variable that detect when the electronic timer is active

void setup() {
  Serial.begin(9600); // inicialize the firts serial to read the serial monitor in the conputer
  Serial2.begin(9600); // inicialize the serial port number two from the arduino mega
  bluetooth.begin(9600); // inicialize the serial port for the bluetooth

  
  lcd.init(); //inicialize the display LCD for the I2C comunication
  lcd.clear(); // clean the display

  pinMode(24,INPUT); //define the input port for the electronic timmer
  pinMode(22,OUTPUT); // define the output port for the electronic timmer
  digitalWrite(22,HIGH); // we activate it for the first time
  
  
    Wire.begin(); // iniciate the I2c port
  mp3.begin(); //iniciate the mp3 module
    mp3.setVolume(25); // set the volume to the 25 percent ( RECOMANDED IN 50%)
   mp3.playMp3FolderTrack(1);    // reproduce a track

   delay(2000);
     Wire.beginTransmission(8); // transmit to device #8 
   Wire.write(1); //send a 1 to the device 8
   Wire.endTransmission(); // en the transmission
   
   delay(6000);
   
   lcd.backlight(); // make a blink in the display
  lcd.clear(); // clear the display
  lcd.setCursor(4,0); // set the cursor
  lcd.print("  H O L A !"); // show a message of welcome
    lcd.setCursor(4,1);
  lcd.print("SOY  MARKUS"); // show a message of welcome
    lcd.setCursor(0,3);
  lcd.print("ESTOY PARA SERVIRTE!"); // show a message of welcome
   delay(3000);
   digitalWrite(corazon,1); // make he heart blink, just one time
   delay(1000);
   digitalWrite(corazon,0); // make he heart blink, just one time

pinMode(Pecho, INPUT);     // define the connection for ultrasonic sensors
  pinMode(Ptrig, OUTPUT);    
  pinMode(Pecho2, INPUT);    
  pinMode(Ptrig2, OUTPUT);

  
pinMode(boton_rojo,INPUT); //define the buttons
pinMode(boton_verde,INPUT);
pinMode(corazon,OUTPUT);  // define the led of the heart

Serial.println("AT");
  Serial2.println("AT");  
 String cmd="AT+CWJAP=\"";           //this command allow us to connect our module to the wifi
  cmd+=SSID;                          //
  cmd+="\",\"";
  cmd+=PASS;
  cmd+="\"";
  Serial.println(cmd);                //send and string with the instructions for connections
  Serial2.println(cmd);
delay(3000);
Serial.println("listo");
 if(Serial2.find("OK")){ //if it find and OK, it will answer yes
    connectWiFi();        //connect the wifi
  }

digitalWrite(corazon,1); 
}
  
  void connectWiFi(){   //this part is to connect the wifi
  Serial.println("AT+CWMODE=1");      
  Serial2.println("AT+CWMODE=1");
 // delay(1000);                        
  String cmd="AT+CWJAP=\"";           
  cmd+=SSID;                          
  cmd+="\",\"";
  cmd+=PASS;
  cmd+="\"";
  Serial.println(cmd);               
  Serial2.println(cmd);
  //delay(1000);
  if(Serial2.find("OK")){
    Serial.println("OK"); //
   }
}

void enviomensaje(String device, String variable, int data){ // in this parti we define the method to send a message to  UBIDOTS
  String cmd = "AT+CIPSTART=\"TCP\",\"";     //Preparamos cadena con Inicio de comunicacin
  cmd += IP;
  cmd += "\",9012";
  
  Serial.println(cmd);
  Serial2.println(cmd);               //Enviamos comando  de Inicio de comunicacin
  //delay(1000);
  if(Serial2.find("Error")){          //Si leemos error en la comunicacin terminamos
    return;
  }

  cmd = msge ;             //Preparamos cadena con mensaje de GET
  cmd += key;      //Agregamos key
  cmd +="|";
  cmd += device;  //Agregamos Dispositivo 
  cmd +="=>";
  cmd += variable;  //Agregamos variable
  cmd +=":";
  cmd += data;    //Agregamos el dato a enviar
  cmd +="|end";
  cmd += "\r\n";
  Serial.print("AT+CIPSEND=");    //Enviamos comando de Envio
  Serial2.print("AT+CIPSEND=");
  Serial.println(cmd.length());   //Enviamos longitud de mensaje y enter
  Serial2.println(cmd.length());
  if(Serial2.find(">")){          //Esperamos a recibir orden de envio de mensaje
    Serial.print(cmd);
    Serial2.print(cmd);           //Enviamos mensaje
  }

  //delay(1000);
}
void latir() // method to maje the heart blink
{
  delay(7000);
  for(int i=0;i<=9;i++){
    digitalWrite(corazon,1);
    delay(800);
    digitalWrite(corazon,0);
    delay(800);
  }
}


void loop() {

 digitalWrite(Ptrig, LOW);
  delayMicroseconds(2);
  digitalWrite(Ptrig, HIGH);   // generate a pulse in the trigger by 10ms
  delayMicroseconds(10);
  digitalWrite(Ptrig, LOW);
  
  duracion = pulseIn(Pecho, HIGH);
  distancia = (duracion/2) / 29;            // calculate the distance in centimeters

  digitalWrite(Ptrig2, LOW);
  delayMicroseconds(2);
  digitalWrite(Ptrig2, HIGH);   //generate a pulse in the trigger by 10ms
  delayMicroseconds(10);
  digitalWrite(Ptrig2, LOW);
  
  duracion2 = pulseIn(Pecho2, HIGH);
  distancia2 = (duracion2/2) / 29;    

  Serial.print(distancia);
  Serial.print(" ");
  Serial.println(distancia2);

  while(bluetooth.available()){//make sure thajt the conenction is available 
    delay(10);
    char c = bluetooth.read();//keep the lecture of the buff
    mensaje += c; //concatenating the context
  }

if(mensaje.length()>0){//verify taht the variable is empty

  // FROM THIS PART HERE IS ALL THE COMMAND PER VOICE FOR THE ANDROID APP OF THE ROBOT 
  
    if(mensaje=="*saludar"){
       Wire.beginTransmission(8); // transmit to device #8
   Wire.write(3);
   Wire.endTransmission();
   mp3.playMp3FolderTrack(3);
     }//interpretando mensaje
    else if (mensaje=="*despedir"){
      Wire.beginTransmission(8); // transmit to device #8
   Wire.write(4);
   Wire.endTransmission();
   mp3.playMp3FolderTrack(10);
   latir();
    }//y ejecutando instrucciones
    else if (mensaje=="*baila"){
    mp3.playMp3FolderTrack(11);
   delay(2000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(6);
   Wire.endTransmission();
   delay(7000);
   }//y ejecutando instrucciones
      else if (mensaje=="*chiste"){
    int randomchiste=random(42,44);
    mp3.playMp3FolderTrack(randomchiste);
   delay(2000);
   // Wire.beginTransmission(); // transmit to device #8
   //Wire.write(6);
   //Wire.endTransmission();
   }//y ejecutando instrucciones
         else if (mensaje=="*cantar"){
    //long tiempo;
    //int randomcanto=random(12,13);
    mp3.playMp3FolderTrack(13);
    //if(randomcanto==12){
    //  tiempo=9000;
   // }else{
    //  tiempo=14000;
    //}
   delay(14000);
   Wire.beginTransmission(8); // transmit to device #8
   Wire.write(9);
   Wire.endTransmission();
   }//y ejecutando instrucciones
            else if (mensaje=="*bailemos"){
    mp3.playMp3FolderTrack(14);
   delay(8000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(8);
   Wire.endTransmission();
   }//y ejecutando instrucciones
            else if (mensaje=="*Cantemos"){
    mp3.playMp3FolderTrack(15);
   delay(2000);
   // Wire.beginTransmission(); // transmit to device #8
   //Wire.write(6);
   //Wire.endTransmission();
   }//y ejecutando instrucciones
            else if (mensaje=="*foto"){
    mp3.playMp3FolderTrack(16);
   delay(6000);
   }//y ejecutando instrucciones
            else if (mensaje=="*agradecer foto"){
    mp3.playMp3FolderTrack(17);
   delay(2000);
  }//y ejecutando instrucciones
            else if (mensaje=="*celebrar"){
    mp3.playMp3FolderTrack(19);
   delay(6000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(10);
   Wire.endTransmission();
   for(int i=0;i<=8;i++){
  digitalWrite(corazon,0);
  delay(1000);
  digitalWrite(corazon,1);
  delay(1000);
    }
            }//y ejecutando instrucciones
                        else if (mensaje=="*rector"){
    mp3.playMp3FolderTrack(18);
   delay(6000);
    }
                            else if (mensaje=="*saludo mobility"){
    mp3.playMp3FolderTrack(20);
    delay(3000);
     Wire.beginTransmission(8); // transmit to device #8
   Wire.write(3);
   Wire.endTransmission();
   delay(6000);
    }
                            else if (mensaje=="*misin mobility"){
    mp3.playMp3FolderTrack(21);
   delay(6000);
    }
                            else if (mensaje=="*valores mobility"){
    mp3.playMp3FolderTrack(22);
   delay(6000);
    }
                            else if (mensaje=="*mobility global"){
    mp3.playMp3FolderTrack(23);
   delay(6000);
    }
                            else if (mensaje=="*Vctor"){
    mp3.playMp3FolderTrack(24);
   delay(3000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                            else if (mensaje=="*Guillermo"){
    mp3.playMp3FolderTrack(25);
   delay(6000);
    }
                            else if (mensaje=="*prensa"){
    mp3.playMp3FolderTrack(26);
   delay(6000);
    }
                            else if (mensaje=="*Uriarte"){
    mp3.playMp3FolderTrack(27);
   delay(6000);
    }
                            else if (mensaje=="*dulce"){
    mp3.playMp3FolderTrack(28);
   delay(6000);
    }
                            else if (mensaje=="*despedida mobility"){
    mp3.playMp3FolderTrack(39);
   delay(6000);
    }
                            else if (mensaje=="*frase"){
    mp3.playMp3FolderTrack(47);
   delay(6000);
    }
    
                            else if (mensaje=="*music"){
    int num=random(29,38);
    mp3.playMp3FolderTrack(num);
   delay(6000);
    }

                                else if (mensaje=="*Navidad"){
    int num=random(53,55);
    mp3.playMp3FolderTrack(num);
   delay(6000);
    }
                                    else if (mensaje=="*deseo mobility"){
   // int num=random(53,55);
    mp3.playMp3FolderTrack(56);
   delay(3000);
   Wire.beginTransmission(8); // transmit to device #8
   Wire.write(3);
   Wire.endTransmission();
   delay(6000);
    }
                                    else if (mensaje=="*Aldo"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(52);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Aurelio"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(48);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Too"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(49);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Dante"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(50);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Carlos"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(52);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Humberto"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(57);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Jaime"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(58);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Juan Carlos"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(60);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                    else if (mensaje=="*Javier"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(61);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                                        else if (mensaje=="*Oracle"){
    //int num=random(53,55);
    mp3.playMp3FolderTrack(62);
   delay(4000);
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30);
    if(lectura>5){
          Wire.beginTransmission(8); // transmit to device #8
   Wire.write(2);
   Wire.endTransmission();
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;
    }
                             else if (mensaje=="*info Oracle"){
    mp3.playMp3FolderTrack(63);
   delay(6000);
    }
                             else if (mensaje=="*rayo"){
    mp3.playMp3FolderTrack(64);
   delay(6000);
    }
                             else if (mensaje=="*presenta watchdog"){
    mp3.playMp3FolderTrack(65);
   delay(6000);
    }
                                else if (mensaje=="*Cul es la base de datos ms importante del mundo" || mensaje=="*Cul es la base de datos ms importantes del mundo"){
    mp3.playMp3FolderTrack(66);
   delay(6000);
    }
    
  
    else if (mensaje=="*inicio"){
    mp3.stop();
    Wire.beginTransmission(8); // transmit to device #8
   Wire.write(7);
   Wire.endTransmission();
   }//y ejecutando instrucciones
  
  }

  mensaje="";//reseteando variable 


if(ban1==0){
 if ((distancia <= 20 && distancia >= 1) || (distancia2 <= 20 && distancia2 >= 1)){ // read and compare the distance of the sensor here is difne to 20 centimeters or less
  ban1=1;
 }
}

if(ban1==1){
  if(ban2==0){
  mp3.playMp3FolderTrack(2);  // reproduce an audio whre the robot presentate itself
  ban2=1;
 // enviomensaje(Device1,Variable2,0);
  delay(6000);
  }
   Wire.beginTransmission(8); // transmit to device #8 to wave out
   Wire.write(5);
   Wire.endTransmission();
   
    digitalWrite(22,LOW); //activate the electronic timmer
    digitalWrite(22,HIGH); //desactivate the electornic timmer
    //activado=1;
   
   do{
//    lectura =  sensor.capacitiveSensor(30);
//  Serial.println(lectura);
   activado=digitalRead(24);
   lectura =  sensor.capacitiveSensor(30); // read the lecture from the capacitibe sensor 
      Serial.println(lectura);
      Serial.println("en el timer");
  if(lectura > 50) // if the lecture if more than 50 its that we touch it
   {
    mp3.playMp3FolderTrack(4); // reproduce an audio that explain the routine of the QnA
    delay(5000);
     Wire.beginTransmission(8); // transmit to device #8
      Wire.write(2);
      Wire.endTransmission();
      ban1=2;
      ban2=0;
      activado=0;
      delay(8000);
      //activado=1;
    }

         delay(10);    
   }while(activado==1); 

    if(activado==0 && lectura < 5){
      ban1=0;
      ban2=0;
      Wire.beginTransmission(8); // transmit to device #8 down the arm
      Wire.write(2);
      Wire.endTransmission();
      
    }

}
else if(ban1==2){ // firts quiestion
  mp3.playMp3FolderTrack(5);
  lcd.clear(); // clear the display
  lcd.clear();
    lcd.setCursor(2,1);   // we show the question on the display
  lcd.print("TE GUSTARON LAS");
  lcd.setCursor(3,2);
  lcd.print("SOLUCIONES QUE");
   lcd.setCursor(4,3);
  lcd.print("OFRECE EBIW");
  delay(4000);
    //digitalWrite(22,LOW); //CON LOW SE ACTIVA
    //digitalWrite(22,HIGH); // CON HIGH SE DESACTIVA
  do{  // we wait for the activation of one of the buttons
    //activado=digitalRead(24);
    valor_rojo=digitalRead(boton_rojo);  // read the value of the red button
    valor_verde=digitalRead(boton_verde); // read the value of the green button
    if(valor_rojo==1 && valor_verde==0){ // if the red button is pressed we upgrade the variable for the answer and move to the next question
      resp1=2;
      ban1=3;

    }
    else if(valor_rojo==0 && valor_verde==1){// if the green button is pressed we upgrade the variable for the answer and move to the next question
      resp1=1;
    
       ban1=3;
   
    }
  }while(resp1==0);
   
    
   if(resp1==1)
   enviomensaje(Device1,Variable1,1); //we send the answer to the cloud data base
  else if(resp1==2){
  enviomensaje(Device1,Variable2,1);
  //enviomensaje(Device1,Variable9,1);
  }
  valor_rojo=0; //reset of the variables
  valor_verde=0;
  resp1=0;
  
}

else if(ban1==3){  // second question
  mp3.playMp3FolderTrack(6);
  lcd.clear(); //clear the display
    lcd.setCursor(2,0);   // show the question on the display
  lcd.print("RECOMENDARIAS EL");
  lcd.setCursor(3,1);
  lcd.print("PORTAFOLIO DE");
   lcd.setCursor(1,2);
  lcd.print("SOLUCIONES DE EBIW");
  delay(4000);
  //digitalWrite(22,LOW); //CON LOW SE ACTIVA
  //digitalWrite(22,HIGH); // CON HIGH SE DESACTIVA

  
  do{
    //activado=digitalRead(24);
    valor_rojo=digitalRead(boton_rojo);  // read the values of the buttons
    valor_verde=digitalRead(boton_verde);
    if(valor_rojo==1 && valor_verde==0){  // update the answers an move to the thanks message
      resp2=2;
//      servicio2=1;
      ban1=4;
      //activado=0;
    }
    else if(valor_rojo==0 && valor_verde==1){
      resp2=1;
//      servicio2=0;
      ban1=4;
      //activado=0;
    }
  }while(resp2==0);
  ban1=7;
 
 if(resp2==1)
   enviomensaje(Device1,Variable3,1);
  else if(resp2==2)
  enviomensaje(Device1,Variable4,1);
  valor_rojo=0;
  valor_verde=0;
  resp2=0;
}
/*
else if(ban1==4){
  mp3.playMp3FolderTrack(7);
  lcd.clear();
    lcd.setCursor(2,0);
  lcd.print("TE GUSTARIA QUE");
  lcd.setCursor(2,1);
  lcd.print("UN ROBOT APLIQUE");
   lcd.setCursor(2,2);
  lcd.print("ENCUESTAS EN TU");
   lcd.setCursor(6,3);
  lcd.print("EMPRESA");
  delay(4000);
  do{
    valor_rojo=digitalRead(boton_rojo);
    valor_verde=digitalRead(boton_verde);
    if(valor_rojo==1 && valor_verde==0){
      resp3=2;
      servicio1=1; //////////////////////////// quitar comando
    }
    else if(valor_rojo==0 && valor_verde==1){
      resp3=1;
      servicio1=0; //////////////////////////// quitar comando 
    }
  }while(resp3==0);
  ban1=7; ///////////////////////////////////////////////////// REGRESAR A 5
     if(resp3==1)
   enviomensaje(Device1,Variable5,1);
  else if(resp3==2)
  enviomensaje(Device1,Variable6,1);
  valor_rojo=0;
  valor_verde=0;
  resp3=0;
}

else if(ban1==5){
  mp3.playMp3FolderTrack(8);
  lcd.clear();
    lcd.setCursor(4,0);
  lcd.print("RECOMENDARIAS");
  lcd.setCursor(7,1);
  lcd.print("NUESTRO");
   lcd.setCursor(6,2);
  lcd.print("SERVICIO");
  delay(4000);
  do{
    valor_rojo=digitalRead(boton_rojo);
    valor_verde=digitalRead(boton_verde);
    if(valor_rojo==1 && valor_verde==0){
      resp4=2;
    }
    else if(valor_rojo==0 && valor_verde==1){
      resp4=1;
    }
  }while(resp4==0);
  ban1=6;
     if(resp4==1)
   enviomensaje(Device1,Variable7,1);
  else if(resp4==2)
  enviomensaje(Device1,Variable8,1);
  valor_rojo=0;
  valor_verde=0;
  resp4=0;
}

else if(ban1==6){
  mp3.playMp3FolderTrack(59);
  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print("CONSIDERAS BUENA");
  lcd.setCursor(4,1);
  lcd.print("EL SERVICIO");
   lcd.setCursor(3,2);
  lcd.print("DE CAFETERIA");
   lcd.setCursor(4,3);
  lcd.print("EN LA SALA");
  
  delay(4000);
  do{
    valor_rojo=digitalRead(boton_rojo);
    valor_verde=digitalRead(boton_verde);
    if(valor_rojo==1 && valor_verde==0){
      resp5=2;
    }
    else if(valor_rojo==0 && valor_verde==1){
      resp5=1;
    }
  }while(resp5==0);
  ban1=7;
     if(resp5==1)
   enviomensaje(Device1,Variable10,1);
  else if(resp5==2)
  enviomensaje(Device1,Variable11,1);
  valor_rojo=0;
  valor_verde=0;
  resp5=0;
}
*/
else if(ban1==7){
  if(servicio1==1){ // if there is a bad service we would show an apologize message on the display
    lcd.clear();  
  lcd.setCursor(4,0);
  lcd.print("DISCULPE LAS"); // Mensaje a despegar
    lcd.setCursor(5,1);
  lcd.print("MOLESTIAS"); // Mensaje a despegar
     lcd.setCursor(5,2);
  lcd.print("PRONTO LO"); // Mensaje a despegar
     lcd.setCursor(5,3);
  lcd.print("ATENDERAN"); // Mensaje a despegar
  mp3.playMp3FolderTrack(40); // reproduce an apologize message he star to call person from the companien to assist the client
  enviomensaje(Device1,Variable5,1); // we update it to the cloud data base
  servicio1=0;
//  servicio2=0;
      Wire.beginTransmission(8); // transmit to device #8 to up the arm and to block the robot 
   Wire.write(5);
   Wire.endTransmission();
   delay(2000);
   do{
    lectura =  sensor.capacitiveSensor(30); // the robot is blocked here and waiting for the personal to unblocked it
    if(lectura>5){
      mp3.playMp3FolderTrack(41); // reproduce a message to apologize to the cliente and to hope to see hiim again
          Wire.beginTransmission(8); // transmit to device #8 dowm the arm
   Wire.write(2);
   Wire.endTransmission();
   enviomensaje(Device1,Variable5,0);
   delay(2000);
    }
   }while(lectura<5);
   lectura=0;

  }
  else{  // if there is a good service
  
  mp3.playMp3FolderTrack(9); // reproduce a message to grattitude the client for interactuate with him
  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print("AGRADEZCO"); // show a gratitude message on the display
    lcd.setCursor(8,1);
  lcd.print("TU"); // Mensaje a despegar
    lcd.setCursor(3,2);
  lcd.print("PARTICIPACION"); // Mensaje a despegar
  
if(servicio1==1){  //update the quality of the service in the data base
  enviomensaje(Device1,Variable5,1);
  servicio1=0;
//  servicio2=0;
}else{
  enviomensaje(Device1,Variable5,0);
  servicio1=0;
 // servicio2=0;
}

 for(int i=0;i<=8;i++){ //make the heart blinking
  digitalWrite(corazon,0);
  delay(1000);
  digitalWrite(corazon,1);
  delay(1000);
 }

  }

  
  ban1=0;
  ban2=0;
  lcd.clear();  //clear the display and back to the welcome message
  lcd.setCursor(4,0);
  lcd.print("  H O L A !"); // Mensaje a despegar 
    lcd.setCursor(4,1);
  lcd.print("SOY  MARKUS"); // Mensaje a despegar
    lcd.setCursor(0,3);
  lcd.print("ESTOY PARA SERVIRTE!"); // Mensaje a despegar
}


 
 // delay(100);
}
CODE FOR THE ARDUINO UNOArduino
this is the code only for the arduino uno
/*DEVELOPER: LUIS EDUARDO ARENAS DESEANO
 * PUEBLA MEXICO
 * ALL RIGHTS RESERVED BY ROBOT MARKUS
 * WATCHDOG COMPANY
 */

/*
 * LEFT ARM DOWN POSITION 150   UP POSITION    80
 * RIGHT ARM DOWN POSITION 35   UP POSITION    120
 * BODY CENTER POSITION 90   LEFT POSITION    120 RIGHT POSITION 80
 */
 

#include <Servo.h>
Servo cuerpo,brazo_i,brazo_d;
long num;
int varcuerpo=90; 
int varbrazo_i=160;
int varbrazo_d=30;
int limcuerpoder=60;
int limcuerpoizq=130;
int limbrazo_i_arriba=70;
int limbrazo_i_abajo=160;
int limbrazo_d_arriba=140;
int limbrazo_d_abajo=30;
int x;
int velocidad=1;


#include <Wire.h>

void setup() {
  cuerpo.attach(3); // SERVO 1
  brazo_i.attach(5); // SERVO 2 
  brazo_d.attach(6); // SERVO 3

  cuerpo.write(90);
  brazo_d.write(30);
  brazo_i.write(160);
    Wire.begin(8);                // join i2c bus with address #8
  Wire.onReceive(receiveEvent); // register event
  Serial.begin(9600);           // start serial for output
}

void loop() {
  delay(100);
  switch(x){
    case 1:
      girarizquierda();
      girarderecha();
      centro();
      x=0;
      break;
    case 2:
      regresarcincoderecha();
      x=0;
      break;
     case 3:
      saludar();
      x=0;
      break;
     case 4:
      despedir();
      x=0;
      break;
     case 5:
      cincoderecha();
      x=0;
      break; 
      case 6:
      baile();
      x=0;
      break;
      case 7:
      cuerpo.write(90);
      brazo_d.write(30);
      brazo_i.write(160);
      x=0;
      break;
      case 8:
      bailemos();
      x=0;
      break;
      case 9:
      canta();
      x=0;
      break;
      case 10:
      celebrar();
      x=0;
      break;
      
      }

}

void girarizquierda()
{
  for(varcuerpo;varcuerpo<=limcuerpoizq;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
}
void girarderecha()
{
    for(varcuerpo;varcuerpo>=limcuerpoder;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
}
void centro()
{
    if(varcuerpo>102){
    for(varcuerpo;varcuerpo>=90;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }  
    }
    else{
      for(varcuerpo;varcuerpo<=90;varcuerpo+=1)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }  
    }
}
void cinco()
{
    for(varbrazo_i;varbrazo_i>=limbrazo_i_arriba;varbrazo_i-=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }

}
void cincoderecha()
{
    for(varbrazo_d;varbrazo_d<=limbrazo_d_arriba;varbrazo_d+=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }

}
void regresarcinco(){
        for(varbrazo_i;varbrazo_i<=limbrazo_i_abajo;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
}
void regresarcincoderecha(){
        for(varbrazo_d;varbrazo_d>=limbrazo_d_abajo;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
}
void saludar(){
    for(varbrazo_i;varbrazo_i>=30;varbrazo_i-=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=80;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
      for(varbrazo_i;varbrazo_i>=30;varbrazo_i-=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
            for(varbrazo_i;varbrazo_i<=80;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
        for(varbrazo_i;varbrazo_i>=30;varbrazo_i-=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
        for(varbrazo_i;varbrazo_i<=limbrazo_i_abajo;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
}
void despedir(){
      for(varbrazo_i;varbrazo_i>=30;varbrazo_i-=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
        for(varbrazo_d;varbrazo_d<=170;varbrazo_d+=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
    girarderecha();
  girarizquierda();
  centro();
  delay(6000);
        for(varbrazo_i;varbrazo_i<=limbrazo_i_abajo;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
        for(varbrazo_d;varbrazo_d>=limbrazo_d_abajo;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
}
void baile(){
  centro();
  girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=80;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
    girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=80;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
    girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=80;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
    girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=80;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
  cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
   cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
  cinco();
  cincoderecha();
  girarizquierda();
    cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
   cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
  cinco();
  cincoderecha();
  regresarcincoderecha();
  girarderecha();
  regresarcinco();
  cincoderecha();
  girarizquierda();
  regresarcincoderecha();
  cinco();
  girarderecha();
  regresarcinco();
  //cincoderecha();
 // girarizquierda();
  //regresarcincoderecha();
  centro();
}
void bailemos(){
  cinco();
  cincoderecha();
   girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=100;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
   girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=100;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
   girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=100;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
   girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=100;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
   girarizquierda();
      for(varcuerpo;varcuerpo>=100;varcuerpo-=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarizquierda();
  girarderecha();
    for(varcuerpo;varcuerpo<=100;varcuerpo+=velocidad)
  {
    Serial.println(varcuerpo);
    cuerpo.write(varcuerpo);
    delay(15);
  }
  girarderecha();
  centro();
  regresarcinco();
  regresarcincoderecha();
   
}
void canta(){
  cinco();
  delay(7000);
  regresarcinco();
  cincoderecha();
  delay(7000);
  regresarcincoderecha();
}
void celebrar(){
        for(varbrazo_i;varbrazo_i>=30;varbrazo_i-=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
        for(varbrazo_d;varbrazo_d<=150;varbrazo_d+=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
  girarderecha();
  girarizquierda();
    girarderecha();
  girarizquierda();
  centro();
  delay(6000);
   cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
   cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
   cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
   cinco();
  cincoderecha();
          for(varbrazo_d;varbrazo_d>=90;varbrazo_d-=velocidad)
  {
    Serial.println(varbrazo_d);
    brazo_d.write(varbrazo_d);
    delay(15);
  }
          for(varbrazo_i;varbrazo_i<=100;varbrazo_i+=velocidad)
  {
    Serial.println(varbrazo_i);
    brazo_i.write(varbrazo_i);
    delay(15);
  }
  centro();
  regresarcinco();
  regresarcincoderecha();
  
}


// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany) {
  while (0 < Wire.available()) { // loop through all but the last
   // char c = Wire.read(); // receive byte as a character
  //  Serial.print(c);         // print the character
  
  x = Wire.read();    // receive byte as an integer
 Serial.println(x);         // print the integer
}
}

Custom parts and enclosures

The robot
This is a model scaled of all the parts from the robot (it was made in CATIA)
robot_markus_M9DlimvPTX.CATProduct

Schematics

General schematic
This is the general schematic witll all the connections (sensors, buttons and communications)
Esquematico mohsdvrlfa

Comments

Similar projects you might like

Amazing 6WD Off-Road Robot | Arduino RC Robot

Project tutorial by Jithin Sanal

  • 5,150 views
  • 1 comment
  • 39 respects

Joy Robot (Robô Da Alegria)

Project tutorial by Igor Fonseca Albuquerque

  • 3,192 views
  • 4 comments
  • 27 respects

Otto DIY+ Arduino Bluetooth Robot Easy to 3D Print

Project tutorial by Team Otto builders

  • 62,213 views
  • 130 comments
  • 192 respects

MeArm Robot Arm - Your Robot - V1.0

Project tutorial by Benjamin Gray

  • 23,782 views
  • 4 comments
  • 39 respects

WiFi Robot

Project tutorial by Kartik

  • 3,354 views
  • 1 comment
  • 11 respects

Make your first Arduino robot - The best beginners guide!

Project tutorial by Muhammed Azhar

  • 58,355 views
  • 19 comments
  • 134 respects
Add projectSign up / Login