Introduction: Design of Humanoid and Drone Hybrid for Neutralizing Threats and Surveillance

In this we have proposed a multipurpose humanoid system which could be useful in many applications including defense, surveillance and any hazardous working environment. To have exact imitations of human body motions we have used Artificial Neural Network (ANN), which is far better than conventionally used H-bridge and clipper based systems considering such application. In this system we have used 4 accelerometers and flex sensors to imitate human hand gestures and head motions by humanoid. Software logic based mapping technique is employed in order to perform appropriate motions of humanoid with the help of different servo motors. The humanoid system is responsible for imitating fine human body motions without any physical wire connection between user and humanoid system.



In this project we propose a novel idea of combining humanoid with drone, in order to get advantage of human accuracy and military tank to get ease in traveling on rough and uneven paths. Hence to utilize optimum working capability, it works in two different modes namely humanoid mode and infiltration mode. Such system can be optimally utilised while performing bomb defusing work, atomic radiation labs, chemical lab and in far extent as a future soldier. Basically, any situation where human existence is hazardous still requires human accuracy.

Giving war robots ‘autonomy’ sparks fear of independent killing machines similar to sci-fi stories and movies. Hence we are optimizing human controlled system that provides smoother and flexible use of humanoid along with achieving desired results. While employing humanoid in extreme conditions, the user wears various sensors on critical positions of his/her body such as joints which are ideal for mapping the sensor output onto the humanoid motions. Outputs of the sensors are provided to microcontroller for further processing. Through wireless communication the humanoid functioning is performed in accordance with user.

A. Humanoid Mode

Entire humanoid assembly is unfolded to perform human resembling tasks such as picking, holding objects and after certain improvements aiming and firing through modified military guns. System can be further divided into two distinct parts:


Transmitter (Tx) Side:

In our system, to get accurate hand motion, we have used 3 different accelerometers on three critical positions of the hand nothing but all the joints as shown in the diagram.

Hence we have placed accelerometer on shoulder, elbow and wrist each. As the accelerometers measures values against gravity, when hand is moved accelerometer output varies. Similarly, to capture the finger motions we have used flex sensors which changes it resistance when we bend them. Both the sensors used are analog sensors means provides output information in analog form. ATMega328 microcontroller takes care of converting analog signal into digital as it is mandatory for further data processing. ATMega328 works along with Arduino Uno board. It converts output analog signal into digital in the range of 0 to 1023. Processed signal is transmitted through XBee wireless module which allows high data rate transmission. As this is experimental prototype, we are using basic Series 1 XBee module. It performs QPSK modulation in order to perform efficient data transmission with baud rate of 9600/s. Further improvements in XBee communication range are described in sections ahead.

Receiver (Rx) side:

At the Rx side, humanoid structure comprised of several servo motors to perform human hand resembling motions. Hence we have mounted servo on each joint of the arm. In addition, there exist 5 servo motors for five fingers.

Processed signal from transmitter is received via XBee receiver. Here demodulation is performed by Rx Xbee. This demodulated signal is still in the digital format and hence couldn’t be recognized by the servos present. Now, we are needed to convert the received digital signal into servo understandable signal. Servo understand PWM signal to move in the angle 0-180 degrees. Receiver ATMega328 controller with Arduino Uno board is responsible for signal conversion and providing PWM signal to servos in order to perform appropriate task.

User hand motion and the humanoid motion through servo should be in synchronized with each other. This was the vital challenge faced during the mapping and programming. As the user hand moved in specific angle should match with the servo shaft angle resulting in user imitating humanoid motions.

B. Infiltration Mode

In travelling longer distances, which could be regular operation for applications we are looking for. Hence it is design necessity to adapt required physical structure to get ease in travelling. Hence while system is being used in infiltration mode, entire humanoid assembly folds resulting into military tank like structure. Now user can efficiently perform long distance travel.

