RoboDrift v4.0 (2016)

RoboDrift is an annual competition conducted by the Robotics Club to provide a platform and a challenge to students of Kathmandu Engineering College to bring their theoretical knowledge into a physical form. This competition holds the trend of Robotics club of KEC. It is also taken as the greatest platform for students to judge their potential.

The competition is scheduled for (30th July,2016)(15th Shrawan 2073), so better hurry up!

Register HERE—–

Last date for form submission:- 12th Shrawan 2073.robotics robotics1 robotics2 lamp_post

This year the competition will continue the tradition of featuring a race between robots. The race will consists of two segments: automatic and manual.

Image with Dimension.


Game Play

Manual Zone

    • In this zone, the robot will be controlled via a remote — wired or wireless.

    • The robot will have to avoid the obstacles (cubic) (Red) and should strike the green cylindrical structure in-order to lit on the bulbs.

    • Green cylindrical structure has the switch and when the robot strikes with it then the bulb will glow.The height of the switch is 10 cm. Points are allocated consecutively.

    25 points will be given to the racer .

    In-order to gain the points, the robot must glow the bulb.

    • No points will be rewarded to the team who skips the cylindrical structure but 50 points will be deducted if it touches the RED CUBIC OBSTACLE.

    • There are three mini zones in Manual zone: Starting zone, Middle zone, End zone.

    Starting zone: Zero point will be rewarded.

    Middle zone( check point): 50 points will be rewarded

    End zone: 100 points will be rewarded

    Note: At End zone, there will be a green cylindrical structure and to earn 100 points one must lit the bulb otherwise 25 points will be rewarded.

    • The maximum inclination is Ten degree (10).

    Automatic Zone

    • In this segment the robots will have to follow a marked track to. The line will be marked white with the surrounding black.

    • The total length of this zone (not the length of the path) will be approximately 1.5m.

    • The width of the white path is 2.5cm.

    • When it completes the automatic zone then 150 points will be rewarded to the team.

    • The robot must stop after it reaches the finish line. If in case the robot falls down then 50 points will be deducted.


    • The dimension of the robot will have to be equal to or less than 30×25 cm. There is no restriction on the height.

    • The race must be completed within 5 minutes. If the Robot completes the race within 2 minutes then 25 points will be rewarded to the racer.

    • 25 points will be deducted if it drifts away from the path.

    • Maximum potential difference between any two points should not be greater than 24V.

    • No external power source can be used.

    • The control of the robot in the manual zone can be wired or wireless (by any means).

    • The wires cannot be used as a deterrent to the opponent robot.

    • If the robot touches any of the obstacles in the manual zone, deduction in the points is done as a penalty.

    • The switch from the manual to the automatic operation can be done on the robot manually.

    • There is no pause between manual zone and automatic zone, the robot can directly continue to the automatic zone from the manual zone without pause.

    • If the robot drifts from the path in the automatic zone, the robot will have to restart from the previous check point.


  • The dimensions of the arena are subject to change.

  • The races will be decided via a tie-sheet.

  • The robots will have to race more than once, so the teams are advised to be prepared with extra batteries.

  • Registration

  • Registration will be in teams of at most 4 members.

  • Registration fee: Rs 200.

  • Deadline: 12th Shrawan 2073

  • Registration here!!!!

For further details:
Ravi Gurau :9813191530
Manish Adhikari: 9860354317
Ashish Jaiswal: 9860043739
Visit to Robotics club and Be updated with our official page.

Note:- Especially for 1st and 2nd year students, Our door is always open for help.


RoboDrift 2015

RoboDrift is an annual competition conducted by the Robotics Club to provide a platform and a challenge to students of Kathmandu Engineering College to bring their theoretical knowledge into a physical form.

The competition is scheduled for 22th Sharawan (next Friday), so better hurry up!

Continue reading RoboDrift 2015


Robotics Workshop

Robotics Club is organising a two-part workshop to orient students to microcontrollers (AVR). The workshop is divided into two parts: first, aimed at complete beginners and the second, for intermediate and even advanced students.
Continue reading Robotics Workshop


Events Last Year – 2013

What we have done this Semester?

This has been a very productive semester for the robotics club as this club has successfully completed a variety of activities. First major event that the club did was the selection of the new members. Members were selected from the second and third year of the college. The selection basis for the member was aptitude test, viva and involvement in the projects. The club then conducted the training program for the new members.

Continue reading Events Last Year – 2013


Timer 555 Workshop

Robotics and Arts !!

