PROJECT
REPORT
SIXTH SENSING
ROBOT
A Project on Atmel ATMega8
Development Board
Ritesh Dwivedi
Shivarshi Bajpai
Shivam Batra
Sagar Bidani
F
6
Contents
oAcknowledgement
oIntroduction
oHardware Description :
 ATMega8 Development Board
 ATMega8L-PU Microprocessor
 The Bot
 Camera
oWorking
oThe Code
oReferences
Introduction
Sixth sense technology is a revolutionary way to a
physical world directly without using dedicated
electronic chips. Sixth sense is a set of wearable
devices that acts as a gestural interface and
aggrandize the physical world around us with
physical information and lets the users to use
natural hand gestures to interact with the digital
information through it. This technology gaining its
popularity strength because of its usability,
simplicity and ability to work in today’s scenario.
The sixth sense technology makes use of different
image processing techniques .There are binary
images which contain only two logic values 0 or
1.intensity image which is a black and white image
with a varying brightness level between o and 255.
A digital colour image consists of RGB (Red, Green
and Blue) components in different proportions.
A different coloured object contains different pixel
values. When an images is captured the position of
required object is sensed or found by specifying
pixel range of the required object. The coloured
image is converted into binary image, in which the
pixel values whose values lies within the range of
required object pixel values are converted into
binary logic vale 1(white pixels) and the pixels
value coloured image which are out of range of
the pixel values of the specified object are
converted into binary value 0 (black pixel).with the
help of these binary converted image it is very
easy to find the position of the object.
WORKING
PRINCIPAL:
We make use of sixth sense technology for our
project. In which we capture the image using
webcam or using any other camera. The more the
sensitivity of the camera the more resolution we
get and hence we can use it for long distance
sensing of the object. The object captured is
processed through some techniques and then its
location or position is found out. And
corresponding command is given to the robot.
The Sixth Sense robot works as follows:
1. It captures the image of the object in view and
track the user’s hand gestures.
2. There are colour markers placed at the tip of
user’s finger. Marking the user’s fingers with red,
yellow, green and blue coloured tape helps the
webcam to recognize the hand gestures. The
movements and arrangement of these markers are
interpreted into gestures that act as an interaction
instruction for the projected application interfaces.
3. The laptop processes the image and interprets
the hand gestures with the help of the coloured
markers placed at the finger tips.
4. The information that is interpreted through the
laptop is send to bot according which it make
movements.
Hardware Description
ATMega8L-PU:
The Atmega8l-8pu is an 8 bit micro controller
based on the Atmega 8 datasheet. It has a
maximum clock frequency of 8 MHz and 8 bit data
bus width with AVR core. The operating supply
voltage ranges from 2.7 v to 5.5 voIts has a total of
3 timers with 23 number of programmable I/O’s, a
USB connection, a power jack, a Reset button,
on/off button.
It contains everything needed to support the
microcontroller; simply connect it to a computer
with a USB cable or power it with an AC-to-DC
adapter or battery to get started.
Pin Number Description
1 (RESET) PC6
2 (RXD) PD0
3 (TXD) PD1
4 (INT0) PD2
5 (INT1) PD3
6 (XCK/T0) PD4
7 VCC
8 GND
9 (XTAL1/TOSC1) PB6
10 (XTAL2/TOSC2) PB7
11 (T1)PD5
12 (AIN0) PD6
13 (AIN1) PD7
14 (ICP1) PB0
15 (OC1A) PB1
16 (SS/OC1B) PB2
17 (MOSI/OC2) PB3
18 (MISO) PB4
19 (SCK) PB5
20 AVCC
21 AREF
22 GND
23 (ADC0) PC0
24 (ADC1) PC1
25 (ADC2) PC2
26 (ADC3) PC3
27 (ADC4/SDA) PC4
28 (ADC5/SCL) PC5
Features
High-performance, Low-power AVR 8-bit Microcontroller
- 130 Powerful Instructions - Most Single Clock Cycle
Execution
- 32 x 8 General Purpose Working Registers
- Up to 6 MIPS Throughput at 16MHz
- Fully Static Operation
- On-chip 2-cycle Multiplier
Non-volatile Program and Data Memories
- 8k Bytes of In-System Self-Programmable Flash
- Optional Boot Code Section with Independent Lock Bits
- 512K Bytes EEPROM
- Programming Lock for Software Security
- 1K Byte Internal SRAM
Peripheral Features
- On-chip Analog Comparator
- Programmable Watchdog Timer with Separate On-chip
Oscillator
- Master/Slave SPI Serial Interface
- Two 8-bit Timer/Counters with Separate Prescalar,
Compare
- One 16-bit Timer/Counter with Separate Prescaler,
Compare and Capture mode
- Real Time Counter with Separate Oscillator
- Three PWM Channels
- 8-channel ADC in TQFP and MLF package
- 6-channel ADC in PDIP package
- Byte-oriented Two-wire Serial Interface
- Programmable Serial USART
Special Microcontroller Features
- Power-on Reset and Programmable Brown-out Detection
- Internal Calibrated RC Oscillator
- External and Internal Interrupt Sources
- Five Sleep Modes: Idle, ADC Noise Reduction, Power-
save, Power-down and Standby
I/O and Packages
- 23 Programmable I/O Lines
- 28-lead PDIP, 32-lead TQFP, 32-pad MLF
Operating Voltages
- 4.5-5.5V for ATmega8L
Speed Grades
- 0-16 MHz for ATmega8L
Power Consumption
- Active: 3.6mA
- Idle Mode: 10mA
- Power-down Mode: 0.5 µA
ATMega8 Development Board:
The Atmel®
AVR®
ATmega8 is a low-power CMOS
8-bit microcontroller based on the AVR RISC
architecture. By executing powerful instructions in
a single clock cycle, the ATmega8 achieves
throughputs approaching 1MIPS per MHz, allowing
the system designer to optimize power
consumption versus processing speed.
The Bot:
Bot is an autonomous robot made of Atmel
ATMega8L-8PU development board containing
Atmel 8-bit AVR RISC-based microcontroller
which combines 8KB of programmable flash
memory, 1KB of SRAM, 512K EEPROM, and a 6
or 8 channel 10-bit A/D converter. The device
supports throughput of 16 MIPS at 16 MHz and
operates between 2.7-5.5 volts.
H-Bridge Motors:
It is an electronic circuit which enables a
voltage to be applied across a load in either
direction.
It allows a circuit full control over a standard
electric DC motor. That is, with an H-bridge, a
microcontroller, logic chip, or remote control
can electronically command the motor to go
forward, reverse, brake, and coast.
vin S1 S3
S2 S4
S1 S2 S3 S4 Result
1 0 0 1 Motor
rotates in
one
direction
0 1 1 0 Motor
rotates in
opposite
direction
0 0 0 0 Motor free
runs
(coasts)
0 1 0 1 Motor
brakes
1 0 1 0 Motor
brakes
M
Camera:
Camera captures the image of the object in view
and tracks the user’s hand gesture. The camera
recognizes individuals, images, pictures, gestures
that user makes with his hand. The camera then
sends this data to a smartphone for processing.
Basically the camera forms a digital eye which
connects to the world of digital information.
In this project we’ll use laptop’s webcam.
Colour Marker: There are colour markers
placed at the tip of user’s fingers. Marking the
user’s fingers with red, yellow, green and blue
coloured tape helps the webcam to recognize the
hand gestures. The movements and arrangement
of these markers are interpreted into gestures that
act as an interaction instruction for the projected
application interfaces.
The Code
function sixthsense
v=videoinput('winvideo');
preview(v)
snap=getsnapshot(v);
i1=ycbcr2rgb(snap);
[a b c]=size(i1);
x=0;
y=0;
z=0;
for m=1:a
for n=1:b
if((i1(m,n,1)<=150)&&(i1(m,n,1)>=90)&&(i1(m,n,2)
>=230)&&(i1(m,n,2)<=255)&&(i1(m,n,3)>=60)&&
(i1(m,n,3)<=170))
x=x+1;
end
end
end
disp(x);
for m=1:a
for n=1:b
if((i1(m,n,1)<=255)&&(i1(m,n,1)>=250)&&(i1(m,n,
2)>=140)&&(i1(m,n,2)<=220)&&(i1(m,n,3)>=250)
&&(i1(m,n,3)<=255))
y=y+1;
end
end
end
disp(y);
for m=1:a
for n=1:b
if((i1(m,n,1)<=255)&&(i1(m,n,1)>=250)&&(i1(m,n,
2)>=90)&&(i1(m,n,2)<=150)&&(i1(m,n,3)>=85)&
&(i1(m,n,3)<=150))
z=z+1;
end
end
end
if((x>y)&&(x>z))
s=serial('com34');
set(s,'BaudRate',9600);
fopen(s);
fwrite(s,'f');
fclose(s);
else if((y>x)&&(y>z))
s=serial('com34');
set(s,'BaudRate',9600);
fopen(s);
fwrite(s,'b');
fclose(s);
else if((z>x)&&(z>y))
s=serial('com34');
set(s,'BaudRate',9600);
fopen(s);
fwrite(s,'a');
fclose(s);
end
end
else
fopen(s);
fwrite(s,'b');
fclose(s);
msgbox('no color detected');
end
end
end
REFERENCES
 ATMega8 Datasheet
 i3indya sixth sense reference material
 Images are being taken from google images
 http://erdipk-
