Beruflich Dokumente
Kultur Dokumente
The purpose of this project is to design and construct a Robot that follows Joystick direction with t
help of Zigbee module and calculating the speed of the Robot. This project consists of a Zigbee bas
remote control system, the Zigbee transmitter transmits the wireless signals according to the joysti
shield button being pressed on the remote Microcontroller and Zigbee based keypad. In the Rob
chassis, Zigbee receiver that is connected to the DC motors to be controlled and receives the
commands. The received commands are sent to the microcontroller for validation and processing. T
Atmega328 microcontroller processes data and controls robot movements through L293d motor driv
circuit. The dc motors are interfaced with the L293d circuit. If the commands received are valid th
the microcontroller takes necessary action of controlling the motors. In this project, we are measuri
the speed of the Robot by using an LED is placed near to the DC motor which detects the number
rotations of the wheel from that rpm it calculates the speed and it shows on the display.
1.3 Applications and Advantages:
Maximum output can be obtained.
Efficient and low cost design.
Zigbee based wireless Robot measuring speed works on IR Proximity sensor.
Applications:
This Robot can be used in the military purposes.
This system can be used mainly in industries, home appliances.
ZIGBEE
Joystick Shield TRANSMITTER
ATMEGA328
MCU
REGULATED
POWER SUPPLY
Receiver:
ZIGBEE
RECEIVER
L293D Motor
Driver Gear DC
Motors
ATMEGA328
MCU
Zigbee technology is a wireless sensor network system which ensures remote monitoring a
controlling of load parameters. Some of the characteristics like low cost, low power, low data rate, ea
installation, low maintenance, multiple topologies, etc., make this communication more suitable for a wi
variety of applications compared to other short-range communication technologies.
CHAPTER 2
LITERARY SURVEY
CHAPTER 3
METHODOLOGY
3.1 INTRODUCTION:
In this chapter the block diagram of the project and design aspect of independent modu
are considered. Block diagram is shown in fig: 3.1:
Block Diagram:
Transmitter:
ZIGBEE
Joystick Shield TRANSMITTER
ATMEGA328
MCU
REGULATED
POWER SUPPLY
Receiver:
ZIGBEE
RECEIVER
L293D Motor
Driver Gear DC
Motors
ATMEGA328
MCU
PROJECT OVERVIEW:
An embedded system is a combination of software and hardware to perform a dedicated task. Som
of the main devices used in embedded products are Microprocessors and Microcontrollers.
Microprocessors are commonly referred to as general purpose processors as they simply accept t
inputs, process it and give the output. In contrast, a microcontroller not only accepts the data as inputs b
also manipulates it, interfaces the data with various devices, controls the data and thus finally gives t
result.
The “Zigbee based wireless Robot measuring Speed” using microcontroller Atmega328 is
exclusive project which is used to process the data and controls the motors. In this microcontroller AD
channels are built, it converts analog signal to digital form.
Circuit Diagram:
LCD?
LM016L
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
ARD1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
VCC
AREF
13
PB5/SCK
12
PB4/MISO U1
RESET 11 16 8
~PB3/MOSI/OC2A
10
~ PB2/SS/OC1B
9 2 3
~ PB1/OC1A IN1 VSS VS OUT1
8 7 6
PB0/ICP1/CLKO IN2 OUT2
1
ATMEGA328P-PU
1121
DIGITAL (~PWM)
EN1
7
ANALOG IN
PD7/AIN1
6
A0 ~ PD6/AIN0
PC0/ADC0 5 9
A1 ~ PD5/T1 EN2
PC1/ADC1 4 10 11
A2 PD4/T0/XCK IN3 OUT3
PC2/ADC2 3 15 14
A3 ~ PD3/INT1 IN4 GND GND OUT4
PC3/ADC3 2
A4 PD2/INT0
PC4/ADC4/SDA 1
A5 TX PD1/TXD
PC5/ADC5/SCL 0 L293D
RX PD0/RXD
ARDUINO UNO R3
RXD
TXD
RTS
CTS
Fig 5. Schematic diagram for the Zigbee based wireless Robot (receiver)
CHAPTER 4
SOFTWARE DESCRIPTION
ARDUINO SOFTWARE:
The Arduino IDE is a cross-platform application written in Java, and is derived from the IDE for t
Processing programming language and the Wiring project. It is designed to introduce programming to arti
and other newcomers unfamiliar with software development. It includes a code editor with features such
syntax highlighting, brace matching, and automatic indentation, and is also capable of compiling a
uploading programs to the board with a single click. There is typically no need to edit make files or r
programs on a command-line interface. Although building on command-line is possible if required w
some third-party tools such as Ino.
The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same nam
which makes many common input/output operations much easier. Arduino programs are written in C/C+
although users only need define two functions to make a run able program:
• setup() – a function run once at the start of a program that can initialize settings
• loop() – a function called repeatedly until the board powers off
It is a feature of most Arduino boards that they have an LED and load resistor connected between pin
and ground, a convenient feature for many simple tests. The above code would not be seen by a standa
C++ compiler as a valid program, so when the user clicks the "Upload to I/O board" button in the IDE
copy of the code is written to a temporary file with an extra include header at the top and a very simp
main() functionat the bottom, to make it a valid C++ program. The Arduino IDE uses the GNU tool cha
and AVR Libc to compile programs, and uses avr to upload programs to the board. As the Arduino platfo
uses Atmel microcontrollers
Atmel’s development environment, AVR Studioor the newer Atmel Studio, may also be used to devel
software for the Arduino. The Arduino hardware reference designs are distributed under a Creati
Commons Attribution Share-Alike 2.5 license and are available on the Arduino Web site. Layout a
production files for some versions of the Arduino hardware are also available. The source code for the ID
and the on-board library are available and released under the GPLv2 license. Arduino and Arduin
compatible boards uses of shields, which are printed circuit boards that sit atop an Arduino, and plug in
the normally supplied pin-headers. These are expansions to the base Arduino.
This project is implemented using following software’s:
1. Arduino IDE.
Arduino is an open-source project, enabling hobbyists to easily take advantage of the powerful Atme
chips. The Arduino IDE is the software where you can write code and upload it to the Atmega chip. T
Most 3D-printer electronics are Arduino-compatible, they use the Atmega chip and enable the user to uplo
their code using Arduino. This includes Megatronics, Minitronics and RAMPS.
Before you can start using the electronics you need software 'firmware', that translates machine instructio
(gcode) into actual movements. There are a few options here, including Marlin and Sprinter and Repeti
The actual firmware is not discussed in this document. You can use Arduino to upload this firmware on
your electronics. This document will guide you in the steps you need to take.
Fig 4.1 Dialogue box for Arduino IDE4.2 PROCEDURAL STEPS
You can download and install the Arduino version from http://arduino.cc/. This ensures you have
the latest version. Instead, you may choose to download the Arduino version we provide on
Megatronics/Minitronics.
Extract the files file into a location of your choice. On Windows you may need to install drivers
for the electronics board before you can upload software. The installation files are located under
the /drivers subdir. Linux and Mac should recognize the boards out-of-the-box.
2. Uploading Filmware:
To upload a firmware, you must first open the files using File → Open. Select the into file from
the directory containing the firmware. Arduino will open several tabs with files.
Next step is to select the correct electronics board. From the Tools menu, locate the Board item.
This item should include a few sub items, including Megatronics, Minitronics, Arduino mega 2560
(RAMPS with mega 2560) and Arduino Mega 1280 (RAMPS with mega1280).
Also we need to select the serial port the electronics is connected to. In the Tools menu, locate the
Serial port item. This should include at least one item if the board is connected and the drivers are
installed properly. If there are multiple items here, you need to find out which is the correct one
Once you have set the board and serial port, you can upload the firmware by pressing File →
Upload. Arduino will try to compile the firmware, if any errors occur the process will stop and you
will need to fix the errors before trying again. Once compilation is complete, the actual upload will
You can actually 'talk' to the firmware using the Serial monitor. Make sure the correct serial port is
Make sure the line ending is set to newline and the baud rate corresponds to your firmware (115200
mostly), or you will get jibberish. You can enter a command in the upper box (M105 for example), this will
Joystick Shield is directly fixed in transmitter side Arduino Board. The above schematic diagram is
for Robot Receiver. In this LCD is interfaced with Arduino UNO in 4-bit mode. LCD Data Lines are connected
to Pins 7,8,9,10. LCD Control Lines RS,R/W,EN are connected to Pin12,GND,Pin11 of microcontroller. The
L293D has six control signals. Those are En1,En2, In1,In2,In3,In4. Enable Pins are initially given to VCC and
rest of four control signals are given through microcontroller Atmega328. In1, In2,In3,In4 of L293d are
connected to Pin 3,4,5,6. Zigbee Module’s Tx Pin is connected to Rx Pin of the microcontroller. Zigbee
Module at receiver receives serial data and it is given to microcontroller which compares to perform
required operation for the movement of the robot.
We are using 12V DC rechargeable battery and 7805 Regulator to give regulated +5V for
operations of electronic components. The motors are given +12V supply using 7812 Regulator IC.
CHAPTER 5
RESULT
CONCLUSION
Integrating features of all the hardware components used have been developed in it. Presence
of every module has been reasoned out and placed carefully, thus contributing to the best working
of the unit. Secondly, using highly advanced IC’s with the help of growing technology, the project
has been successfully implemented. Thus the project has been successfully designed and tested.
FUTURE SCOPE
1. www.allaboutcircuits.com
2. www.microchip.com
3. www.ti.com/zstack
Books referred:
] F. Zhou, G. Tian, Y. Xue, et al., “Robot Wards Inspection System Based on Multi-Pattern
Information Acquisition in Intelligent Space,” Journal of Computational Information Systems,
Vol. 7, No. 11, 2011.
B. Song, G. Tian and G. Li, “Implementation of ZigBee Based Wireless Sensor and Actuator
Network in Intelligent Space,” Proceedings of International Conference on Computers,
Communications, Control and Automation, Hong Kong, 2011.
APPENDIX [A]:
INTRODUCTION OF EMBEDDED SYSTEMS:
An embedded system is a computer system designed to perform one or a few dedicated functions
often with real-time computing constraints. It is embedded as part of a complete device often including
hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal computer (PC),
is designed to be flexible and to meet a wide range of end-user needs. Embedded systems control many
devices in common use today.
Embedded systems are controlled by one or more main processing cores that are typically either
microcontrollers or digital signal processors (DSP). The key characteristic, however, is being dedicated to
handle a particular task, which may require very powerful processors. For example, air traffic control
systems may usefully be viewed as embedded, even though they involve mainframe computers and
dedicated regional and national networks between airports and radar sites. (Each Radar probably includes
one or more embedded systems of its own.)
Since the embedded system is dedicated to specific tasks, design engineers can optimize it to reduce
the size and cost of the product and increase the reliability and performance. Some embedded systems are
mass-produced, benefiting from economies of scale.
Physically embedded systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, or the systems controlling
nuclear power plants. Complexity varies from low, with a single microcontroller chip, to very high with
multiple units, peripherals and networks mounted inside a large chassis or enclosure.
In general, "embedded system" is not a strictly definable term, as most systems have some element
of extensibility or programmability. For example, handheld computers share some elements with embedded
systems such as the operating systems and microprocessors which power them, but they allow different
applications to be loaded and peripherals to be connected. Moreover, even systems which don't expose
programmability as a primary feature generally need to support software updates. On a continuum from
"general purpose" to "embedded", large application systems will have subcomponents at most points even
if the system as a whole is "designed to perform one or a few dedicated functions", and is thus appropriate
to call "embedded". A modern example of embedded system is shown in fig: 2.1.
Fig 2.1:A modern example of embedded system
Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded systems
programming is not like normal PC programming. In many ways, programming for an embedded system is
like programming PC 15 years ago. The hardware for the system is usually chosen to make the device as
cheap as possible. Spending an extra dollar a unit in order to make things easier to program can cost
millions. Hiring a programmer for an extra month is cheap in comparison. This means the programmer
must make do with slow processors and low memory, while at the same time battling a need for efficiency
not seen in most PC applications. Below is a list of issues specific to the embedded field.
2.1.1 Tools:
Embedded development makes up a small fraction of total programming. There's also a large
number of embedded architectures, unlike the PC world where 1 instruction set rules, and the Unix world
where there's only 3 or 4 major ones. This means that the tools are more expensive. It also means that they're
lowering featured, and less developed. On a major embedded project, at some point you will almost always
find a compiler bug of some sort.
Debugging tools are another issue. Since you can't always run general programs on your embedded
processor, you can't always run a debugger on it. This makes fixing your program difficult. Special
hardware such as JTAG ports can overcome this issue in part. However, if you stop on a breakpoint when
your system is controlling real world hardware (such as a motor), permanent equipment damage can occur.
As a result, people doing embedded programming quickly become masters at using serial IO channels and
error message style debugging.
Resources:
To save costs, embedded systems frequently have the cheapest processors that can do the job. This
means your programs need to be written as efficiently as possible. When dealing with large data sets, issues
like memory cache misses that never matter in PC programming can hurt you. Luckily, this won't happen
too often- use reasonably efficient algorithms to start, and optimize only when necessary. Of course, normal
profilers won't work well, due to the same reason debuggers don't work well.
Memory is also an issue. For the same cost savings reasons, embedded systems usually have the
least memory they can get away with. That means their algorithms must be memory efficient (unlike in PC
programs, you will frequently sacrifice processor time for memory, rather than the reverse). It also means
you can't afford to leak memory. Embedded applications generally use deterministic memory techniques
and avoid the default "new" and "malloc" functions, so that leaks can be found and eliminated more easily.
Other resources programmers expect may not even exist. For example, most embedded processors do not
have hardware FPUs (Floating-Point Processing Unit). These resources either need to be emulated in
software, or avoided altogether.
Real Time Issues:
Embedded systems frequently control hardware, and must be able to respond to them in real time.
Failure to do so could cause inaccuracy in measurements, or even damage hardware such as motors. This
is made even more difficult by the lack of resources available. Almost all embedded systems need to be
able to prioritize some tasks over others, and to be able to put off/skip low priority tasks such as UI in favor
of high priority tasks like hardware control.
Because an embedded system is often composed of a wide variety of elements, the debugging strategy
may vary. For instance, debugging a software(and microprocessor) centric embedded system is different
from debugging an embedded system where most of the processing is performed by peripherals (DSP,
FPGA, co-processor). An increasing number of embedded systems today use more than one single
processor core. A common problem with multi-core development is the proper synchronization of software
execution. In such a case, the embedded system design may wish to check the data traffic on the busses
between the processor cores, which requires very low-level debugging, at signal/bus level, with a logic
analyzer, for instance.
Reliability:
Embedded systems often reside in machines that are expected to run continuously for years without
errors and in some cases recover by themselves if an error occurs. Therefore the software is usually
developed and tested more carefully than that for personal computers, and unreliable mechanical moving
parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
The system cannot safely be shut down for repair, or it is too inaccessible to repair. Examples include space
systems, undersea cables, navigational beacons, bore-hole systems, and automobiles.
The system must be kept running for safety reasons. "Limp modes" are less tolerable. Often backups are
selected by an operator. Examples include aircraft navigation, reactor control systems, safety-critical
chemical factory controls, train signals, engines on single-engine aircraft.
The system will lose large amounts of money when shut down: Telephone switches, factory controls, bridge
and elevator controls, funds transfer and market making, automated sales and service.
A variety of techniques are used, sometimes in combination, to recover from errors—both software
bugs such as memory leaks, and also soft errors in the hardware:
Watchdog timer that resets the computer unless the software periodically notifies the watchdog
Subsystems with redundant spares that can be switched over to
software "limp modes" that provide partial function
Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly secure &
reliable system environment
An Embedded Hyper visor is able to provide secure encapsulation for any subsystem component,
so that a compromised software component cannot interfere with other subsystems, or privileged-
level system software. This encapsulation keeps faults from propagating from one subsystem to
another, improving reliability. This may also allow a subsystem to be automatically shut down and
restarted on fault detection.
Immunity Aware Programming
APPENDIX
• 6 Analog Inputs
• Max Voltage: 5V
• Arduino can be powered using power jack, USB port. Apart from this it can also be powered by using a
external battery or AC to DC adaptor through pin Vin.
• 5V, 3.3V: there is a inbuilt regulator on the board. Through this regulator a constant DC supply of 5V,
3.3V is provided.
• There are 6 pins A0 – A5 through which analog input can be given to the arduino board.
• There are 14 digital pins 0-13. Among these (3,5,6,9,10,11) are PWM pins(pulse width modulation)
from which analog output can be taken from the arduino board.
• ICSP- (In circuit serial programming)- These pins enable the user to programme the chips on the circuit.
3.3.1 Analog joystick has two variable resistor for two axis. Each variable resistor has three
pins, two extreme pins are connected to Vcc(5v in our case) and ground. The center pin is the
output pin. The output voltage is between Vcc and GND depending on the position of stick. By
measuring the voltage output of two variable resister from which the joystick is built, we can
determine the position of stick in x and y axis.
Fig3.3.1 Structure of Joystick shield keypad
As you can see in the schematic below, full deflection of a potentiometer in either direction
will provide ground or the supply voltage as an output. The analog inputs provided indications that
range between 0 and 1023. It is because adc resolution is 10-bit .
By knowing x and y axis data , we can know the exact joystick position. As per our application, we
have here considered front, back, left, right position of joystick which corresponds to different speed values
for induction motor speed.
3.4 ZIGBEE MODULE
ZigBee is the name of a specification for a suite of high level communication protocols using small,
low-power, low data rate digital radios based on the IEEE 802.15.4 standard for wireless personal area
networks (WPANs), such as wireless headphones connecting with cell phones via short-range radio. The
technology is intended to be simpler and cheaper than other WPANs, such as Bluetooth. ZigBee is targeted
at radio-frequency (RF) applications which require a low data rate, long battery life, and secure networking.
The standard supports 2.4 GHz (worldwide), 868 MHz (Europe) and 915 MHz (Americas) unlicensed radio
bands with range up to 100 meters. It is operating in an unlicensed, international frequency band. Potential
applications are sensors, interactive toys, smart badges, remote controls, and home automation.
Zigbee Module has important four pins . Those are Vcc ,GND, Tx, Rx. We can directly
interface Rx and Tx pins with any microcontroller using TTL logic.
Fig3.4 Zigbee module connected to Arduino
3.5 L293D MOTOR DRIVER
The L293D is a quadruple half H-bridge bidirectional motor driver IC that can drive current of up
to 600mA with voltage range of 4.5 to 36 volts. It is suitable to drive small DC-Geared motors, bipolar
stepper motor etc.
3.5.1 Specifications:
Supply Voltage Range 4.5V to 36V
Thermal Shutdown
High-Noise-Immunity Inputs
As it can be seen in circuit diagram that there are two enable pins viz. en1 & en2 for two
different DC motors enable operation. There are four different control signals to be given to pins
A, B, C, D . The DC motors M1 & M2 are to be connected between pins 3 & 6 and 11 & 14 pins
respectively. We can interface en1, en2, A, B, C, D pins with microcontroller which performs
necessary actions in order to move robot in proper desired direction.There are two separate power
supply 5V and 12V for the IC and DC motors respectively.
3.6 DC MOTOR
We are here using 12V gear DC motor having 1oo RM speed. A dc motor uses electrical
energy to produce mechanical energy, very typically through the interaction of magnetic
fields and current-carrying conductors. The reverse process, producing electrical energy from
mechanical energy, is accomplished by an alternator, generator or dynamo. Many types of electric
motors can be run as generators, and vice versa. The input of a DC motor is current/voltage and
its output is torque (speed).
Fig3.6 DC Motor
The DC motor has two basic parts: the rotating part that is called the armature and the
stationary part that includes coils of wire called the field coils. The stationary part is also called
the stator. Figure shows a picture of a typical DC motor, Figure shows a picture of a DC armature,
and Fig shows a picture of a typical stator. From the picture you can see the armature is made of
coils of wire wrapped around the core, and the core has an extended shaft that rotates on bearings.
You should also notice that the ends of each coil of wire on the armature are terminated at one end
of the armature. The termination points are called the commutator, and this is where the brushes
make electrical contact to bring electrical current from the stationary part to the rotating part of the
machine.
3.7 ROBOT CHASSIS
A Chassis consists of an internal framework that supports a man-made object in its construction
and use. It is an analogous to an animal’s skeleton. An example of a Chassis is the under part of a motor
vehicle, consisting of the frame (on which the body is mounted). Here metallic chassis is used for the Robot.
A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or
monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column of
liquid crystal molecules suspended between two transparent electrodes, and two polarizing filters, the
axes of polarity of which are perpendicular to each other. Without the liquid crystals between them,
light passing through one would be blocked by the other. The liquid crystal twists the polarization of
light entering one filter to allow it to pass through the other.
For an 8-bit data bus, the display requires a +5V supply plus 11 I/O lines. For a 4-bit data bus it
only requires the supply lines plus seven extra lines. When the LCD display is not enabled, data lines are
tri-state and they do not interfere with the operation of the microcontroller. For Arduino We are using 4-
bit interface. It means we are using only four data lines with digital i/o lines of the microcontroller.
The LCD also requires three control lines from the microcontroller:
1) Enable (E)
2) Read/Write (R/W)
3) Register Select (RS)
Fig 3.9.1 Pin Diagram of 16x2 LCD