0% found this document useful (0 votes)
17 views50 pages

Robotics

The document outlines a comprehensive guide on robotics, detailing its interdisciplinary nature, software and hardware components, specifically focusing on the Arduino Uno microcontroller. It includes descriptions of the Arduino IDE and Proteus Design Suite, which are essential for programming and circuit design. The hardware section elaborates on the features, power requirements, memory, and communication capabilities of the Arduino Uno, providing a foundational understanding for robotics projects.

Uploaded by

cricketholythe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views50 pages

Robotics

The document outlines a comprehensive guide on robotics, detailing its interdisciplinary nature, software and hardware components, specifically focusing on the Arduino Uno microcontroller. It includes descriptions of the Arduino IDE and Proteus Design Suite, which are essential for programming and circuit design. The hardware section elaborates on the features, power requirements, memory, and communication capabilities of the Arduino Uno, providing a foundational understanding for robotics projects.

Uploaded by

cricketholythe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 50

TABLE OF CONTENTS

S.NO NAME P.NO

1 CHAPTER 1: INTRODUCTION 03
2 CHAPTER 2: SOFTWARE DESCRIPTION 04-08
3 CHAPTER 3: HARDWARE DESCRIPTION 09-48
4 CHAPTER 4: PROJECT 49-52

1
LIST OF FIGURES
2.1 : ARDUINO IDE
2.2 : PROTEUS DESIGN SUITE 8.9
2.3 : SCHEMATIC CAPTURE
3.1 : AT MEGA328
3.2 : ATMEGA328 PIN DIAGRAM
3.3 : BLUETOOTH
3.4 : HARDWARE
3.5 : DC MOTOR
3.6 : LEFT HAND RULE
3.7 : DC MOTOR
3.8 : GRAPH
3.9 : BATTERY
3.10 : DIMENSION
3.11 : DISCHARGE CHARACTERISTICS
3.12 : CONNECTION DIAGRAM
3.13 : CIRCUIT DIAGRAM
3.14 : L293D TWO PHASE MOTORDRIVE
4.1 : TOP VIEW OF ROBOT
4.2 : SIDE VIEW OF ROBOT

2
CHAPTER-1

INTRODUCTION

Robotics is an interdisciplinary branch of Electronics & Communication, computer science and


engineering. Robotics involves the design, construction, operation, and use of robots. The
goal of robotics is to design machines that can help and assist humans. Robotics is a field of
science working with machines that perform tasks based on predetermined and adaptive
programs and algorithm in an automatic or semi- material way. These machines commonly
called robots are either controlled by humans or work entirely under the supervision of a
computer application and algorithms, Robotics is a comprehensive concept that includes the
building, planning and programming of robots. These robots are in direct contact with the
physical world and they have often been used to perform monotonous and repetitive tasks
instead of human beings. Robots can be categorized based on their size, application domain
or purpose, and we will discuss this later.

Robotics is a branch of engineering and science that includes electronics engineering,


mechanical engineering and computer science and so on This branch deals with the design,
construction, use to control shots, sensory feedback and information processing. These are
some technologies which will replace humans and human activities in coming years. These
robots are designed to be used for any purpose but these are using in sensitive environments
like hunch detection, deactivation of various bombs etc.

Robots can take any form but many of them have given the human appearance. The robots
which have taken the form of human appearance may likely to have the walk like humans,
speech, cognition and most importantly all the things a human can do. Most of the robots of
today are inspired by nature and are known as bio-inspired robots. Robotics is that branch of
engineering that deals with conception, design, operation, and manufacturing of robots.
There was an author named Issac Asimov, he said that he was the first person to give
robotics name in a short story composed in 1980's. In that story, Issac suggested three
principles about how to guide these types of robotic machines. Later on, these three
principles were given the name of Issac's three laws of Robotics.

3
CHAPTER-2

SOFTWARE DESCRIPTION

Arduino IDE
Arduino IDE where IDE stands for Integrated Development Environment - An official
software introduced by Arduino.cc., that is mainly used for writing, compiling and
uploading the code in the Arduino Device. Almost all Arduino modules are compatible with
this software that is an open source and is readily available to install and start compiling the
code on the go.
INTRODUCTION TO ARDUINO IDE:
 Arduino IDE is an open source software that is mainly used for writing and
compiling the code into the Arduino Module.
 It is an official Arduino software, making code compilation too easy that even a
common.
 person with no prior technical knowledge can get their feet wet with the learning
process.
 t is easily available for operating systems like MAC, Windows, and Linux and runs
on the Java Platform that comes with inbuilt functions and commands that play a
vital role for debugging, editing and compiling the code in the environment.
 A range of Arduino modules available including Arduino Uno, Arduino, Mega,
