Android and
Bluetooth
Enable
Phone
Bluetoot
h
Receiver
Batteries
Decode
r
Microcontroller
Motor Driver
Motors
Wireless
Camera
Power Supply
The power supply supplies the required energy for both the microcontroller and the associated
circuits. It is the most essential part of the circuit because to run its constituent ICs circuit has to
be provided with power. These ICs can run on DC power. Hence the required D.C supply has to
be generated. The main parts of a power supply unit and their function are as follows:
DESCRIPTION:
Power supply is the main requirement of every project. The various parts of a power supply are
explained below:
Transformer: The function of the transformer is to step down the voltage level from the
available A.C.220V to the desired voltage. The 9-0-9 rating of the transformer upon the
requirements of the ICs in the circuit is used. The secondary has a center tapping which
forms the neutral terminal.
Bridge rectifier: The function of the rectifier is to convert the alternating voltage signal
into a unidirectional one. This function is provided by semiconductor diodes connected in
bridge configuration. Diodes 1N4007 are used as rectifier.
Ripple Rejection: The output voltage of the rectifier is unidirectional but pulsating
capacitor of 1000Pf is used for ripple rejection.
Regulation: To obtain a constant voltage specific ICs are used as voltage regulator.
Voltage regulator LM7805 is used. These ICs have three terminals input, output and a
ground terminal.
PIC microcontroller
Peripheral Interface Controller
Instruction set[]
A PIC's instructions vary from about 35 instructions for the low-end PICs to over 80 instructions
for the high-end PICs. The instruction set includes instructions to perform a variety of operations
on registers directly, the accumulator and a literal constant or the accumulator and a register, as
well as for conditional execution, and program branching.
Some operations, such as bit setting and testing, can be performed on any numbered register, but
bi-operand arithmetic operations always involve W (the accumulator), writing the result back to
either W or the other operand register. To load a constant, it is necessary to load it into W before
it can be moved into another register. On the older cores, all register moves needed to pass
through W, but this changed on the "high end" cores.
PIC cores have skip instructions which are used for conditional execution and branching. The
skip instructions are 'skip if bit set' and 'skip if bit not set'. Because cores before PIC18 had only
unconditional branch instructions, conditional jumps are implemented by a conditional skip (with
the opposite condition) followed by an unconditional branch. Skips are also of utility for
conditional execution of any immediate single following instruction. It is possible to skip skip
instructions. For example, the instruction sequence "skip if A; skip if B; C" will execute C if A is
true or if B is false.
The 18 series implemented shadow registers which save several important registers during an
interrupt, providing hardware support for automatically saving processor state when servicing
interrupts.
synchronized with the four clock instruction cycle, otherwise there can be a one instruction cycle
jitter. Internal interrupts are already synchronized. The constant interrupt latency allows PICs to
achieve interrupt driven low jitter timing sequences. An example of this is a video sync pulse
generator. This is no longer true in the newest PIC models, because they have a synchronous
interrupt latency of three or four cycles.
Advantages[
RISC architecture
Easy entry level, in circuit programming plus in circuit debugging PICKit units available
for less than $50
Inexpensive microcontrollers
Wide
range
of
interfaces
programmable
Availability of processors in DIL package make them easy to handle for hobby use.
transfers between pages. PCLATH must also be preserved by any interrupt handler.
I/O PORTS
Some pins for these I/O ports are multiplexed with an alternate function for the peripheral
features on the device. In general, when a peripheral is enabled, that pin may not be used as a
general purpose I/O pin. Additional information on I/O ports may be found in the PICmicro
Mid-Range Reference Manual, (DS33023).
4.1 PORTA and the TRISA Register
PORTA is a 6-bit wide, bi-directional port. The corresponding data direction register is TRISA.
Setting aTRISA bit (= 1) will make the corresponding PORTA pin an input (i.e., put the
corresponding output driver in a Hi-Impedance mode). Clearing a TRISA bit (= 0) will make
the corresponding PORTA pin an output (i.e., put the contents of the output latch on the selected
pin). Reading the PORTA register reads the status of the pins, whereas writing to it will write to
the port latch. All write operations are read-modify-write operations. Therefore, a write to a port
implies that the port pins are read, the value is modified and then written to the port data latch.
Pin RA4 is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. The
RA4/T0CKI pin is a Schmitt Trigger input and an open drain output. All other PORTA pins have
TTL input levels and full CMOS output drivers.
Blue Control is a basic universal Remote Control for Blue-Tooth enabled serial devices such as
Blue Tooth modules connected to a micro-controller. For each button pressed the corresponding
ASCII code for the label will be sent. For example pressing buttons A-H will send the characters
"a" - "h". The up, down, left, right, and center buttons will send "U","D","L","R", and "C"
characters. Hopefully this will inspire people to create a lot of fun Blue-Tooth Controlled
devices.
Bluetooth Module
Handheld devices like a cell phone, palmtop and laptop were rapidly becoming an integral part
of our daily lives. In most cases, these devices do not have compatible data communication
interfaces, or, if they do, the interface requires cumbersome cable connections and configuration
procedures. Isnt it absolutely fantastic to connect your PC to share music, data and calendar info
without using any wires? Or to wirelessly access phone numbers on your PDA from your cell
phone. Driving without holding the handset makes it dramatically safer and easier. Accessing the
internet, print files from your computer and print photos taken from a digital camera without a
single piece of wire lying in your office.
An obvious solution was to get rid of the cables and use short-range, wireless, inexpensive and
universally adopted by device vendors to facilitate on-demand connectivity among devices
.The marvel of engineering gave us the freedom of exchanging data without using yards of
wires and popularly known as Bluetooth. It all started back in 1994 when Ericsson Mobile
Communications began a utilitarian assessment on an inexpensive low-power radio solution
between cell phones and phone accessories. The idea was to build a small radio both in cellular
phones and laptop that would replace the cumbersome wires between them. Four years later
Ericsson, along with Nokia, IBM, Toshiba and Intel formed the Bluetooth Special Interest Group
(SIG). These were the leading companies in the field of mobiles, notebook computers and
leaders in the digital market technology. With such big names of the field it immediately grabbed
the media attention and there were very high expectations from the product. But a lot of
complexities and problems were faced initially. Then in 1999 first Bluetooth spec 1.0 was
launched and a year later spec 1.1. Today, the Bluetooth SIG has 3,400 companies.
Bluetooth is a wireless technology standard for connecting fixed or mobile devices using
short radio link. It aims at providing wireless communication along with small size,
minimal power consumption and low price. The technology was designed to be simple, and
the target was to have it become standard in wireless connectivity. The name of Bluetooth
has a very interesting story. The Bluetooth SIG adopted the code name as a tribute to the tenthcentury Viking king Harald Blatand who peacefully united numerous small kingdoms under his
region that were working under different rules same as done in Bluetooth technology. Harald
liked to eat blueberries, which gave his teeth the coloration that lead to the nickname
"Bluetooth."The symbol is also famous as its name and has a very interesting origin. The logo
combines the representation of the Nordic runes Hagalaz (transcribed by 'H') and Berkana
(transcribed by 'B') in the same symbol. This is, HB like Harald Blatand.
What makes Bluetooth special when wireless technologies like IrDA and Wi-Fi existed?
Pitting these technologies against each other would be unfair as each of them have their unique
advantages and complement rather than compete with each other. Though IrDA supported
wireless connectivity they needed optical contact that is direct line of sight and supported one to
one data exchange using infra-red light. For example a remote control and television where we
need to hold remote in line of sight of television. In the same way Wi-Fi offers a means to
wirelessly connect one or more computers to each other and a router so that we can access the
Internet. It uses longer distances and transfer data at faster rate as well but Bluetooth offers a
means to link not just computers, but PDAs, headphones, headsets, printers and other technology
with each other. The figure below represents the three networks.
Wireless communication made easy a tag line used to address Bluetooth but it is only for users
not for the developers. The demands of creating Bluetooth-enabled products are
very challenging. It should be flexible application topology so the exchange takes place
between the required devices. Power required by Bluetooth should be low as no one wants a
short battery life. Size is a important feature while designing. It should be small so adding
Bluetooth capability to a device should not noticeably increase its size. A Quality of service is
supported for voice and last but not the least Bluetooth cannot cost more than cables.
network where everything is accessible within the Personal Operating Space that is related to
communicating information both voice and data. There are various examples where Bluetooth
model has been used.
As we can see initially Bluetooth was started in the area of mobile phone. Every manufacturer
started implementing Bluetooth enabled devices in the phones. The reason behind this adoption
was to use wireless headset with the phone which meant phone can be used even if it is in a
briefcase or trunk. It was used to make a mobile phone or cordless modem to provide Dial Up
networking which allows connecting to internet without any physical phone line. Laptop can
automatically utilize the users nearby cell phone to dial and connect to dial-up service. Peer to
peer file exchange can be done without the presence of network infrastructure. For example a
salesperson can share the contents of electronic slides with the audience. Bluetooth enables
automatic detection of Bluetooth devices in the room enabling the transfer. Data synchronization
between the devices is permitted by Bluetooth. For example a Bluetooth enabled desktop
computer can wirelessly synchronize its contact list, task information, calendar to a users phone,
PDA, or notebook. Nowadays, HP is making printers and notebooks with embedded Bluetooth
technology so they can automatically detect Bluetooth enabled printers in their area and
wirelessly send documents to the printer without going through lengthy network and printing setup process.
How does bluetooth work?
Bluetooth is a short range communication that is simple, secure and available everywhere.
Billions of devices ranging from mobile phones and computers to medical devices and home
entertainment products are enabled with Bluetooth devices.
In simple terms Bluetooth takes the information normally carried by wire and transmits it
at a special frequency to another Bluetooth device. Both sending and receiving devices have
same Bluetooth receiver chip, which translates data into wireless transmission and then
back to normal again depending on the sender or receiver. Any Bluetooth device can be a
master or slave depending on the application. Every device is equipped with a microchip
(trans-receiver) that transmits and receives in the frequency of 2.4 GHz which is available to the
whole world. Besides the information, there are three channels of voices available. The
information can be exchanged at a speed up-to 1 megabit per second or 2 megabit for second in
Second Generation of this Technology). Frequency hopping allows communicating inclusively
without interferences. The transmitted data is divided into packets and each packet is transmitted
on one of the 79 designated Bluetooth channels. Each channel has a bandwidth of 1 MHzs. The
first channel starts at 2402 MHz and continues up to 2480 MHz in 1 MHz steps. It usually
performs 800 hops per second, with Adaptive Frequency-Hopping enabled. The master sets the
hopping sequence, and the slaves synchronize to the Master. A cluster is formed by a master and
up to seven active slaves known as Pico nets. The slaves in a Pico net only communicate with the
master. A scatter net can be formed by linking two or more Pico nets. When a device is present in
more than one Pico net, it must time-share and synchronize to the master of the Pico net with
which it is currently communicating. Networks in Bluetooth are far more diverse and dynamic.
As they are constantly formed and dissolved Bluetooth devices move in and out of range so there
are limitless ways to connect them. The figure below summarizes the Bluetooth communication.
With the basic understanding of information exchange in Bluetooth system we now move ahead
to specifications.
Frequency
The Bluetooth operates in the frequency range of 2.4 GHz. Though this band is available
worldwide it may differ in some countries. This is the frequency band of scientific and medical
industries 2.45 GHz (ISM*). The ISM* is opened for any system of radio and take care of the
interferences of monitors, the controls for doors of garage, the wireless telephone and microwave
oven. The ranges of the bandwidth in The United States and Europe are between 2.400 to 2.483,5
MHz and it covers part of France and Spain. The range of the bandwidth in Japan is between
2.471 to 2.497 MHz So the system can be used worldwide due to that transmitters of radio
covers 2.400 and 2.500 MHz and makes it possible to select the appropriate frequency. ISM The
industrial, scientific and medical (ISM) radio bands were originally reserved internationally for
the use of RF electromagnetic fields for industrial, scientific and medical purposes other than
2400-2483.5 MHz
F =2402 + k MHz
k = 0,..,78
Japan
2471-2497 MHz
F =2473+ k MHz
k=0,22
Spain
2445-2475 MHz
F =2449+ k MHz
K=0,22
France
2446.5-2483.5 MHz
F =2454+ k MHz
K=0,..22
100mW
~ 100 m
Class 2
2.5mW
~10 m
Class 3
1mW
~1 m
Range
The connections have a maximum range of 10 meters, though using amplifiers it is possible to
come up to 100 meters, but creating some distortion interferes. Maybe it doesnt look too much,
but it is necessary to remember that these devices were created by the intention of using them in
closed environments and little distances.
1Mbit/s
.7Mbits/s
Version 2.0
3 Mbit/s
2.1Mbits/s
Version 3.0
24Mbits/s
Frequency Hopping
It is method of transmitting radio signals by rapidly switching a carrier wave among many
channels using a pseudorandom sequence known both to transmitter and receiver. It is
useful to avoid collision where many devices use same frequency to send the signal and
avoid interference.
Since the ISM band is open to anyone, radio systems operating in this band must cope with
several unpredictable sources of interference, such as baby monitors, garage door openers,
cordless phones and microwave ovens (the strongest source of interference). Interference can be
avoided using an adaptive scheme that finds an unused part of the spectrum, or it can be
suppressed by means of spectrum spreading. In the United States, radios operating in the 2.45GHz ISM band are required to apply spectrum-spreading techniques if their transmitted power
level exceeds 0 dBm [2]. Bluetooth radios use frequency-hop (FH) spread spectrum, since it
better supports low-cost, low-power radio implementations. In addition, they better cope with
near-far problems: a nearby jammer is effectively suppressed by the narrow channel filter as
long as its jammer TX spectrum does not coincide with the selected hop channel. FH systems
divide the frequency band into several hop channels. During a connection, radio transceivers hop
from one channel to another in a pseudorandom fashion. The instantaneous (hop) bandwidth is
small in FH radios, but spreading is obtained over the entire frequency band. This results in lowcost narrow-band transceivers with maximum immunity to interference.
Here we can see that channel time is divided into slots of 625uS. Each packet can occupy 1, 3 or
5 slots. The hopping frequency keeps constant within the packet. The master uses the odd
number of slots to send the packets and slave uses even numbered
Ad hoc Network
Ad hoc network is a decentralized wireless network where they do not rely on preexisting
infrastructure such as routers instead each device participates in routing by routing data to the
other nodes. An ad hoc network typically refers to any set of networks where all devices have
equal status on a network and are free to associate with any other ad hoc network device in link
range. Bluetooth also uses ad hop networking and is based on peer connectivity: a device
carrying a Bluetooth radio can make a connection to any other device carrying a Bluetooth radio.
There is no wired infrastructure with base stations or access points that can support the call setup
or can provide low-power modes. In a Bluetooth system the master device can connect up-to
seven other devices forming a network known as Pico net. For example a computer can connect
to seven different Bluetooth enabled devices such as mouse, printer, CD-player, keyboard etc.
The Pico net is a group of several devices that are in the same radio coverage where they share
same channel that is constituted between two and eight other units. Two or more Bluetooth units
that share a FH channel form a Pico net. To regulate traffic on the channel, one of the
participating units becomes a master of the Pico net. However, users on the same channel must
share capacity. Since the channel capacity is only 1 MHz, as more and more users are added,
throughput per user quickly drops to less than some 10 kb/s. The spectral bandwidth available is
79 MHz, but cannot be used effectively when every unit must share the same 1-MHz hop
channel. Therefore, another solution has been adopted. Units that share the same area and that
are within range of one another can potentially establish ad hoc connections between themselves.
However, solely units that truly want to exchange information share the same 1-MHz channel of
a Pico net. This solution permits several Pico nets to be created with overlapping coverage areas.
Each Pico net channel applies its own pseudorandom hopping sequence through the 79-MHz
medium. The Pico nets are uncoordinated and hop independently. Within the Pico net, the
participants have to share the 1 MHz, but multiple Pico nets share the entire 79 MHz, thus
increasing the capacity. A collection of multiple Pico nets is called a scatter net. A maximum of
10 Pico nets can be connected to form a scatter net. A figure below shows how Pico net works.
Each part on the hardware runs on certain protocols and comibining them gives us a
compact structure of bluetooth device.
The HC-05 Bluetooth module is the most economical and easiest way to go wireless. (via
Bluetooth)
This module makes it easy for you to wirelessly extend your serial interface, so you can control
any program running on your Laptop with serial port interface.
GND;
TXD;
RXD;
In the lower right is the voltage regulator that literally exploded. However, these specific
modules are cool for tinkering, as they allow TTL (5V) levels!
The HC-05 modules are very clever pieces of hardware, as they translate incoming Bluetooth
communication to serial data. So once configured this gives the tinkerer the possibility to achieve
serial communication over Bluetooth. The HC-05 acts transparently, meaning that you just
communicate with the serial port it is connected to and the module then sends/receives via
Bluetooth.
To be able to continue tinkering with communications I gave the Bluetooth USB Dongle with
Raspberry Pi alternative a second chance. Weeks ago I have not been able to get Bluetooth
running using a serial communication protocol. In fact, I was not even able to pair any of my
computers and the Raspberry Pi.
My plan is to modify my LED sign to wireless communications. As a proof-of-concept I am
going to use my Raspberry Pi with attached bluetooth USB dongle to communicate with a
HC-05 Bluetooth module connected to an Arduino.
To quote from The Big Bang Theory: Everything is better with Bluetooth!
As I mentioned, I was not able to pair any of my computers with the Bluetooth dongle on a
Raspberry Pi. So I am going to use a Bluetooth module with an Arduino to check connection,
pairing and communications. So this tutorial will start with the Arduino part, explaining the setup and use of the HC-05 Bluetooth module. The second part covers the installation and
configuration of Bluetooth on the Raspberry Pi. Finally, I will show you how to implement a
communication protocol with handshaking between the Arduino and the Raspberry Pi. So lets
start.
input!
GND: Ground
Motor Driver
L293D
L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current
amplifiers since they take a low-current control signal and provide a higher-current signal. This
higher current signal is used to drive the motors.
L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation, two DC
motors can be driven simultaneously, both in forward and reverse direction. The motor
operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input logic
00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and
anticlockwise directions, respectively.
Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start operating.
When an enable input is high, the associated driver gets enabled. As a result, the outputs become
active and work in phase with their inputs. Similarly, when the enable input is low, that driver is
disabled, and their outputs are off and in the high-impedance state.
Pin Diagram:
Pin Description:
Pin No
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Function
Enable pin for Motor 1; active high
Input 1 for Motor 1
Output 1 for Motor 1
Ground (0V)
Ground (0V)
Output 2 for Motor 1
Input 2 for Motor 1
Supply voltage for Motors; 9-12V (up to 36V)
Enable pin for Motor 2; active high
Input 1 for Motor 1
Output 1 for Motor 1
Ground (0V)
Ground (0V)
Output 2 for Motor 1
Input2 for Motor 1
Supply voltage; 5V (up to 36V)
Name
Enable 1,2
Input 1
Output 1
Ground
Ground
Output 2
Input 2
Vcc 2
Enable 3,4
Input 3
Output 3
Ground
Ground
Output 4
Input 4
Vcc 1
Geared DC Motor
Geared DC motors can be defined as an extension of DC motor which already had its Insight
details demystified here. A geared DC Motor has a gear assembly attached to the motor. The
speed of motor is counted in terms of rotations of the shaft per minute and is termed as RPM
.The gear assembly helps in increasing the torque and reducing the speed. Using the correct
combination of gears in a gear motor, its speed can be reduced to any desirable figure. This
concept where gears reduce the speed of the vehicle but increase its torque is known as gear
reduction. This Insight will explore all the minor and major details that make the gear head and
hence the working of geared DC motor.
External Structure
At the first sight, the external structure of a DC geared motor looks as a straight expansion over
the simple DC ones.
The lateral view of the motor shows the outer protrudes of the gear head. A nut is placed near the
shaft which helps in mounting the motor to the other parts of the assembly.
Also, an internally threaded hole is there on the shaft to allow attachments or extensions such as
wheel to be attached to the motor.
Wireless camera
Wireless security cameras provide surveillance for homes or businesses. The uses of these
cameras vary; those with remote access allow users to monitor activity inside of their homes to
view interaction between caregivers and a child or to monitor children home alone. Outdoor
cameras provide additional security by allowing users to view visitors at the door before opening
it and to monitor perimeters of their home and grounds. Businesses rely on these cameras as
well. Many wireless security cameras have motion and sound sensors that send out alerts to the
user if the sensor triggers.
Wireless cameras also allow users to install them in areas where wired security systems are not
feasible. Knowing about the varied features offered by wireless security cameras allows
consumers to make an informed decision before purchasing one.
Wireless security cameras are closed-circuit television (CCTV) cameras that transmit a video
and audio signal to a wireless receiver through a radio band. Many wireless security cameras
require at least one cable or wire for power; "wireless" refers to the transmission of video/audio.
However, some wireless security cameras are battery-powered, making the cameras truly
wireless from top to bottom.
Wireless cameras are proving very popular among modern security consumers due to their low
installation costs (there is no need to run expensive video extension cables) and flexible
mounting options; wireless cameras can be mounted/installed in locations previously unavailable
to standard wired cameras. In addition to the ease of use and convenience of access, wireless
security camera allows users to leverage broadband wireless internet to provide seamless video
streaming over-internet.