Timer 555 workshop was held with a motive to build circuit producing cricket noise. The main motto of the program was to interact robotics and art.  The complete circuit is to be displayed at Art Expo with the art concept of Anil Udaya.

The presenter for the Workshop were :
Mr. Bijay Tamang
Mr. Manoj Karki
Mr. Sumesh Ghatane

Bijay conducted the session introduction of  the basic  electronics, where he was able to  explain resistors, capacitors diodes, comparators and other basic circuits.

Manoj explained about  the working mechanism of IC 555 Timer . Students were able to grab the knowledge of flip-flops, the architecture, working principle and applications of IC555 timer. The different modes of timer were clearly discussed.Sumesh  described the circuit diagram of the Cricket.manojbijay

The students were able to get the basic concept of Timer 555, producing the sound of cricket circuit.

The main objective of the program was to fuse the arts and robotics. The completed circuit will be displayed at Art Expo. Other further projects are going to be carried out promoting Robotics and Art. Robotics Club Kathmandu Engineering College is taking a lead for it .


Input/Output Processor

Linux brings a great deal of capability to the party, especially with regards to networking and USB support. But one thing Linux systems, including the Raspberry Pi, lack: microsecond I /O (input/output) signal timing resolution. The multiuser, multitasking, virtual memory foundation of Linux simply prevents it from responding to or timing external events with predictable microsecond resolution.
Some interesting projects that would require microsecond timing resolution include:
• IR (Infrared) remote control protocols;
• DCC (Digital Command Control) for model railroads;
• Ultrasonic ranging .
The other capabilities of Linux are so compelling that attempts have been made from time to time to graft in real time support. None of these have been particularly successful, at least in terms of “mind share”. But fortunately there is another way: the I /O processor.



I/O Processor
An I /O Processor is simply a separate computer dedicated to I /O operations, usually acting as a slave to the “main” or “real” processor. The I /O processor runs its own software, separate from the main processor. Depending on the implementation, the I /O processor software may or may not be alterable from the main processor.

The I /O processor idea is not new. The IBM 7094 mainframe computer of 1 962 could use a 7044 computer for all I /O. Processing was performed on the 7094 and I /O done on the 7044. Even the original IBM PC, released in 1 981 , had an 8048 8-bit microcontroller in the keyboard to handle key press timing. Today, the I /O processor idea has been pushed all the way down to single chip systems: The NXP LPC4300, itself a single chip ARM Cortex-M4 microcontroller, includes a separate ARM Cortex-M0 microcontroller, for real time processing, on the same chip.


Preparing your SD card for the Raspberry Pi


Your typical computer is running an operating system, such as Windows, OS X, or Linux. It’s what starts up when you turn your computer on and it provides your applications access to hardware functions of your computer. For instance, if you’re writing a application that accesses the Internet, you can use the operating system’s functions to do so. You don’t need to understand and write code for every single type of Ethernet or WiFi hardware out there. Like any other computer, the Raspberry Pi also uses an operating system and the “stock” OS is a flavor of Linux called Raspbian. Linux is a great match for Raspberry Pi because it’s free and open source. On one hand, it keeps the price of the platform low, and on the other, it makes it more hackable.

The SD card is important because this is where the Raspberry Pi keeps its operating system and is also where you will store your documents and programs.  The Raspberry Pi will not start without a properly formatted SD Card, containing the bootloader and a suitable operating system.This is very different from most computers and it is what many people find the most daunting part of setting up their Raspberry Pi. It is actually very straightforward—just different!

Warning! When you write the Raspberry Pi image to your SD card you will lose all data that was on the card.


The following instructions are for Windows users.Linux and Mac users can find instructions at :

1. Download the Raspberry Pi operating system
The recommended OS is called Raspbian. Download it here

2. Unzip the file that you just downloaded
a) Right click on the file and choose “Extract all”.
b) Follow the instructions—you will end up with a file ending in .img .This .img file can only be written to your SD card by special disk imaging software, so…

3. Download the Win32DiskImager software
a) Download (currently version 0.6) from:
b) Unzip it in the same way you did the Raspbian .zip file
c) You now have a new folder called win32diskimager-binary . You are now ready to write the Raspbian image to your SD card.

4. Writing Raspbian to the SD card
a) Plug your SD card into your PC
b) In the folder you made in step 3(b), run the file named Win32DiskImager.exe
(in Windows Vista, 7 and 8 we recommend that you right-click this file and choose “Run as administrator”). You will see something like this:


c) If the SD card (Device) you are using isn’t found automatically then click on the drop down box and select it

d) In the Image File box, choose the Raspbian .img file that you downloaded