Arduino Leonardo, Arduino Micro and many more.
 Each of them contains a microcontroller on the board that is actually programmed
and accepts the information in the form of code.
 he main code, also known as a sketch, created on the IDE platform will ultimately
 generate a Hex File which is then transferred and uploaded in the controller on the
board.
 The IDE environment mainly contains two basic parts. Editor and Compiler where
former is used for writing the required code and later is used for compiling and
uploading the code into the given Arduino Module.
 This environment supports both C and C++ languages.
 The IDE environment is mainly distributed into three sections
1. Menu Bar
2. Text Editor
3. Output Panc

 As you download and open the IDE software, it will appear like an image below.

4
Fig 2.1: Arduino IDE

Proteus Design Suite

The Proteus Design Suite is a Windows application for schematic capture, simulation, and PCB (Printed
Circuit Board) layout design. It can be purchased in many configurations, depending on the size of
designs being produced and the requirements for microcontroller simulation.

5
Introduction to Proteus Design Suite:

 Proteus is used to simulate, design, and drawing of electronic circuits. It was invented by
Labcenter Electronics.
 By using proteus you can make two-dimensional circuit designs as well. With the use of this
engineering software, you can construct and simulate different electrical and electronic
circuits on your personal computers or laptops.
 There are numerous benefits to simulating circuits on proteus before making them
practically. Designing of circuits on the proteus takes less time than practical construction of
the circuit.
 The possibility of error is less in software simulation such as loose connection that takes a lot
 of time to find out connections problems in a practical circuit.
 Circuit simulations provide the main feature that some components of circuits are not practical
 then you can construct your circuit on proteus. There is zero possibility of burning and
damaging of any electronic component in Proteus.
 Electronic tools that are very expensive can easily get in proteus such as an oscilloscope.
 Using proteus you can find different parents of circuits such as current, the voltage value of
any component, and resistance at any instant which is very difficult in a practical circuit.
 There are 2 main parts of proteus first is used to design and draw different circuits and the
second is for designing of PCB layout.
 First is ISIS used to design and simulate circuits. And second is ARES used for designing a
 printed circuit board.
 It also provides features related to the three-dimensional view of design in PCB.
 Proteus also comes with a library manager that helps us to store and manage electronic
components
 This software also comes with a powerful simulation engine that helps us to simulate the
operation of our circuit. It is best to test circuits before making it and debug any issue if your
find.
 As you can see in below figures that we have a lot of icons in Proteus software and to create
a project click on new project then it will shows the interface to design and simulate the
circuit.

Software features

 Default Baud rate: 38400, Data bits:8, Stop bit:1,Parity:No parity, Data control:
has.Supported baud rate: 9600,19200,38400,57600,115200,230400,460800.
 Given a rising pulse in PIO0, device will be disconnected.
 Status instruction port PIO1: low-disconnected, high-connected;
 PIO10 and PIO11 can be connected to red and blue led separately. When master
and slave are paired, red and blue led blinks 1time/2s in interval, while
disconnected only blue led blinks 2times/s.
 Auto-connect to the last device on power as default.
 Permit pairing device to connect as default.
 Auto-pairing PINCODE:”0000” as default
 Auto-reconnect in 30 min when disconnected as a result of beyond the range of
connection.

6
Fig 2.2 : Proteus design suite 8.9

Fig 2.3: Schematic Capture

7
CHAPTER-3

HARDWARE DESCRIPTION
MICROCONTROLLER
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It
has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything needed to support the microcontroller; simply connect it to a
computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter. Revision 2 of the Uno board has a resistor
pulling the 8U2 HWB line to ground, making it easier to put into DFU mode.

Revision 3 of the board has the following new features:

 pinout: added SDA and SCL pins that are near to the AREF pin and two other new
pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the
voltage provided from the board. In future, shields will be compatible both with the
board that use the AVR, which operate with 5V and with the Arduino Due that
operate with 3.3V. The second one is a not connected pin, that is reserved for future
purposes.
 Stronger RESET circuit.
 Atmega 16U2 replace the 8U2.
 "Uno" means one in Italian and is named to mark the upcoming release of Arduino
1.0. The Uno and version 1.0 will be the reference versions of Arduino, moving
forward. The Uno is the latest in a series of USB Arduino boards, and the reference
model for the Arduino platform; for a comparison with previous versions, see the
index of Arduino boards

8
Power
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by
plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can
be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less
than 7V, however, the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage the board.
The recommended range is 7 to 12 volts.

The power pins are as follows:


 VIN. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated power
source). You can supply voltage through this pin, or, if supplying voltage via the
power jack, access it through this pin.
 5V.This pin outputs a regulated 5V from the regulator on the board. The board can