To perform transformation into infiltration activity, we use DTMF mobile based controller. Here network signal receiving devices such as mobile phones are connected at both transmitter and receiver sides. As it uses mobile based technology inherently it has got infinite range. It means the drone can be accessed wherever mobile signal range is available.

Step 1: Animatronic Arm Design

We have to consider some parameters while designing the robotic are those parameters are torque calculations, kinematics, length of different parts and material to use

we have used aluminium while considering its strength and light in weight

there are three parts in robotic arm to design shoulder, elbow and wrist arrangement and at last fingers of robot

as per our calculation we required to fix two servo motors at each joint to pickup the weight of robotic arm we make use of Towerpro MG995 servo at each joint

two at shoulder

two at elbow

and one at wrist

torque calculations are attached with this step please follow the length of each part to get same results as us

for animatronic hand buy it from link below

http://www.ebay.com/itm/Build-Robotic-Hand-Kit-by-...

attach five micro servos to this robotic arm or follow

https://www.instructables.com/id/Simple-Animatronic...

https://www.instructables.com/id/Arduino-Wireless-A...

this two great instructables

Step 2: Servo Shafts, Clamps and Carpentry Work

Either we can build our own servo shafts or simply can buy it from ebay.com it costs you around 2 $

http://www.ebay.com/itm/10PCS-x-Aluminum-Servo-Arm...

To make it by own

take one aluminium strip of this dimensions

cut it into mm small parts

make measurement on the center to tap a hole and get impression of gear to fit it on the servo shaft

now make our punch ready to build punch need good knowledge of milling machine so guys build it from any miller expert

after punch ready get impression of that punch on servo shaft

remove in necessary aluminum remove around the gear punch

use oil to make it smooth and try to fix it on servo shaft

Build some clamps for robotic arm as shown in figure with given measurements

then make box ready to rest robotic structure and fix all motor on it to give it mobility.

Step 3: Rack and Pinion Mechanism to Switch Robot in Two Modes

as discuss our robot works in two different modes infiltration mode and humanoid mode

in infiltration mode all robotic arm structure goes in side of the body as we have to do observation only that complete robot assembly goes inside the box like structure and again to perform humanoid operations it comes up out of the body to perform this we required high torque DC motor and a proper mechanical assembly

So here we used rack and pinion mechanism to make up and down complete assembly

for that we have taken one steel pipe of 1.5 feet

one rack of the length of 1.5 feet and 0.5 inchs wide and 0.5 inchs thick

make weld both on each other try to find both rack and pipe of same material so that it can weld easily

now time to choose motor

buy small Geared DC motor around 15Kgs of torque fix pinion on the shaft of that DC motor

buy two aluminum cubes one of 4 X 4 inchs and another of 2 X 2 inchs second cube size depends on motor diameter

That big cube is we going to use to support the rack and steel pipe and small one to fix DC motor on the platform

make same arrangement as shown in images

Step 4: Electronic Parts

Arduino UNO R3 x 8 pcs

Accelerometer ADXL 335 x 7pcs to sense arm positions

Flex sensor 4.5" x 6 pcs to sense finger motion

Servo motors MG 995 x 14 pcs for operation of joints elbow, shoulder, wrist

Servo motor microservos x 6 pcs for finger motion control

Wireless RF camera x 1 pcs for surveillance

10k ohms x 10 pcs

Xbee Series 1 x 6pcs

RF module 434Mhz x 1 pcs set of txd and rxd for mobility control we can use DTMF also

Relays 5V x 6 pcs

12 v DC motor 1/16 hp x 2 pcs for drone mobility

12 v DC geared motor x 1 pcs for rack and pinion mechanism

HT12E and HT12D x 1pcs if we are using RF communication for mobility control

750K ohms x 1 pcs

33K ohms x 1 pcs

4 x 4 Keypad x 1 pcs

Connecting wires

2.5mm multicore polycap wires for high current DC motor and Servo motors