e) Click Write
f) After a few minutes you will have an SD card that you can use in your Raspberry Pi

5. Booting your Raspberry Pi for the first time
a) Follow the Quick start guide on page 1
b) On first boot you will come to the Raspi-config window
c) Change settings such as timezone and locale if you want
d) Finally, select the second choice: expand_rootfs and say ‘yes’ to a reboot
e) The Raspberry Pi will reboot and you will see raspberrypi login:
f) Type: pi
g) You will be asked for your Password
h) Type: raspberry
i) You will then see the prompt: pi@raspberry ~ $
j) Start the desktop by typing: startx
k) You will find yourself in a familiar-but-different desktop environment.
l) Experiment, explore and have fun!


Interfacing Motor

Interfacing Motor with AVR

In this tutorial we will discuss how to use DC Motors.
First, we simulate it in Proteus :


#define F_CPU 1000000UL

void main()
PORTD=0b00000010;  // forward Direction 
PORTD=0b00000001;  //// reverse direction



Proteus Simulation


Motor Drivers

L239D Motor Driver Pin Configuration

The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications.

All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source.


Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN.

When an enable input is high, the associated drivers are enabled and their outputs are active and in phase with their inputs.

When the enable input is low, those drivers are disabled and their outputs are off and in the high-impedance state.

With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications.

On the L293, external high-speed output clamp diodes should be used for inductive transient suppression.

A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device power dissipation.


Recommended Conditions

Recommended Operation Conditions

Proteus Simulation



#define F_CPU 1000000UL

void main()
PORTD=0b00001010;   //motor 1 & 2 in forward direction
PORTD=0b00000101;  //motor 1 & 2 in reverse direction





LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16×2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations  and so on.

16×2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5×7 pixel matrix. This LCD has two registers, namely, Command and Data.

The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD. Click to learn more about internal structure of a LCD.




 LCD displays have two RAMs, naming DDRAM and CGRAM. DDRAM registers in which position which character in the ASCII chart would be displayed. Each byte of DDRAM represents each unique position on the LCDdisplay. The LCD controller reads the information from the DDRAM and displays it on the LCD screen. CGRAM allows user to define their custom characters. For that purpose, address space for first 16 ASCII characters are reserved for users. After CGRAM has been setup to display characters, user can easily display their custom characters on the LCD screen.


Initializing the LCD in 4 Bit mode

  • Send wake up command 3 time to LCD which is 0x30.
  • Initialize LCD in 4 bit mode which is 0x20.
  • Clear the display by sending 8 bits clear display command which is 0X01.
  •  Auto address increment by sending 8 bits command 0X06.
  • Cursor off by sending 8 bits command 0X0C.
  •  Set Cursor to the first location of First line by sending the 8 bit command 0X80.
  •  Set Cursor to the first location of second line by sending the 8 bits command 0XC0.


Source Code

#define F_CPU 1000000UL
#define rs PC0
#define rw PC1
#define en PC2
#define data PORTB
void lcd_init();
void lcd_cmd(char cmd_out);
void lcd_data(char data_out);
void lcd_str(char *str);
void shift_cmd(char cmd_in);
void shift_data(char data_in);

int main()
lcd_str("Robotics Club")

void lcd_init()

void shift_cmd(char cmd_in)
  char shift_data1;
  shift_data1= cmd_in & 0XF0;
  shift_data1= (cmd_in<<4) & 0XF0;

void lcd_cmd(char cmd_out)
void shift_data(char data_in)
  char shift_data2;
  shift_data2= data_in & 0XF0;
  shift_data2= (data_in<<4) & 0XF0;
void lcd_data(char data_out)

void lcd_str(char *str)
   unsigned int i=0;



Microcontroller understands only digital language. However, the inputs available from the environment to the microcontroller are mostly analog in nature, i.e., they vary continuously with time. In order to understand the inputs by the digital processor, a device called Analog to Digital Converter (ADC) is used. As the name suggests this peripheral gathers the analog information supplied from the environment and converts it to the controller understandable digital format, microcontroller then processes the information and provides the desired result at the output end.

ATmega16/32 has an inbuilt 10 bit, 8-channel ADC system. Some of the basic features of Armega16/32 ADC are:

·         8 Channels.

·         10-bit Resolution.

·         Input voltage range of 0 to Vcc.

·         Selectable 2.56V of internal Reference voltage source.

·      AREF pin for External Reference voltage.

·      ADC Conversion Complete Interrupt.