be supplied with power either from the DC power jack (7 - 12V), the USB
connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V
or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
 GND. Ground pins.

Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB
of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library). Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output, using pin
Mode (), digital Write(), and digital Read() functions. They operate at 5 volts. Each pin can
provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected
by default) of 20-50 ohms.

9
In addition, some pins have specialized functions:
 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of the
ATmega8U2 USB-to-TTL Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value. See
the attach Interrupt() function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the an alog
Write() function.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
 LED: 13. There is a built-in LED connected to digital pin 13. When the pin
is HIGH value, the LED is on, when the pin is LOW, it's off.

The Uno has 6 an alog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the an
alog Reference() function.

Additionally, some pins have specialized functionality:


 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library.

There are a couple of other pins on the board:


 AREF. Reference voltage for the an alog inputs. Used with an alog
Reference().
 Reset. Bring this line LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.
 See also the mapping between Arduino pins and ATmega328 ports. The
mapping for the Atmega8, 168, and 328 is identical.

10
Communication
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and
appears as a virtual com port to software on the computer. The '16U2 firmware uses the
standard USB COM drivers, and no external driver is needed. However, on Windows, a .inf
file is required. The Arduino software includes a serial monitor which allows simple textual
data to be sent to and from the Arduino board. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1). A Software Serial library
allows for serial communication on any of the Uno's digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus; see the documentation for
details. For SPI communication, use the SPI library.

Programming
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Boardmenu (according to the microcontroller on your
board). For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to
upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-
Circuit Serial Programming) header; see these instructions for details. The ATmega16U2
(or 8U2 in the rev1 and rev2 boards) firmware source code is available.

The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be


activated by:
 On Rev1 boards: connecting the solder jumper on the back of the board (near the
map of Italy) and then resetting the 8U2.
 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.

11
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader).

USB Overcurrent Protection


The Arduino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and overcurrent. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500 mA is applied to
the USB port, the fuse will automatically break the connection until the short or overload is
removed.

Physical Characteristics
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively,
with the USB connector and power jack extending beyond the former dimension. Four
screw holes allow the board to be attached to a surface or case. Note that the distance
between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing
of the other pins.

ATMEGA 328 Features:

Features:
 High Performance, Low Power AVR
 8-Bit Microcontroller
 Advanced RISC Architecture
 131 Powerful Instructions – Most Single Clock Cycle Execution
 32 x 8 General Purpose Working Registers
 Fully Static Operation
 Up to 20 MIPS Throughput at 20 MHz
 On-chip 2-cycle Multiplier
 High Endurance Non-volatile Memory Segments
 4/8/16/32K Bytes of In-System Self-Programmable Flash progam memory
 Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
 Data retention: 20 years at 85°C/100 years at 25°C

12
 Optional Boot Code Section with Independent Lock Bits In System Programming
by On-chip Boot Program True Read While-Write Operation
 Programming Lock for Software Security

Peripheral Features:
 Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode
 One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
 Real Time Counter with Separate Oscillator
 Six PWM Channels
 8-channel 10-bit ADC in TQFP and QFN/MLF package
 Temperature Measurement
 -channel 10-bit ADC in PDIP Package
 Programmable Serial USART
 Master/Slave SPI Serial Interface
 Byte-oriented 2-wire Serial Interface
 Programmable Watchdog Timer with Separate On-chip Oscillator
 On-chip Analog Comparator
 Interrupt and Wake-up on Pin Change.

13
AT MEGA328 ARCHITECTURE

Fig 3.1: AT MEGA328

14
ATMEGA328 pin diagram

Fig 3.2 : ATMEGA328 pin diagram

15
Pin Descriptions

o VCC Digital supply voltage.


o GND Ground.

Port B (PB7:0) :

Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port B output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port B pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset
condition becomes active, even if the clock is not running. Depending on the clock selection
fuse settings, PB6 can be used as input to the inverting Oscillator amplifier and input to the
internal clock operating circuit. Depending on the clock selection fuse settings, PB7 can be
used as output from the inverting Oscillator amplifier. If the Internal Calibrated RC
Oscillator is used as chip clock source, PB7.6 is used as TOSC2.1 input for the
Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

Port C (PC5:0):

Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The PC5..0 output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port C pins that are externally pulled low will source
current if the pull-up Resistors are activated. The Port C pins are tri-stated when a reset
condition becomes active, even if the clock is not running.

16
PC6/RESET:

If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the
electrical characteristics of PC6 differ from those of the other pins of Port C.
If the RSTDISBL Fuse is programmed, PC6 is used as a Reset input. A low level on this pin
for longer than the minimum pulse length will generate a Reset, even if the clock is not
running. The minimum pulse length is given in Table 28-3 on page 308. Shorter pulses are
not guaranteed to generate a Reset.