6V DC Battery 4.5 Amp x 2 pcs

12V DC battery 7.5 Amp x 1pcs

Step 5: Connections and Wiring Digrams

Make use of Arduino and Atmega 328 reference pin diagram while connecting wires


Circuit diagram of mobility control at trasmitter side

Circuit diagram of mobility control at receiver side

Circuit Description:

The locomotive motions of humanoid are directly controlled by keypad shown in above diagram. This keypad is responsible for taking input of motions from user such as forward, backward, left and right. In addition, we have provided two special modes for this humanoid to have ease in travelling namely, infiltration mode and humanoid mode.

Transmitter side:

As soon as user clicks one of the keypad buttons for example forward button, the 8 bit code is generated and send to the microcontroller ATMega328 which READ this code. This received code microcontroller ATMega328 converts into 4bit code for further processing. Generated code is given to encoder HT12E to convert it into serial data for wireless transmission. Now serial data from HT12E data out is applied RF module XBee. Before transmitting signals wirelessly it performs Amplitude Shift Keying (ASK) modulation. This is how data is transmitted from transmitter side.

Receiver side:

Receiver RF module XBee is responsible for receiving wireless signals while the received signal is applied to DATA IN of decoder HT12D through DATA pin of XBee. Decoder HT12D converts this into parallel data to obtain the original signal sent. For further processing, this parallel data is given to microcontroller ATmega328. It generates 4bit code to control servo motors to perform left, right, forward or backward motion.

Special cases:

In order to change the system mode from infiltration to humanoid, the receiver microcontroller ATMega328 pin 18 and pin 19 goes high. This enables other two microcontrollers of receiver side. Consequently, this enables hand motions of humanoid. While the robot lifts up through rack and pinion mechanism for upto desired height.

Conversely, if transformation is from humanoid to infiltration, the receiver microcontroller ATMega328 pin 18 and pin 19 goes low. This disables those two microcontrollers of receiver side. This resulting in blocking the servo motors at particular angle to go into infiltration mode.

Hand motion Detection


Circuit description:

Accelerometers are used in order to provide information of exact position of the user hand. We have used 4 accelerometers to acquire different body position information of human body. It gives values in 3-axis co-ordinate system, x, y and z. As you can see from circuit diagram, we have taken x and y information from accelerometer present at wrist and head of user. And for other two accelerometers present at elbow and shoulder we are only taking x information.

However accelerometer provides information in analog values. These values we have to convert into digital for further processing. Analog to digital conversion is performed by using microcontroller ATMega328 i.e it converts continuous varying analog values into digital values ranging from 0 to 1023. Besides this, ATMega328 performs mapping technique converting it into 100 to 230 for achieving step size of 1 degree. Mapped values are transmitted through RF module XBee.

At receiver, received signals are applied to microcontroller ATMega328 again. Since servo understands values in between 0-180 degrees we have perform mapping again to convert those values in the band of 0 to 180. This mapping is done through programming. Mapped values are applied to servos which are responsible for performing humanoid body motions.

Finger control transmitter:

Finger control receiver:

Circuit Description:

For finger motions we have used flex sensors which changes its own resistance as you bend them. These are analog sensors as well. As user moves his/ her fingers, flex sensors bends generating analog values in output. These values we have to convert into digital for further processing. Analog to digital conversion is performed by using microcontroller ATMega328 i.e it converts continuous varying analog values into digital values ranging from 0 to 1023. Besides this, ATMega328 performs mapping technique converting it into 100 to 230 for achieving step size of 1 degree. Mapped values are transmitted through RF module XBee.

At receiver, received signals are applied to microcontroller ATMega328 again. Since servo understands values in between 0-180 degrees we have perform mapping again to convert those values in the band of 0 to 180. This mapping is done through programming. Mapped values are applied to servos which are responsible for performing humanoid body motions.

Step 6: Code for Robot

Guys here we have used several Arduino UNO each for different parts for working of robot so be alert while burning code into it.