crazyrobots.blogspot.in/2013/03/robotics-eye-
sixth-sense-technology.html
 http://www.circuitstoday.com/avr-atmega8-
microcontroller-an-introduction
 http://en.wikipedia.org/wiki/h-bridgemotor
 http://www.dailygalaxy.com/my_weblog/2011/06
/evolution-news-creating-robots-a-sixth-
sense.html

Sixth sensing robot

  • 1.
    PROJECT REPORT SIXTH SENSING ROBOT A Projecton Atmel ATMega8 Development Board Ritesh Dwivedi Shivarshi Bajpai Shivam Batra Sagar Bidani F 6
  • 2.
    Contents oAcknowledgement oIntroduction oHardware Description : ATMega8 Development Board  ATMega8L-PU Microprocessor  The Bot  Camera oWorking oThe Code oReferences
  • 3.
    Introduction Sixth sense technologyis a revolutionary way to a physical world directly without using dedicated electronic chips. Sixth sense is a set of wearable devices that acts as a gestural interface and aggrandize the physical world around us with physical information and lets the users to use natural hand gestures to interact with the digital information through it. This technology gaining its popularity strength because of its usability, simplicity and ability to work in today’s scenario. The sixth sense technology makes use of different image processing techniques .There are binary images which contain only two logic values 0 or 1.intensity image which is a black and white image with a varying brightness level between o and 255. A digital colour image consists of RGB (Red, Green and Blue) components in different proportions. A different coloured object contains different pixel values. When an images is captured the position of required object is sensed or found by specifying
  • 4.
    pixel range ofthe required object. The coloured image is converted into binary image, in which the pixel values whose values lies within the range of required object pixel values are converted into binary logic vale 1(white pixels) and the pixels value coloured image which are out of range of the pixel values of the specified object are converted into binary value 0 (black pixel).with the help of these binary converted image it is very easy to find the position of the object.
  • 5.
    WORKING PRINCIPAL: We make useof sixth sense technology for our project. In which we capture the image using webcam or using any other camera. The more the sensitivity of the camera the more resolution we get and hence we can use it for long distance sensing of the object. The object captured is processed through some techniques and then its location or position is found out. And corresponding command is given to the robot. The Sixth Sense robot works as follows: 1. It captures the image of the object in view and track the user’s hand gestures. 2. There are colour markers placed at the tip of user’s finger. Marking the user’s fingers with red, yellow, green and blue coloured tape helps the webcam to recognize the hand gestures. The movements and arrangement of these markers are
  • 6.
    interpreted into gesturesthat act as an interaction instruction for the projected application interfaces. 3. The laptop processes the image and interprets the hand gestures with the help of the coloured markers placed at the finger tips. 4. The information that is interpreted through the laptop is send to bot according which it make movements.
  • 7.
    Hardware Description ATMega8L-PU: The Atmega8l-8puis an 8 bit micro controller based on the Atmega 8 datasheet. It has a maximum clock frequency of 8 MHz and 8 bit data bus width with AVR core. The operating supply voltage ranges from 2.7 v to 5.5 voIts has a total of 3 timers with 23 number of programmable I/O’s, a USB connection, a power jack, a Reset button, on/off button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get started. Pin Number Description 1 (RESET) PC6 2 (RXD) PD0 3 (TXD) PD1 4 (INT0) PD2 5 (INT1) PD3
  • 8.
    6 (XCK/T0) PD4 7VCC 8 GND 9 (XTAL1/TOSC1) PB6 10 (XTAL2/TOSC2) PB7 11 (T1)PD5 12 (AIN0) PD6 13 (AIN1) PD7 14 (ICP1) PB0 15 (OC1A) PB1 16 (SS/OC1B) PB2 17 (MOSI/OC2) PB3 18 (MISO) PB4 19 (SCK) PB5 20 AVCC 21 AREF 22 GND 23 (ADC0) PC0 24 (ADC1) PC1 25 (ADC2) PC2 26 (ADC3) PC3 27 (ADC4/SDA) PC4 28 (ADC5/SCL) PC5
  • 9.
    Features High-performance, Low-power AVR8-bit Microcontroller - 130 Powerful Instructions - Most Single Clock Cycle Execution - 32 x 8 General Purpose Working Registers - Up to 6 MIPS Throughput at 16MHz - Fully Static Operation - On-chip 2-cycle Multiplier Non-volatile Program and Data Memories - 8k Bytes of In-System Self-Programmable Flash - Optional Boot Code Section with Independent Lock Bits - 512K Bytes EEPROM - Programming Lock for Software Security - 1K Byte Internal SRAM Peripheral Features - On-chip Analog Comparator - Programmable Watchdog Timer with Separate On-chip Oscillator - Master/Slave SPI Serial Interface - Two 8-bit Timer/Counters with Separate Prescalar, Compare - One 16-bit Timer/Counter with Separate Prescaler, Compare and Capture mode - Real Time Counter with Separate Oscillator
  • 10.
    - Three PWMChannels - 8-channel ADC in TQFP and MLF package - 6-channel ADC in PDIP package - Byte-oriented Two-wire Serial Interface - Programmable Serial USART Special Microcontroller Features - Power-on Reset and Programmable Brown-out Detection - Internal Calibrated RC Oscillator - External and Internal Interrupt Sources - Five Sleep Modes: Idle, ADC Noise Reduction, Power- save, Power-down and Standby I/O and Packages - 23 Programmable I/O Lines - 28-lead PDIP, 32-lead TQFP, 32-pad MLF Operating Voltages - 4.5-5.5V for ATmega8L Speed Grades - 0-16 MHz for ATmega8L Power Consumption - Active: 3.6mA - Idle Mode: 10mA - Power-down Mode: 0.5 µA
  • 12.
    ATMega8 Development Board: TheAtmel® AVR® ATmega8 is a low-power CMOS 8-bit microcontroller based on the AVR RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega8 achieves throughputs approaching 1MIPS per MHz, allowing the system designer to optimize power consumption versus processing speed.
  • 13.
    The Bot: Bot isan autonomous robot made of Atmel ATMega8L-8PU development board containing Atmel 8-bit AVR RISC-based microcontroller which combines 8KB of programmable flash memory, 1KB of SRAM, 512K EEPROM, and a 6 or 8 channel 10-bit A/D converter. The device supports throughput of 16 MIPS at 16 MHz and operates between 2.7-5.5 volts. H-Bridge Motors: It is an electronic circuit which enables a voltage to be applied across a load in either direction. It allows a circuit full control over a standard electric DC motor. That is, with an H-bridge, a microcontroller, logic chip, or remote control can electronically command the motor to go forward, reverse, brake, and coast.
  • 14.
    vin S1 S3 S2S4 S1 S2 S3 S4 Result 1 0 0 1 Motor rotates in one direction 0 1 1 0 Motor rotates in opposite direction 0 0 0 0 Motor free runs (coasts) 0 1 0 1 Motor brakes 1 0 1 0 Motor brakes M
  • 15.
    Camera: Camera captures theimage of the object in view and tracks the user’s hand gesture. The camera recognizes individuals, images, pictures, gestures that user makes with his hand. The camera then sends this data to a smartphone for processing. Basically the camera forms a digital eye which connects to the world of digital information. In this project we’ll use laptop’s webcam. Colour Marker: There are colour markers placed at the tip of user’s fingers. Marking the user’s fingers with red, yellow, green and blue coloured tape helps the webcam to recognize the hand gestures. The movements and arrangement of these markers are interpreted into gestures that act as an interaction instruction for the projected application interfaces.
  • 16.
  • 20.
    function sixthsense v=videoinput('winvideo'); preview(v) snap=getsnapshot(v); i1=ycbcr2rgb(snap); [a bc]=size(i1); x=0; y=0; z=0; for m=1:a for n=1:b if((i1(m,n,1)<=150)&&(i1(m,n,1)>=90)&&(i1(m,n,2) >=230)&&(i1(m,n,2)<=255)&&(i1(m,n,3)>=60)&& (i1(m,n,3)<=170)) x=x+1; end end end
  • 21.
    disp(x); for m=1:a for n=1:b if((i1(m,n,1)<=255)&&(i1(m,n,1)>=250)&&(i1(m,n, 2)>=140)&&(i1(m,n,2)<=220)&&(i1(m,n,3)>=250) &&(i1(m,n,3)<=255)) y=y+1; end end end disp(y); form=1:a for n=1:b if((i1(m,n,1)<=255)&&(i1(m,n,1)>=250)&&(i1(m,n, 2)>=90)&&(i1(m,n,2)<=150)&&(i1(m,n,3)>=85)& &(i1(m,n,3)<=150)) z=z+1; end end
  • 22.
  • 23.
  • 24.
    REFERENCES  ATMega8 Datasheet i3indya sixth sense reference material  Images are being taken from google images  http://erdipk- crazyrobots.blogspot.in/2013/03/robotics-eye- sixth-sense-technology.html  http://www.circuitstoday.com/avr-atmega8- microcontroller-an-introduction  http://en.wikipedia.org/wiki/h-bridgemotor  http://www.dailygalaxy.com/my_weblog/2011/06 /evolution-news-creating-robots-a-sixth- sense.html