Port D (PD7:0):

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port D output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port D pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset
condition becomes active, even if the clock is not running.

AVCC:

AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It
should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it
should be connected to VCC through a low-pass filter. Note that PC6..4 use digital supply
voltage, VCC.

17
AREF:

AREF is the analog reference pin for the A/D Converter.1.1.9 ADC7:6 (TQFP and
QFN/MLF Package Only)In the TQFP and QFN/MLF package, ADC7:6 serve as analog
inputs to the A/D converter. These pins are powered from the analog supply and serve as
10- bit ADC channels

HC-05
Bluetooth to Serial Port Module
Fig 3.3: Bluetooth
Overview
HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module,
designed for transparent wireless serial connection setup.
Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data
Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It
uses CSR Bluecore 04-External single chip Bluetooth system with CMOS technology
and with AFH(Adaptive Frequency Hopping Feature). It has the footprint as small as
12.7mmx27mm. Hope it will simplifyyour overall design/development cycle.

18
Specifications

Hardware features

 Typical -80dBm sensitivity


 Up to +4dBm RF transmit power
 Low Power 1.8V Operation ,1.8 to 3.6V I/O
 PIO control
 UART interface with programmable baud rate
 With integrated antenna
 With edge connector

Fig 3.4: Hardware

19
20
21
AT command Default:
How to set the mode to server (master):
 Connect PIO11 to high level.
 Power on, module into command state.
 Using baud rate 38400, sent the “AT+ROLE=1\r\n” to module, with
“OK\r\n”means setting successes.
 Connect the PIO11 to low level, repower the module, the module work
as server(master).

AT commands: (all end with \r\n):


1. Test command:
Command Respond Parameter
AT OK -
2. Reset
Command Respond Parameter
AT+RESET OK -

3. Get firmware version


Command Respond Parameter
AT+VERSION? +VERSION:<Param> Param : firmware version
OK
Example:
AT+VERSION?\
r\n
+VERSION:2.0-
20100601
OK

22
4. Restore default
Command Respond Parameter
AT+ORGL OK -
Default state:
Slave mode, pin code :1234, device name: H-C-2010-06-01 ,Baud 38400bits/s.

5. Get module address


Command Respond Parameter
AT+ADDR? +ADDR:<Param> Param: address of Bluetooth
OK module
Bluetooth address: NAP: UAP :
LAPExample:
AT+ADDR?\r\n
+ADDR:1234:56:abc
defOK

6. Set/Check module name:


Command Respond Parameter
AT+NAME=<Param> OK Param: Bluetooth module
AT+NAME? +NAME:<Param> name
OK (/FAIL) (Default :HC-05)
Example:
AT+NAME=HC-05\r\n set the module name to “HC-
05”OK
AT+NAME=ITeadStudio\
r\nOK
AT+NAME?\r\n
+NAME:
ITeadStudioOK

7. Get the Bluetooth device name:


Command Respond Parameter
AT+RNAME?<Param1> 1. Param1,Param 2 : the address
+NAME:<Param of Bluetooth device
2>OK
2. FAIL
Example: (Device address 00:02:72:od:22:24,name:
ITead)AT+RNAME? 0002,72,od2224\r\n
+RNAME:ITe
adOK

23
8. Set/Check module mode:
Command Respond Parameter
AT+ROLE=<Param> OK Param:
AT+ ROLE? +ROLE:<Param> 0- Slave

OK 1- Master
2- Slave-Loop

9. Set/Check device class


Command Respond Parameter
AT+CLASS=<Param> OK Param: Device Class
AT+ CLASS? 1.
+CLASS:<Para
m>OK
2. FAIL

10. Set/Check GIAC (General Inquire Access Code)


Command Respond Parameter
AT+IAC=<Param> 1. OK Param: GIAC
2. FAIL (Default :
AT+IAC +IAC:<Param> 9e8b33)
OK
Example:
AT+IAC=9e8b3f\r
\nOK AT+IAC?\
r\n
+IAC:
9e8b3fOK

24
11. Set/Check -- Query access patterns
Command Respond Parameter
AT+INQM=<Param>,<Param 1.OK Param:
2>,
<Param3> 2. FAIL 0——inquiry_mode_standard
AT+ INQM? +INQM : 1——inquiry_mode_rssi
<Param>,<Param2>,
<Param3> Param2: Maximum number of
OK Bluetooth devices to respond
To
Param3:
Timeout (1-48 : 1.28s to
61.44s)

Example:
AT+INQM=1,9,48\r
\nOK
AT+INQM\r\n
+INQM:1, 9,
48OK
12. Set/Check PIN code:

Command Respond Parameter