Right and left hand control transmitter code:

int sen0 = A0;

int sen1 = A1;

int sen2 = A2;

int sen3 = A3;

int sen4 = A4;

int sen5 = A5;

void setup()

{

Serial.begin(9600);

}

void loop()

{

int val0 = map(analogRead(sen0), 260, 450, 100, 210);

Serial.print(val0);

int val1 = map(analogRead(sen1), 260, 450, 100, 210);

Serial.print(val1);

int val2 = map(analogRead(sen2), 260, 450, 100, 210);

Serial.print(val2);

int val3 = map(analogRead(sen3), 260, 450, 100, 210);

Serial.print(val3);

int val4 = map(analogRead(sen4), 260, 450, 100, 210);

Serial.print(val4);

int val5 = map(analogRead(sen5), 260, 450, 100, 210);

Serial.print(val5);

delay(50);

}

Finger control through flex sensor transmitter code:

int sen0 = A0;

int sen1 = A1;

int sen2 = A2;

int sen3 = A3;

int sen4 = A4;

int sen5 = A5;

void setup()

{

Serial.begin(9600);

}

void loop()

{

int val0 = map(analogRead(sen0), 580, 650,0, 9);

Serial.print(val0);

int val1 = map(analogRead(sen1), 580, 650, 0, 9);

Serial.print(val1);

int val2 = map(analogRead(sen2), 580, 650, 0, 9);

Serial.print(val2);

int val3 = map(analogRead(sen3), 580, 650, 0, 9);

Serial.print(val3);

int val4 = map(analogRead(sen4), 580, 650, 0, 9);

Serial.print(val4);

int val5 = map(analogRead(sen5), 580, 650, 0, 9);

Serial.print(val5);

delay(50);

}

Finger control through flex sensor receiver code:

#include

int servo0Pin = 2;

int servo1Pin = 3;

int servo2Pin = 4;

int servo3Pin = 5;

int servo4Pin = 6;

int servo5Pin = 7;

int val0;

int val1;

int val2;

int val3;

int val4;

int val5;

Servo myservo0;

Servo myservo1;

Servo myservo2;

Servo myservo3;

Servo myservo4;

Servo myservo5;

void setup()

{

Serial.begin(9600);

myservo0.attach(servo0Pin);

myservo1.attach(servo1Pin);

myservo2.attach(servo2Pin);

myservo3.attach(servo3Pin);

myservo4.attach(servo4Pin);

myservo5.attach(servo5Pin);

}

void loop()

{

while(Serial.available() == 0);

byte a= Serial.read();

byte b= Serial.read(); // sholder left

byte c= Serial.read();

byte d= Serial.read();

byte e= Serial.read(); // lbow left

byte f= Serial.read();

int g = map(a,0,9,0,180);

int h = map(a,0,9,0,180);

int i = map(a,0,9,0,180);

int j = map(a,0,9,0,180);

int k = map(a,0,9,0,180);

int l = map(a,0,9,0,180);

myservo0.write(g);

myservo0.write(h);

myservo0.write(i);

myservo0.write(j);

myservo0.write(k);

myservo0.write(l);

delay(50);

}

Right and left hand control receiver code:

#include

int ledPin = 13; // choose the pin for the LED

int inPin = 12;

int valinPin = 0;

int servo0Pin = 2;

int servo1Pin = 3;

int servo2Pin = 4;

int servo3Pin = 5;

int servo4Pin = 6;

int servo5Pin = 7;

int servo6Pin = 8;

int servo7Pin = 9;

Servo myservo0;

Servo myservo1;

Servo myservo2;

Servo myservo3;

Servo myservo4;

Servo myservo5;

Servo myservo6;

Servo myservo7;

int val0;

int val1;

int val2;

int val3;

int val4;

int val5;

// int for calculation of angles

int d,i,n,s,o,t;

void setup()