ADC channels in Atmega16 are multiplexed with PORTA and use the common pins (pin33 to pin40) with PORTA. ADC system  of Atmega16 microcontroller consists of following pins:

        i.            ADC0-ADC7: 8 Channels from Pin 40 to Pin 33 of Atmega16 ADC peripheral.

      ii.            AREF: Pin32 of Atmega16 microcontroller, the voltage on AREF pin acts as the reference voltage for ADC conversion, reference voltage is always less than or equal to the supply voltage, i.e., Vcc.

      iii.            AVCC: Pin30, this pin is the supply voltage pin for using PORTA and the ADC; AVCC pin must be connected to Vcc (microcontroller supply voltage) to use PORTA and ADC.


Note:  External reference voltage source can be used at AREF pin. However, Atmega16 also has internal reference voltage options of 2.56V and Vref = Vcc.


The figure below shows the pin configuration for ADC system of Atmega16 microcontroller.



ADC Registers 

To use the ADC peripheral of Atmega16, certain registers need to be configured.

        i.            ADMUX (ADC Multiplexer And Selection Register)


REFS[0:1] bits determine the source of reference voltage whether it is internal or the external voltage source connected to AREF pin. MUX[4:0] bits are used to select between the channels which will provide data to ADC for conversion. ADLAR bit when set to 1 gives the left adjusted result in data registers ADCH and ADCL.


      ii.            ADCSRA (ADC Control and Status Register)


ADEN: ADC Enable bit, this bit must be set to 1 for turning ADC on.

ADSC: ADC Start Conversion bit, this bit is set to 1 to start ADC conversion, as soon as conversion is completed this bit is set back to 0 by the hardware.

ADATE: ADC Auto Trigger Enable, this bit is set to 1 to enable auto triggering of ADC conversion.

ADIF: ADC Interrupt Flag, this bit is set to 1 when ADC conversion gets complete.

ADIE: ADC Interrupt Enable, this bit is set to 1 if we want to activate the ADC conversion complete interrupt.

ADPS[0:2]: ADC Prescaler bits, these bits are used to set the ADC clock frequency, the configuration of these bits determine the division factor by which the microcontroller clock frequency is divided to get the ADC clock frequency. The figure above shows the prescaler bit values for respective division factor.


The ADC clock frequency must lie somewhere between 50 KHz to 200 KHz.


    iii.            ADCH & ADCL (ADC Data Registers) 

When the ADC conversion is complete the data is stored in these two registers. The data configuration depends on the ADLAR bit value of ADMUX register. If ADLAR=0, data is right adjusted and if ADLAR=1, data is left adjusted.  Always read ADCL first and then ADCH. In cases where the 8-bit precision is enough set the ADLAR bit to 1 to left adjust the data and read only the ADCH data register.


When ADLAR = 0,




When ADLAR = 1,


Circuit description

Connect the circuit as shown in the circuit diagram. A ceramic capacitor 104 is connected in between AVcc (pin 30) and Aref (pin 32). AVcc (pin 30) is connected to external supply +5V.


Code explanation

To interface analog device with AVR microcontroller, follow the following steps for programming it.


Step1: To initialize ADC

        i.            Set the value in ADMUX register according to the ADC channel and the reference voltage.

       ii.            Set the Prescaler bits accordingly in ADCSRA register.

      iii.            Set the ADEN bit to enable the ADC. 

void ADC_init(void)                // Initialization of ADC

         ADMUX=(1<<REFS0); // AVcc with external capacitor at AREF
         // Enable ADC and set Prescaler division factor as 128

 Step 2: To read the analog value

  1. Put the channel value in ADMUX

       ii.            Start the conversion by setting the ADSC bit.

      iii.            Monitor the ADIF bit for conversion complete.

      iv.            Clear the conversion bit ADIF. By writing it 1.

       v.            Digital converted result is now available in ADCH and ADCL registers.

unsigned int ADC_read(unsigned char ch)
         ch= ch & 0b00000111;               // channel must be b/w 0 to 7
         ADMUX |= ch;                                // selecting channel
         ADCSRA|=(1<<ADSC);                          // start conversion
         while(!(ADCSRA & (1<<ADIF)));      // waiting for ADIF, conversion complete
         ADCSRA|=(1<<ADIF);                          // clearing of ADIF, it is done by writing 1 to it
         return (ADC);



 Source Code 

#define F_CPU 1000000UL
uint16_t x1;
void adc_init() 
unsigned int adc_conv( unsigned char ch)
 ADMUX |= (ch & 0b00000111);
 ADMUX |= (1<<REFS0);
 while(!(ADCSRA & (1<<ADIF))); 
int main()