AT+PSWD=<Param> OK Param: PIN
AT+ PSWD? + PSWD :<Param> code (Default
OK 1234)

Command Respond Parameter


AT+UART=<Param>, OK Param1: Baud
<Param2>,<Param3>

25
AT+ UART? +UART=<Param>,<Param2>, Param2: Stop
<Param3 bit Param3:
>OK Parity
13. Set/Check serial

parameter: Example:

AT+UART=115200

,1,2,\r\n

AT+UART?

+UART:115200,
1,2O
OK

14. Set/Check connect mode:


Command Respond Parameter
AT+CMODE=<Param> OK Param:
AT+ CMODE? + CMODE:<Param> 0 - connect fixed address
OK 1 - connect any address
2 - slave-Loop

15. Set/Check fixed address:


Command Respond Parameter
AT+BIND=<Param> OK Param: Fixed
AT+ BIND? + BIND:<Param> address(Default
OK 00:00:00:00:00:00)
Example: AT+BIND=1234,56
,abcdef\r\nOK
AT+BIND?\r\n
+BIND:1234:56:abcde
fOK

26
16. Set/Check LED I/O
Command Respond Parameter
AT+POLAR=<Param1>, OK Param1:
<Param2> 0- PIO8 low drive
AT+ POLAR? + POLAR=<Param1>,<Param2> LED 1- PIO8 high
OK drive LED

Param2:
0- PIO9 low drive
LED 1- PIO9 high
drive LED

17. Set PIO output

Command Respond Parameter


AT+PIO=<Param1>, OK Param1: PIO
<Param2> number Param2:
PIO level
0- low
1- high

Example:
1. PIO10 output high
levelAT+PI0=10, 1\r\
n
OK

18. Set/Check – scan parameter


Command Respond Parameter
AT+IPSCAN=<Param1>, OK Param1: Query time
<Param2>, <Param3>, interval
<Param4> Param2:Query duration
AT+IPSCAN? +IPSCAN:<Param1>,<Param2>, Param3:
<Param3>,<Param4>OK
Paging interval
Param4:Call duration
Example:
AT+IPSCAN
=1234,500,1200,250\r\nOK
AT+IPSCAN?
+IPSCAN:1234,500,1200,250

27
19. Set/Check – SHIFF parameter
Command Respond Parameter
AT+SNIFF=<Param1>, OK Param1: Max time
<Param2>,
<Param3>,<Param4> Param2: Min time
AT+ SNIFF? +SNIFF:<Param1>,<Param2>, Param3: Retry time
<Param3> , <Param4>
Param4: Time out
OK

20. Set/Check security mode


Command Respond Parameter
AT+SENM=<Param1>, 1. OK Param1: 0——
<Param2> 2. FAIL sec_mode0+off 1
AT+ SENM? + SENM:<Param1>,<Param2> ——sec_mode1+non_se

OK cure 2——
sec_mode2_service 3——
sec_mode3_link 4——
sec_mode_unknown
Param2: 0——
hci_enc_mode_off 1——
hci_enc_mode_pt_t o_pt 2—
—hci_enc_mode_pt_t
o_pt_and_bcast

28
21. Delete Authenticated Device
Command Respond Parameter
AT+PMSAD=<Param> OK Param:
Authenticated
Devic
eAddress
Example:
AT+PMSAD
=1234,56,abcdef\r\nOK

22. Delete All Authenticated Device


Command Respond Parameter
AT+ RMAAD OK -

23. Search Authenticated Device


Command Respond Parameter
AT+FSAD=<Param> 1. OK Param: Device address
2. FAIL

24. Get Authenticated Device Count


Command Respond Parameter
AT+ADCN? +ADCN:<Param> OK Param: Device Count

25. Most Recently Used Authenticated Device


Command Respond Parameter
AT+MRAD? + MRAD: Param: Recently
<Param>OK Authenticated
Devic
eAddress

26. Get the module working state


Command Respond Parameter

29
AT+ STATE? + STATE: Param:
<Param>OK “INITIALIZED”
“READY”
“PAIRABLE”
“PAIRED”
“INQUIRING”
“CONNECTING

“CONNECTED”
“DISCONNECT
ED”
“NUKNOW”

27. Initialize the SPP profile lib


Command Respond Parameter
AT+INIT 1. OK -
2. FAIL

28. Inquiry Bluetooth Device