{

// setpin mode to understand the mode of operation

pinMode(ledPin, OUTPUT); // declare LED as output

pinMode(inPin, INPUT); // declare pushbutton as input

Serial.begin(9600);

// attaching servos

myservo0.attach(servo0Pin);

myservo1.attach(servo1Pin);

myservo2.attach(servo2Pin);

myservo3.attach(servo3Pin);

myservo4.attach(servo4Pin);

myservo5.attach(servo5Pin);

myservo6.attach(servo6Pin);

myservo7.attach(servo7Pin);

}

// to reduce spike effect

int dlast,nlast,ilast,slast,olast,tlast;

void loop()

{

valinPin = digitalRead(inPin); // read input value

if (valinPin == HIGH) { // check if the input is HIGH (button released)

digitalWrite(ledPin, HIGH); // turn LED ON

while(Serial.available() == 0);

//int data = Serial.read() - '0';

byte a= Serial.read();

byte b= Serial.read(); // sholder left

byte c= Serial.read();

byte f= Serial.read();

byte g= Serial.read(); // lbow left

byte h= Serial.read();

byte k= Serial.read();

byte l= Serial.read(); // W left round

byte m= Serial.read();

byte p= Serial.read();

byte q= Serial.read(); // W left up down

byte r= Serial.read();

//extra for six sensors

byte u= Serial.read();

byte v= Serial.read(); // Head round

byte w= Serial.read();

byte x= Serial.read();

byte y= Serial.read(); // Head up down

byte z= Serial.read();

d= (c-48) + (b-48)*10 + (a-48)*100;

d = map(d, 100, 210, 20, 130);

d = constrain(d, 20, 130);

i= (h-48) + (g-48)*10 + (f-48)*100;

i = map(i, 100, 210, 20, 130);

i = constrain(i, 20, 130);

n= (m-48) + (l-48)*10 + (k-48)*100;

n = map(n, 100, 210, 20, 130);

n = constrain(n, 20, 130);

s= (r-48) + (q-48)*10 + (p-48)*100;

s = map(s, 100, 210, 20, 130);

s = constrain(s, 20, 130);

//extra for six sensors

int o= (w-48) + (v-48)*10 + (u-48)*100;

o = map(o, 100, 210, 20, 130);

o = constrain(o, 20, 130);

int t= (z-48) + (y-48)*10 + (x-48)*100;

t = map(t, 100, 210, 20, 130);

t = constrain(t, 20, 130);

// Servo 1

if(d<130 && d>20)

{

if (dlast-d<=20)

{

myservo0.write(d);

int e = 150 - d;

myservo1.write(e);

Serial.print(d);

Serial.print("\t ");

}

}

// Servo 2

if(i<130 && i>20)

{

if (ilast-i<=20)

{

myservo2.write(i);

int j = 150 - i;

myservo3.write(j);

Serial.print(i);

Serial.print("\t ");

}

}

// Servo 3

if(n<130 && n>20)

{

if (nlast-n<=20)

{

myservo4.write(n);

Serial.print(n);

Serial.print("\t ");

}

}

//Servo 4

if(s<130 && s>20)

{

if (slast-s<=20)

{

myservo5.write(s);

Serial.print(s);

Serial.print("\t ");

}

}

//Servo 5

if(o<130 && o>20)

{

if (olast-o<=20)

{

myservo5.write(o);

Serial.print(o);

Serial.print("\t ");

}

}

//Servo 6

if(t<130 && t>20)

{

if (tlast-t<=20)

{

myservo5.write(t);

Serial.print(t);

}

}

Serial.println();

//Serial.flush();

//int d=(int)a;

//int e=(int)b;

//int f=(int)c;

dlast=d;

ilast=i;

nlast=n;

slast=s;

olast=o;

tlast=t;

delay(40);

}

else

{

digitalWrite(ledPin, LOW); // turn LED OFF

int left0= 90;

myservo0.write(left0);

Serial.println(left0);

int left1= 90;

myservo1.write(left1);

Serial.println(left1);

int left2= 90;

myservo2.write(left2);

Serial.println(left2);

int left3= 90;

myservo3.write(left3);

Serial.println(left3);

int left4= 90;

myservo4.write(left4);

Serial.println(left4);

int left5= 90;

myservo5.write(left5);

Serial.println(left5);

}

}

