Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
Table of contents
I. Abstract Page 3
II. Introduction Page 3
I. Abstract
2
In this technical report we will be providing a detailed overview of
our Embedded Systems course project 2017/2018. Our Project’s name
is: Arm robot controlled by Bluetooth. Details of Hardware and
Software involved in this project will be shown in order to provide the
functionality and overview of our project.
II. Introduction
Our aim in this project is to apply what we studied in books on reality.
In our project we involved a Robot arm on a robot car whose motion
is controlled by Bluetooth using Android mobile application. This
project aims to apply Artificial Intelligence concepts that help to make
people’s life easier. Our project can be modified and evolved to
become a robot that can help disabled people in daily life tasks. In
order to have our project implemented, Software and hardware were
interfaced using the concepts we learnt in our Embedded Systems
course.
III. Design
Hardware Details:
a- Components
Pic 16F877a
Servo Motor MG 995
DC motor
Robot Arm
H-bridge
Battery
Robot car
Bluetooh HC06 Module
3
Breadboard
b- Block Diagram:
In this Block Diagram, we provide a general overview of our project’s
interface. It starts with the mobile command that is transmitted by
Bluetooth to the pic, off to the DC motors which drive the Robot Car
or the servo motors which drive the Robot arm.
4
c- Detailed component description:
- PIC 16F877a
CMOS Flash based 8-bit microcontroller from Microchip's powerful PIC®
architecture.
Pin configuration:
We have set the direction of Port B and Port D as output since our project
didn’t involve any inputs.
Pin 1 MCLR: We have connected this pin to the 5v supply from the H-
bridge to avoid any resets.
Pin 11 VDD: We have connected this pin to the 5v supply from the H-
bridge.
Pin 12 VSS: We have connected this pin to the common ground of the
circuit.
Pin 13/14 osc1/osc2: We have connected these pins to a Crystal oscillator
which has a frequency of 8 Khz. This oscillator stabilizes the PIC operation
and internal frequency.
Pin 24 Tx: We have connected this pin to the Bluetooth HC06 Module
Receiver.
Pin 25 Rx: We have connected this pin to to the Bluetooth HC06 Module
Transmitter.
Pin 29 RD6: We have connected this pin to the signal wire of the clamp
stepper motor.
Pin 30 RD7: We have connected this pin to the signal wire of the y-axis
stepper motor.
Pin 33 RB0: We have connected this pin to IN2 from H-bridge #1 for car
backside right wheel.
Pin 34 RB1: We have connected this pin to IN1 from H-bridge #1 for car
backside right wheel.
Pin 35 RB2: We have connected this pin to IN3 from H-bridge #1 for car
backside left wheel.
Pin 36 RB3: We have connected this pin to IN4 from H-bridge #1 for car
backside left wheel.
5
Pin 37 RB4: We have connected this pin to IN1 from H-bridge #2 for car
Front side right wheel.
Pin 38 RB5: We have connected this pin to IN2 from H-bridge #2 for car
Front side right wheel.
Pin 39 RB6: We have connected this pin to IN3 from the H-Bridge # 2 for
car Front side left wheel.
Pin 40 RB7: We have connected this pin to IN4 from the H-Bridge # 2 for
car Front side left wheel.
High-speed standard servo that can rotate approximately 120 degrees (60 in
each direction). In our project we have used two stepper motors. One that
was used for y-axis motion and one for the clamp open, close motion. The
servo motor input consists of three wires. One for signal from PIC, one that
is grounded to the common ground of the circuit and one that is supplied by
5v. The Frequency of the servo motor is 50 Hz with a period of 20 ms
which we provided the delays upon it.
a- Signal Input: We have connected this Motor input wire to Port D (RD6)
and provided the signal from the PIC.
b- Ground Wire: We have connected this Motor input wire to the common
ground of our circuit.
c- Supply Wire: We have connected this Motor input wire to the Voltage
supply (5v) of our circuit.
6
a- Signal Input: We have connected this Motor input wire to Port D
(RD7) and provided the signal from the PIC.
b- Ground Wire: We have connected this Motor input wire to the
common ground of our circuit.
c- Supply Wire: We have connected this Motor input wire to the
Voltage supply (5v) of our circuit.
- H-bridge
7
H-bridge #2 (Front side of car):
a- IN 1: We have connected IN1 from H-bridge #2 for car Front side right
wheel to RB4 in PIC.
b- IN 2: We have connected IN2 from H-bridge #2 for car Front side right
wheel to RB5 in PIC.
c- OUT 1: We have connected OUT 1 to DC motor for Front side of car
right wheel.
d- OUT 2: We have connected OUT 2 to DC motor for Front side of car
right wheel.
e- IN 3: We have connected IN3 from H-bridge #2 for car Front side left
wheel to RB6 in PIC.
f- IN 4: We have connected IN2 from H-bridge #2 for car Front side left
wheel to RB7 in PIC.
g- OUT 3: We have connected OUT 3 to DC motor for Front side of car
left wheel.
h- OUT 4: We have connected OUT 4 to DC motor for Front side of car
left wheel.
i- VSS: We have connected the supply to H-bridge to 8v voltage supply.
j- Vs: We have connected this 5V volts supply to VDD of PIC and to VDD
of Bluetooth module HC06.
k- Ground: We have connected the ground of H-bridge to common ground
of circuit.
- DC geared motor
8
A DC motor is any of a class of rotary electrical machines that converts direct
current electrical energy into mechanical energy.
Connections:
-Pin Tx : This pin is connected to Rx of PIC.
-Pin Rx: This pin is connected to Tx of PIC.
-Pin ground: This pin is connected to common ground of circuit.
-Pin VCC: This pin is connected to the 5v supply of H-bridge.
- Arm Robot
9
We used an Arm Robot that is driven by Stepper motors. The arm we used
can achieve y-axis motion and open/close clamp motion.
- Car Robot
- Battery
We used a battery that can supply up to 12 Volts. As well as , having the
ability to supply current as much as needed by the peripherals.
d-Circuit Schematic
10
Figure 1.2: Hardware circuit schematic
11
Software Details:
For our code, we have put together a flow chart that interprets how the
code flows. Firstly, the user chooses whether he wants to control arm
motion or car motion. Moving on to car motion cases which are (Left,
Right, Forward, Backward and Stop) or the arm motion cases which are
(Up, Down, Open clamp, Close Clamp).
12
- Detailed Code Description:
13
The main Code concepts involved in the DC motor code and Servo motor
code.
Clamp: - Open was achieved by a 0.7 ms delay from a period of 20ms (3.5%
duty cycle.)
- Close was achieved by a 2.5 ms logic one signal from a period of
20 ms (12.5% duty cycle.)
14
IV. Calculations
15
V. Challenges
VI. Conclusion
This project provided us a chance to experience the hardware field of our
Embedded systems course. Engineering wise, this project helped implement
ideas that were rather difficult to be understood theoretically since some
details can only be experienced in real life hardware. As well as, we have
developed deeper understandings of data sheets and design specifications of
electronic components. This will definitely make future projects a lot easier
since this skill is highly required. From the other side, we have developed
analytical skills of tracing circuits and discovering roots of problems. Also,
Team work skills were acquired since this project was a combination of
efforts from various field.
16
17