Command Respond Parameter
AT+INQ +INQ: <Param1> , <Param2> , Param1:Address
<Param3> Param2:Device Class
… Param3 :
. RSSI
O Signa
K l
strength
Example:
AT+INIT\r
\nOK
AT+IAC=9e8b33\r
\nOK
AT+CLASS=0\r\n
AT+INQM=1,9,48\r
\n At+INQ\r\
n
+INQ:2:72:D2224,3E0104,FFBC
+INQ:1234:56:0,1F1F,FFC1
+INQ:1234:56:0,1F1F,FFC0
+INQ:1234:56:0,1F1F,FFC1
+INQ:2:72:D2224,3F0104,FFAD
+INQ:1234:56:0,1F1F,FFBE
+INQ:1234:56:0,1F1F,FFC2
+INQ:1234:56:0,1F1F,FFBE
+INQ:2:72:D2224,3F0104,F
FBCOK

30
29. Cancel Inquiring Bluetooth Device
Command Respond Parameter
AT+ INQC OK -

30. Equipment Matching

Command Respond Parameter


AT+PAIR=<Param1>,<Param 1. OK Param1:Device Address
2> 2. FAIL Param2:Time out

31. Connect Device

Command Respond Parameter


AT+LINK=<Param> 1. OK Param :Device Address
2. FAIL

Example:
AT+FSAD=1234,56,abcdef\ r\
nOK AT+LINK=1234,56,abcdef\
r\nOK
32. Disconnect

Command Respond Parameter


AT+DISC 1. +DISC:SUCC Param :Device Address
ESSOK
2. +DISC:LINK_L
OSSOK
3. +DISC:NO_S
LCOK
4. +DISC:TIME
OUTOK
5. +DISC:ERROR
OK

33. Energy-saving mode

Command Respond Parameter


AT+ENSNIFF=<Param> OK Param :Device Address

31
34. Exerts Energy-saving mode

Command Respond Parameter


AT+ EXSNIFF =<Param> OK Param :Device Address

Revision History

Rev. Description Release date


v1.0 Initial version 7/18/2010

32
12V DC MOTOR:

A DC motor in simple words is a device that converts direct current (electrical energy)
into mechanical energy. It’s of vital importance for the industry today, and is equally important
for engineers to look into the working principle of DC motor in details that has been discussed
in this article. In order to understand the operating principle of dc motor we need to first look
into its constructional feature.

Fig 3.5: DC Motor

 The very basic construction of a dc motor contains a current carrying armature which is
connected to the supply through commentator segments and brushes and placed within
the north south poles of a permanent or an electro-magnet as shown in the diagram
below.
 Now to go into the details of the operating principle of DC motor it’s important that we
have a clear understanding of Fleming’s left hand rule to determine the direction of force
acting on the armature conductors of dc motor.
 FLEMING left hand role says that if we extend the index finger, middle finger and thumb
of our left hand in such a way that the current carrying conductor
 is placed in a magnetic field (represented by the index finger) is perpendicular to the
direction of current (represented by the middle finger).

33
 Then the conductor experiences a force in the direction (represented by the thumb)
mutually perpendicular to both the direction of field and the current in the conductor.

Fig 3.6: Left Hand Rule

 For clear understanding the principle of DC motor we have to determine the


magnitude of the force, by considering the diagram below.

Fig 3.7: DC Motor

34
Fig 3.8: Graph

12V AH Sealed Lead Acid Battery:


 The 'Online' range of sealed lead acid batteries are maintenance free, valve regulated and
leak proof ideally suited to all 'standby applications'
 There will be no loss in power output over the battery life.
 Low self-discharge of about 2-3% per month compared with 20-30% for more common
battery systems.
 Quality construction with no compromise on materials to ensure a long service life.
 Low internal resistance means a high discharge rate.
 Wide operating temperature range operating between -15° C to +50 ° C when fully charged.

Battery:

Fig 3.9: Battery

35
Applications:
Lighting Equipment
Emergency Lighting
Toys & Consumer Electronics
Fire Alarm & Security Systems

Specification

36
Dimension:

Fig 3.10: Dimension

Discharge Characteristics:

Fig 3.11: Discharge Characteristics


Note: Discharge shall be cut-off at 10.5V if discharge at <1CA and at 9.6V if at ≥1CA It is
recommended to recharge battery by constant-voltage charge immediately after use.

37
L293 Motor Driver and H-Bridges
W. Durfee

The most common method to drive DC motors in two directions under control of a computer is
with an H-bridge motor driver. H-bridges can be built from scratch with bi-polar junction
transistors (BJT) or with field effect transistors (FET), or can be purchased as an integrated unit
in a single integrated circuit package such as the L293. The L293 is simplest and inexpensive for
low current motors, For high current motors, it is less expensive to build your own H-bridge
from scratch.

ITP Physical Computing has a terrific tutorial on using an Arduino and an L293 to control a bi-
directional motor.

The Twin Cities Robotics Club has an *excellent* tutorial on H-bridges, and complete detail on
how to build your own $5.00 H-bridge good for several amps. From the same source is a detailed
tech note on PWM speed control of a motor using an H-bridge and a PIC microcontroller