Drone mobility control transmitter code:

#include

const byte ROWS = 4; //four rows

const byte COLS = 4; //four columns

char keys[ROWS][COLS] = {

{'A','B','C','D'},

{'E','F','G','H'},

{'I','J','K','L'},

{'M','N','O','P'}

};

byte rowPins[ROWS] = {3, 2, 1, 0}; //connect to the row pinouts of the keypad

byte colPins[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

int led0 = 8;

int led1 = 9;

int led2 = 10;

int led3 = 11;

void setup(){

Serial.begin(9600);

pinMode(led0, OUTPUT);

pinMode(led1, OUTPUT);

pinMode(led2, OUTPUT);

pinMode(led3, OUTPUT);

}

void loop(){

char key = keypad.getKey();

if (key != NO_KEY){

Serial.println(key);

switch (key) {

case 'A': //

digitalWrite(led0, HIGH);

digitalWrite(led1, LOW);

digitalWrite(led2, LOW);

digitalWrite(led3, LOW);

Serial.println(key);

delay(2000);

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, HIGH);

break;

case 'C': //

digitalWrite(led0, LOW);

digitalWrite(led1, HIGH);

digitalWrite(led2, LOW);

digitalWrite(led3, LOW);

Serial.println(key);

delay(2000);

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, HIGH);

break;

case 'D': //

digitalWrite(led3, LOW);

digitalWrite(led2, LOW);

digitalWrite(led1, HIGH);

digitalWrite(led0, HIGH);

Serial.println(key);

delay(2000);

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, HIGH);

break;

case 'F': //

digitalWrite(led0, LOW);

digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);

digitalWrite(led3, LOW);

Serial.println(key);

delay(2000);

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, HIGH);

break;

case 'H': //

digitalWrite(led0, HIGH);

digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);

digitalWrite(led3, LOW);

Serial.println(key);

delay(2000);

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, HIGH);

break;

case 'M': //

digitalWrite(led0, LOW);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, LOW);

Serial.println(key);

delay(2000);

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, HIGH);

break;

case 'O': //

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, LOW);

Serial.println(key);

delay(2000);

digitalWrite(led0, HIGH);

digitalWrite(led1, HIGH);

digitalWrite(led2, HIGH);

digitalWrite(led3, HIGH);

break;

}

}

}

Drone mobility control receiver code:

int b0;

int b1;

int b2;

int b3;

// the number of the pushbutton pin

const int mo0 = 6;

const int mo1 = 7;

const int mo2 = 8;

const int mo3 = 9;

const int mo4 = 10;

const int mo5 = 11;

const int left = 12;

const int right = 13;

// the number of the LED pin

// variables will change:

// variable for reading the pushbutton status

const int ledPin = A0;

void setup() {

// initialize the LED pin as an output:

pinMode(b0, INPUT);

pinMode(b1, INPUT);

pinMode(b2, INPUT);

pinMode(b3, INPUT);

pinMode(mo0, OUTPUT);

pinMode(mo1, OUTPUT);

pinMode(mo2, OUTPUT);

pinMode(mo3, OUTPUT);

pinMode(mo4, OUTPUT);

pinMode(mo5, OUTPUT);

pinMode(left, OUTPUT);

pinMode(right, OUTPUT);

pinMode(ledPin, OUTPUT);

Serial.begin(9600);

// initialize the pushbutton pin as an input:

}

