Secured Robot System

By Dhaval R. Mehta and Jill J. Parekh

Description

The Robot provides access only to particular predefined buzzcard holders for security purpose and at the same time it performs operations according to the buzzcard which is swiped.

Block Diagram

/media/uploads/dmehta39/_scaled_block_diagram.png

The above block diagram provides an idea of the hardware connected to the mbed chip on the robot .

  • Magnetic card reader -It is used for security reason. In this Case , only two buzzcards with specific GTID numbers have been given access to activate the robot.However we can code it to provide access to any number of buzzcard holders to activate the robot.
    • When first buzzcard is swiped , it activates the robot, the bot moves in direction for a specific time as per the programmer. At the same time , it activates the sensor SHT15 which provides the temperature readings and displays it on the text LCD.
    • Now when second buzzcard is swiped , it activates the robot, the bot moves in direction for a specific time as per the programmer..At the same time , it activates the sensor SHT15 which provides the humidity readings in this case and displays it on the text LCD.
  • RS 232- It is used to make mbed chip compatible with Magnetic card reader, as both work on different logic technologies. It provides Serial Data transfer between the Magnetic Card reader and the Mbed chip.
  • SHT15- It is a sensor which is interfaced with mbed chip .It measures Temperature and Humidity.
  • Text LCD- It is interfaced with mbed chip and displays Temperature/Humidity when activated by a particular buzzcard holder at a particular time.
  • Dual H-Bridge- It is used for controlling the motions of the robot.It acts as a driver and provides current amplification for the motors of the robot.

Hardware Used

  • mbed LPC 1768
  • 16*2 LCD
  • SHT15
  • RS 232
  • Magnetic Card Reader
  • Dual H-Bridge breakout board
  • DC Motor Robot

Connections

  • mbed to lcd
mbedlcd
p1grnd
p1VO
p15RS
P16E
p17D4
p18D5
p19D6
p20D7
p39RW
p39vcc
  • mbed to H-Bridge
p1grnd
p2vmot
p21PWMB
p22BIN2
p23BIN1
p24AIN1
p25AIN2
p26PWMA
p40/STYB
  • H-Bridge to Robot DC Motor
A01left-red
A02left-blk
B02right-blk
B01right-red
  • mbed to SH15
p1grnd
p40VCC
p9DATA
p10SCK
  • mbed to RS 232
p1grnd
p40VCC
p14TX

Import Code

  • The following link is used to import the code.

Import programproject1

Robot Security System

Code

#include "mbed.h"
#include "motordriver.h"
#include "TextLCD.h"
#include"stdio.h"
#include "stdlib.h"
#include "SHTx/sht15.hpp"

Serial pc(USBTX, USBRX); // tx, rx
Serial device(p13, p14);  // tx, rx

DigitalOut myled3(LED3);
DigitalOut myled2(LED2);
DigitalOut myled4(LED4);

SHTx::SHT15 sensor(p9, p10);
float ss=0;
Motor  left(p21, p22, p23, 1); // pwm, fwd, rev, has brake feature
Motor right(p26, p25, p24, 1);
float dhaval=0;
float jill=0;
float g=0;
float g1=0;
float g2=0;
float g3=0;
//char buffer[50];
float h=0;
float h1=0;
float h2=0;
float h3=0;
TextLCD lcd(p15, p16, p17, p18, p19, p20);
char a[300];
int count=0;
int s = 0;

DigitalOut busy(LED1);

int main()
{ 

sensor.setOTPReload(false);
    sensor.setResolution(true);


busy = true;
        sensor.update();
        busy = false;
         
         sensor.setScale(false);
     float pp1 =  (sensor.getTemperature()-2.0);
     char halftemp[60];
     sprintf(halftemp, "%f", pp1);
     
     float pp2 =  sensor.getHumidity();
      char halftemp2[60];
     sprintf(halftemp2, "%f", pp2);
     




do{
    while(1) {
        count = 0;
        if (device.readable()) {
            do {
                s=device.getc();
                a[count]=s;
                
                count++;
            } while(s != '\r');
    
        if(a[6]=='9' && a[7]=='0' && a[8]=='2' && a[9]=='8' && a[10]=='7' && a[11]=='8' && a[12]=='0' && a[13]=='7' && a[14]=='2' )
         {
                 lcd.cls();
                 lcd.printf("Temperature in C: %s\n", halftemp);

            myled3=!myled3;
            
         h1=0;h2=0;h3=0;g1=0;g2=0;g3=0;
            while (1) {

                if(g1==0) {

                    
// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
                   
                        left.speed(0.4);

                        right.speed(0.8);
                     
                    wait(0.5);
// Turn off motors - coast one and brake one
                    
                    right.speed(0); //////for turning right......
                    left.speed(0); ////for turning left
                    ++g1;
                    
                    wait(1);
                }

                if(g2==0 ) {

                    
// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
                    
                        left.speed(0.2);

                     
                    right.speed(0);
                    
                    wait(1);
// Turn off motors - coast one and brake one
                    
                    
                    left.stop(0); ////for turning left
                    ++g2;
                    
                    wait(1);

                }


                if(g3==0) {
                   
// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
                   
                        left.speed(0.4);

                        
                        right.speed(0.8);
                     
                    wait(0.5);
// Turn off motors - coast one and brake one
                    
                    right.speed(0); //////for turning right......
                    left.speed(0); ////for turning left
                    ++g3;
                   
                    ++jill;
                    wait(1);
                    
                }
    if(jill==1)
    break;
            }


        }
        
        /////////////// TESTING SECOND CARD...F0RWARD THEN RIGHT TURN TERN BACK
        
         if(a[6]=='9' && a[7]=='0' && a[8]=='2' && a[9]=='9' && a[10]=='1' && a[11]=='1' && a[12]=='2' && a[13]=='5' && a[14]=='0' )
        {  
        
                 lcd.cls();
                 lcd.printf("Humidity is\n: %s %%\n", halftemp2);
        
        

            myled2=!myled2;
            myled4=!myled4;
       g1=0;g2=0;g3=0;    h1=0;h2=0;h3=0; 
            
             while (1) {

                if(h1==0 ) {

                    
// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
                  
                        left.speed(0.4);

                        right.speed(0.8);
                  
                    wait(0.5);
// Turn off motors - coast one and brake one
                   
                    right.speed(0); //////for turning right......
                    left.speed(0); ////for turning left
                    ++h1;
                    g1=0;
                    
                    wait(1);
                }

                if(h2==0 ) {

                    
// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
                   
                    right.speed(0.2);
                   
                    left.speed(0);
                    wait(1);
// Turn off motors - coast one and brake one
                   
                     right.stop(0); //////for turning right......
                    //left.stop(0); ////for turning left
                    ++h2;
                    g2=0;
                    
                    wait(1);

                }


                if(h3==0) {
                    //myled=1;
// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
                    
                        left.speed(0.4);

                        
                   

                    wait(0.5);
// Turn off motors - coast one and brake one
                    
                    right.speed(0); //////for turning right......
                    left.speed(0); ////for turning left
                    ++h3;
                    g3=0;
                    
                    ++dhaval;
                    wait(1);

                }
                
                if(dhaval==1)
                break;

            }

            
        }
   }
    
    }
    
   } while(ss==0);  
}





Images

/media/uploads/dmehta39/_scaled_img-20121012-wa0005.jpg

Demo

Reference


Please log in to post comments.