Hardware Interfacing
Hardware Interfacing
Hardware Interfacing
The following components are used to construct the power supply circuit.
Description:
The bridge rectifier is formed with diodes. The bridge rectifier converts the AC
voltage into DC voltage.
To indicate the condition of the circuit we place LED at the end of the circuit.
Introduction
The most commonly used Character based LCDs are based on Hitachi's
HD44780 controller .
Pin Description
The most commonly used LCDs available in the market today are single
Line, double Line or four Line LCDs and support at most of 80 characters.
Most LCDs with one controller has 14 Pins and LCDs with two controller
has 16 Pins (two pins are extra in both for back-light LED connections).
LCD Pin Diagram
Pin description of 16*2 LCD is shown in the table below.
4-bit Mode
8-bit Mode
LCD Connection
The LCD requires three control lines (RS, R/W & EN) & 8 (or 4) data lines.
In case of 4-bit mode only 4 data lines are required & the 8-bit data is
sent by first sending the higher nibble followed by the lower nibble.
Enable:
Used to Latch data into the LCD.
A H-L pulse latches the data into the LCD.
Display Data RAM (DDRAM) stores the display data.
For a 2x16 LCD the DDRAM address for first line is from 0x80H to
0x8FH & for second line is 0xC0H to 0xCFH.
For example, if we want to display ‘A' on the 7th position of the first
line then we will write it at location 86h.
LED
• As you can see the Anode is connected through a resistor to Vcc & the
Cathode is connected to the Microcontroller pin.
• So when the Port Pin is HIGH the LED is OFF & when the Port Pin is LOW
the LED is turned ON.
Seven Segment Display
Multiple Seven Segment Displays
Figure shows the circuit for interfacing two seven segment displays.
RELAY
As you can see an NPN transistor BC547 is being used to control the relay.
The transistor is turned ON when a LOGIC high is written on the PORT PIN
thus turning ON the relay.
Likewise, the relay gets turned OFF by writing LOGIC Low on the port
pin.
In above figure when the switch is not pressed , controller gets LOGIC High
through pull up resistor.
So normally the port pin is high but when a switch is pressed the
controller pin gets a Low signal and we come to know that a switch has
been pressed
Over here we have considered a 4x3 matrix keypad i.e. four rows and
three columns.
So in all twelve switches have been interfaced using just seven lines.
In keypad interfacing, every number is assigned two unique parameters, i.e.,
row and column number . Hence when a key is pressed the number is identified
by detecting the row and column number of the key pressed.
Initially all the rows are set to zero by the controller and the columns are
scanned to check if any key is pressed. In case no key is pressed the output
of all the columns will be high.
Whenever a key is pressed the row and column corresponding to the key will get
shorted, resulting in the output of the corresponding column goes low. This gives
the column number of the pressed key.
Once the column number is detected, the controller set’s all the rows to high. Now
one by one each row is set to zero by controller. The row corresponding to which
the column gets zero is the row number of the digit.
The above process is very fast and even if the switch is pressed for a very small
duration of time the controller can detect the key which is pressed.
DC Motor
Basically there are four switching elements in the H-Bridge as shown in the
figure below.
• L293D has output current of 600mA and peak output current of 1.2A per
channel.
• Moreover for protection of circuit from back EMF output diodes are included
within the IC.
• The output supply (VCC2) has a wide range from 4.5V to 36V, which has made
L293D a best choice for DC motor driver.
A simple schematic for interfacing a DC motor using L293D is shown below.
Basic Principle of PWM
Pulse-width Modulation is achieved with the help of a square wave whose duty
cycle is changed to get a varying voltage output as a result of average value of
waveform.
A mathematical explanation of this is given below.
Waveform
INTERNAL STRUCTURE OF STEPPER MOTOR
ROTOR
(permanent magnet)
STATOR
(carry coil for current Flow)
Servo Motor is lightweight with high output torque. Servo can rotate
approximately 180 degrees. It works by applying pulse to it’s data pin.
ADC
In lot of embedded systems microcontrollers needs to take
digital input.
This module has 3V CMOS battery for bakup so that it retains time and date even in
case of power failure.
LM358 Based Voltage Comparator
Micro controller AT89S52
Memory.
AT89S52
Block Diagram of Microcontroller
External interrupts
On-chip Timer/Counter
CPU
Bus Serial
4 I/O
OSC Control Port
Ports
P0 P1 P2 P3 TxD RxD
Address/Data
Pin Diagram of AT89S52 Micontroller
IR SENSOR MODULE
Bluetooth is a wireless technology standard
for exchanging data over short distances
(using short-wavelength UHF radio waves in
the ISM band from 2.4 to 2.485 GHz)
HC-05 Module has GND, VCC, TXD, RXD.
We can use WI-FI Module for more range and faster data
transfer rate. Generally ESP-01 wi-fi module is popular.
Xbee Module
Applications
Remote Controls
Automation System
Wireless Security System