The L293 is an integrated circuit motor driver that can be used for simultaneous, bi-directional
control of two small motors. Small means small. The L293 is limited to 600 mA, but in reality
can only handle much small currents unless you have done some serious heat sinking to keep the
case temperature down. Unsure about whether the L293 will work with your motor? Hook up the
circuit and run your motor while keeping your finger on the chip. If it gets too hot to touch, you
can't use it with your motor. (Note to ME2011 students: The L293 should be OK for your small
motor but is not OK for your gear motor.)

The L293 comes in a standard 16-pin, dual-in line integrated circuit package. There is an L293
and an L293D part number. Pick the "D" version because it has built in flyback diodes to
minimize inductive voltage spikes. The L293D can be purchased for somewhere between $2 and
$3 (quantity one) from www.mouser.com (PN 511-L293D) or www.digikey.com (PN 296-9518-
5-ND). For complete information, consult the Unitrode L293 data sheet (PDF file, 626Kb).

A more recent, improved specification, pin-for-pin compatible chip is recommended for new
designs: the TI SN754410NE motor driver. Available from mouser.com, Mouser part number
595- SN754410NE, $1.88. Data sheet (PDF file, 172Kb).

The pinout for the L293 in the 16-pin package is shown below in top view. Pin 1 is at the top left
when the notch in the package faces up. Note that the names for pin functions may be slightly
different than what is shown in the following diagrams.

38
Fig 3.12: Connection Diagram

The following schematic shows how to connect the L293 to your motor and the Arduino. Each
motor takes 3 Arduino pins. (See notes below for a two Arduino pin solution.) If you are only
using one motor, leave L293 pins 9, 10, 11, 12, 13, 14, and 15 empty.

39
Fig 3.13: Circuit diagram

you have only one motor connected with the enable tied to Arduino Pin 3, and the two direction
controls tied to Arduino Pins 4 and 5.

40
Here is a table describing the control pin functions:

ENABLE DIRA DIRB Function


H H L Turn right
H L H Turn left
H L/H L/H Fast stop
L either either Slow stop

The L293D is a 16 pin IC, with eight pins, on each side, dedicated to the
controlling of a motor. There are 2 INPUT pins, 2 OUTPUT pins and 1 ENABLE
pin for each motor. L293D consist of two H-bridge. H-bridge is the simplest circuit
for controlling a low current rated motor.

Pin No. - Pin Characteristics:

 1 - Enable 1-2, when this is HIGH the left part of the IC will work and when
it is low the left part won’t work.
 2 - INPUT 1, when this pin is HIGH the current will flow though output 1
 3 - OUTPUT 1, this pin should be connected to one of the terminal of motor
 4,5 - GND, ground pins
 6 - OUTPUT 2, this pin should be connected to one of the terminal of motor
 7 - INPUT 2, when this pin is HIGH the current will flow though output 2
 8 - VCC2, this is the voltage which will be supplied to the motor.
 16 - VCC1, this is the power source to the IC. So, this pin should be
supplied with 5 V
 15 - INPUT 4, when this pin is HIGH the current will flow though output 4
 14 - OUTPUT 4, this pin should be connected to one of the terminal of motor
 13,12 - GND, ground pins
 11 - OUTPUT 3, this pin should be connected to one of the terminal of motor
 10 - INPUT 3, when this pin is HIGH the current will flow though output 3
 9 - Enable 3-4, when this is HIGH the right part of the IC will work and
when it is low the right part won’t work.

41
Why 4 grounds in the IC?

The motor driver IC deals with heavy currents. Due to so much current flow the IC
gets heated. So, we need a heat sink to reduce the heating. Therefore, there are 4
ground pins. When we solder the pins on PCB, we get a huge metalllic area
between the grounds where the heat can be released.

Why Capacitors?

The DC motor is an inductive load. So, it develops a back EMF when supplied by a
voltage. There can be fluctuations of voltage while using the motor say when
suddenly we take a reverse while the motor was moving in some direction. At this
point the fluctuation in voltage is quite high and this can damage the IC. Thus, we
use four capacitors that help to dampen the extreme variation in current.

Now depending upon the values of the Input and Enable the motors will rotate in
either clockwise or anticlockwise direction with full speed (when Enable is HIGH)
or with less speed (when Enable is provided with PWM).Let us assume for Left
Motor when Enable is HIGH and Input 1 and Input 2 are HIGH and LOW
respectively then the motor will move in clockwise direction.

42
Features:
 H-Bridge Motor Driver
o Drives One DC Motor, One Winding of a Stepper Motor, or Solenoid Loads
 4.5-V to 38-V Operating Voltage Range
 10-A Peak Current Drive
 Low HS + LS RDS(ON)