void loop(){

// read the state of the pushbutton value:

b0 = digitalRead(2);

b1 = digitalRead(3);

b2 = digitalRead(4);

b3 = digitalRead(5);

// check if the pushbutton is pressed.

// if it is, the buttonState is HIGH:

if (b0 == HIGH && b1 == LOW && b2 == LOW && b3 == LOW) { // INF

// turn LED on:

digitalWrite(left, LOW);

digitalWrite(right, LOW);

digitalWrite(mo4, HIGH);

digitalWrite(mo5, LOW);

Serial.println("motor doun");

delay(16000);

digitalWrite(mo4, LOW);

digitalWrite(mo5, LOW);

digitalWrite(left, LOW);

digitalWrite(right, LOW);

Serial.println("done");

}

else if (b0 == LOW && b1 == HIGH && b2 == LOW && b3 == LOW) { // fwd

// turn LED on:

digitalWrite(left, LOW);

digitalWrite(right, LOW);

digitalWrite(mo0, HIGH);

digitalWrite(mo1, LOW);

digitalWrite(mo3, HIGH);

digitalWrite(mo2, LOW);

Serial.println("fwd");

}

else if (b0 == HIGH && b1 == HIGH && b2 == LOW && b3 == LOW) { //

// turn LED on:

analogWrite(ledPin, HIGH);

Serial.println("light");

}

else if (b0 == LOW && b1 == LOW && b2 == HIGH && b3 == LOW) { // right

digitalWrite(left, LOW);

digitalWrite(right, LOW);

digitalWrite(mo0, HIGH);

digitalWrite(mo1, LOW);

digitalWrite(mo2, HIGH);

digitalWrite(mo3, LOW);

Serial.println("right");

}

else if (b0 == HIGH && b1 == LOW && b2 == HIGH && b3 == LOW) { // left

// turn LED on:

digitalWrite(left, LOW);

digitalWrite(right, LOW);

digitalWrite(mo1, HIGH);

digitalWrite(mo0, LOW);

digitalWrite(mo3, HIGH);

digitalWrite(mo2, LOW);

Serial.println("left");

}

else if (b0 == LOW && b1 == HIGH && b2 == HIGH && b3 == LOW) { // HUM

// turn LED on:

digitalWrite(left, LOW);

digitalWrite(right, LOW);

digitalWrite(mo4, LOW);

digitalWrite(mo5, HIGH);

Serial.println("motor UP");

delay(16000);

digitalWrite(mo4, LOW);

digitalWrite(mo5, LOW);

digitalWrite(left, HIGH);

digitalWrite(right, HIGH);

Serial.println("done"); }

else if (b0 == HIGH && b1 == HIGH && b2 == HIGH && b3 == LOW) { // BACK

// turn LED on:

digitalWrite(left, LOW);

digitalWrite(right, LOW);

digitalWrite(mo1, HIGH);

digitalWrite(mo0, LOW);

digitalWrite(mo2, HIGH);

digitalWrite(mo3, LOW);

Serial.println("back");

}

else {

// turn LED off:

digitalWrite(left, HIGH);

digitalWrite(right, HIGH);

digitalWrite(mo0, LOW);

digitalWrite(mo1, LOW);

digitalWrite(mo3, LOW);

digitalWrite(mo2, LOW);

digitalWrite(mo4, LOW);

digitalWrite(mo5, LOW);

analogWrite(ledPin, LOW);

Serial.println("stop");

}

}

Step 7: Robot in Work

guys send message if you need more detailed information

Comments

author
headi (author)2016-01-19

Your project is extremely interesting, Please provide me with a mechanical arrangement and improvement dox which cannot be downloaded. Please mail me at headitwit@gmail.com

Prof. Lobo L.M.R.J,

WIT, Solapur

author
Ian01 (author)2015-09-05

If I read that right, you say you're using a neural network in place of an H-bridge. That makes no sense. That's like using a computer in place of a car. Can you clarify that?

author
Vishal_Mehra (author)2015-07-03

Awesome dude....... It's a great instructables ever