o 150 mΩ at TJ = 25°C, 13.5 V
o 250 mΩ at TJ = 150°C, 13.5 V
 Current Mirror for Output Current Sensing
 Configurable Control Interface
o PH/EN
o PWM (IN1/IN2)
o Independent Half-Bridge Control
 Supports 1.8-V, 3.3-V, 5-V Logic Inputs
 SPI or Hardware Interface Options
 Low-Power Sleep Mode (10 µA)
 Small Package and Footprint
o 24 HTSSOP PowerPAD™ IC Package
 Protection Features
o VM Undervoltage Lockout (UVLO)
o Charge Pump Undervoltage (CPUV)
o Overcurrent Protection (OCP)
o Output short to battery and short to ground protection
o Open Load Detection
o Thermal Shutdown (TSD)
o Fault Condition Output (nFAULT / SPI)

L293D has a lot of applications including:


 DC motor drivers.
 Relay drivers.
 Stepper motor drivers.
 Two phase motor driver, block diagram of L 293D application for two phase motor is
given in the figure shown below.

43
Fig 3.14: L293D Two Phase Motor Drive

44
CHAPTER-4

PROJECT
Bluetooth based Smart Phone Controlled Robot Car using Arduino

Bluetooth controlled robot car using Arduino which is very simple and perfectly compatible with
students, hobbyists, and beginners in embedded Technology. By adding more technology, these are a type
of futuristic robots that will be used for different purposes in different sectors like firefighting bots
surveillance robots, etc. In this project, we will make a wirelessly Bluetooth controlled robot car using
Ardumo as the microcontroller. It will be an exciting project which is a combination of wireless
communication, robotics, and electronics. We can able to control the robot using our smartphone, only we
have to just install an App available on Playstore We are integrating a Bluetooth module for seamless
wireless communication between the robot car and Bluetooth-enabled devices.

Connect the Bluetooth HC-05 module to Arduino and check for the data received on the serial monitor of
the IDE. In my case, the Txd and Rxd of HC-05 are connected to 11 and 10 digital pins respectively. And
BT module gets power from Arduino by connecting power pins to respective Arduino power pins. The
Arduino gets power from the L298N board from the 5v output terminal and Ground.
The connections are given as following circuit diagram:

Fig 4.1 Circuit Diagram

45
Arduino Code:

int mlin1-2;
int mlin2-3;
int m2in1-5;
int m2in2=6;
int store;
void setup() { // Pinconnections
pinMode(mlin1,OUTPUT);
pinMode(mlin2,OUTPUT);
pinMode(m2in1,OUTPUT);
pinMode(m2in2,OUTPUT);
Serial.begin(9600)
void loop()
{
if(Serial.available()) {
store=Serial.read();
if(store=='1') { // FORWARD
Serial.print("Forward");
digitalWrite(mlin1,HIGH);
digitalWrite(mlin2, LOW);
digitalWrite(m2in1,HIGH);
digitalWrite(m2in2, LOW);
}
if(store=='2'){//Backward
Serial.print("Backward");
digitalWrite(mlin1,LOW);
digitalWrite(mlin2,HIGH);
digitalWrite(m2in1,LOW);

46
digitalWrite(m2in2,HIGH);
if(store '3') { // Right
digitalWrite(mlin1,HIGH);
digitalWrite(mlin2, LOW);
digitalWrite(m2in1,LOW);
digitalWrite(m2in2,HIGH);
Serial.print("RIGHT");
if(store=='4'){ // Left
digitalWrite(mlin 1,LOW);
digitalWrite(m1 in2,HIGH);
digitalWrite(m2in1,HIGH);
digitalWrite(m2in2,LOW);
Serial.print("LEFT");
}
if(store= '0') { // Stop
Serial.print("stop");
digitalWrite(mlinl,LOW);
digitalWrite(mlin2, LOW);
digitalWrite(m2in1,LOW);
digitalWrite(m2in2,LOW);
}}}

47
PICTURES

Fig 4.1: Top View of Robot

Fig 4.2: Side View of Robot

48
RESULT:

ENABLE DIRA DIRB Function


H H L Turn right
H L H Turn left
H L/H L/H Fast stop
L either either Slow stop

CONCLUSIONS:
51
From this training I have learned about, how the robotics and Embedded Systems
& IoT Systems are working in our day today life. By the Arduino we are controlling our home
application. Now a days we are doing smart work than hard work for this we need to know this
kind of things in our life.

The trainers have helped us to make a small robot that was controlled by the voice
command, by the voice command controlling app in smart phone we have controlled a small
ROBOT, that was prepared by our team members. We of our own we have written the Arduin
code and we have don in software and we moved to the hardware that was tools provided by the
train

51

You might also like