Smart card System for Rail Way Ticket Abstract The objective of the project is to design a microcontroller based smart card processor for rail way ticket that upon inserting the card and entering the ticket no should deduct the amount present in the card and grant the appropriate ticket. A smart card, chip card, or integrated circuit card (ICC), is in any pocket-sized plastic card with an embedded integrated circuit built into it which can process data. This implies that it can receive input which is processed by way of the ICC applications and delivered as an output. There are two broad categories of Ices Memory cards and Microprocessor card. Memory cards s contain only non- volatile memory storage components, and perhaps some specific security logic like EEPROM where as Microprocessor card contain ROM, RAM CPU and microprocessor components. The card may embed a hologram to avoid counterfeiting. Using smartcards also is a form of strong security authentication for single sign-on within large companies and organizations. Our system consists of a microcontroller a smart card reader module keypad and a LCD; all these peripherals are interfaced to the microcontroller. When the power is
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Smart card System for Rail Way TicketAbstract
The objective of the project is to design a microcontroller based smart card
processor for rail way ticket that upon inserting the card and entering the ticket no should
deduct the amount present in the card and grant the appropriate ticket.
A smart card, chip card, or integrated circuit card (ICC), is in any pocket-
sized plastic card with an embedded integrated circuit built into it which can process data.
This implies that it can receive input which is processed by way of the ICC applications
and delivered as an output. There are two broad categories of Ices Memory cards and
Microprocessor card. Memory cards s contain only non-volatile memory storage
components, and perhaps some specific security logic like EEPROM where as
Microprocessor card contain ROM, RAM CPU and microprocessor components. The
card may embed a hologram to avoid counterfeiting. Using smartcards also is a form of
strong security authentication for single sign-on within large companies and
organizations.
Our system consists of a microcontroller a smart card reader module keypad and a
LCD; all these peripherals are interfaced to the microcontroller. When the power is
switched on the microcontroller enables all its peripherals, the moment the user inserts
the smart card into the module the reader reads the data present in the card and asks the
user to enter the password if the entered password matches with the card’s password then
a message of authentication is displayed on the LCD and allows the user to conform the
ticket for and deducts the cost of the ticket from the amount in the card simultaneously
displaying related message on the LCD. Thus the process of rail way ticketing is carried
1. Vertical filter film to polarize the light as it enters. 2. Glass substrate with ITO electrodes. The shapes of
these electrodes will determine the dark shapes that will appear when the LCD is turned on or off. Vertical ridges etched on the surface are smooth.
3. Twisted nematic liquid crystals. 4. Glass substrate with common electrode film (ITO)
with horizontal ridges to line up with the horizontal filter.
5. Horizontal filter film to block/allow through light. 6. Reflective surface to send light back to viewer. (In
a backlit LCD, this layer is replaced with a light source.)
A liquid crystal display (commonly abbreviated 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. It is often utilized in battery-powered electronic devices because it uses very small amounts of electric power.
Overview
Each pixel of an LCD typically consists of a layer of molecules aligned between two transparent electrodes, and two polarizing filters, the axes of transmission of which are (in most of the cases) perpendicular to each other. With no liquid crystal between the polarizing filters, light passing through the first filter would be blocked by the second (crossed) polarizer.
The surface of the electrodes that are in contact with the liquid crystal material are treated so as to align the liquid crystal molecules in a particular direction. This treatment typically consists of a thin polymer layer that is unidirectionally rubbed using, for example, a cloth. The direction of the liquid crystal alignment is then defined by the direction of rubbing.
Before applying an electric field, the orientation of the liquid crystal molecules is determined by the alignment at the surfaces. In a twisted nematic device (still the most common liquid crystal device), the surface alignment directions at the two electrodes are perpendicular to each other, and so the molecules arrange themselves in a helical
structure, or twist. Because the liquid crystal material is birefringent, light passing through one polarizing filter is rotated by the liquid crystal helix as it passes through the liquid crystal layer, allowing it to pass through the second polarized filter. Half of the incident light is absorbed by the first polarizing filter, but otherwise the entire assembly is transparent.
When a voltage is applied across the electrodes, a torque acts to align the liquid crystal molecules parallel to the electric field, distorting the helical structure (this is resisted by elastic forces since the molecules are constrained at the surfaces). This reduces the rotation of the polarization of the incident light, and the device appears gray. If the applied voltage is large enough, the liquid crystal molecules in the center of the layer are almost completely untwisted and the polarization of the incident light is not rotated as it passes through the liquid crystal layer. This light will then be mainly polarized perpendicular to the second filter, and thus be blocked and the pixel will appear black. By controlling the voltage applied across the liquid crystal layer in each pixel, light can be allowed to pass through in varying amounts thus constituting different levels of gray.
The optical effect of a twisted nematic device in the voltage-on state is far less dependent on variations in the device thickness than that in the voltage-off state. Because of this, these devices are usually operated between crossed polarizers such that they appear bright with no voltage (the eye is much more sensitive to variations in the dark state than the bright state). These devices can also be operated between parallel polarizers, in which case the bright and dark states are reversed. The voltage-off dark state in this configuration appears blotchy, however, because of small thickness variations across the device.
Both the liquid crystal material and the alignment layer material contain ionic compounds. If an electric field of one particular polarity is applied for a long period of time, this ionic material is attracted to the surfaces and degrades the device performance. This is avoided either by applying an alternating current or by reversing the polarity of the electric field as the device is addressed (the response of the liquid crystal layer is identical, regardless of the polarity of the applied field).
When a large number of pixels is required in a display, it is not feasible to drive each directly since then each pixel would require independent electrodes. Instead, the display is multiplexed. In a multiplexed display, electrodes on one side of the display are grouped and wired together (typically in columns), and each group gets its own voltage source. On the other side, the electrodes are also grouped (typically in rows), with each group getting a voltage sink. The groups are designed so each pixel has a unique, unshared combination of source and sink. The electronics or the software driving the electronics then turns on sinks in sequence, and drives sources for the pixels of each sink.
Specifications
Important factors to consider when evaluating an LCD monitor:
Resolution: The horizontal and vertical size expressed in pixels (e.g., 1024x768). Unlike CRT monitors, LCD monitors have a native-supported resolution for best display effect.
Dot pitch: The distance between the centers of two adjacent pixels. The smaller the dot pitch size, the less granularity is present, resulting in a sharper image. Dot pitch may be the same both vertically and horizontally, or different (less common).
Viewable size: The size of an LCD panel measured on the diagonal (more specifically known as active display area).
Response time: The minimum time necessary to change a pixel's color or brightness. Response time is also divided into rise and fall time.
Matrix type: Active or Passive. Viewing angle: (coll., more specifically known as
viewing direction). Color support: How many types of colors are
supported (coll., more specifically known as color gamut).
Brightness: The amount of light emitted from the display (coll., more specifically known as luminance).
Contrast ratio: The ratio of the intensity of the brightest bright to the darkest dark.
Aspect ratio: The ratio of the width to the height (for example, 4:3, 16:9 or 16:10).
Input ports (e.g., DVI, VGA, LVDS, or even S-Video and HDMI).
Color displays
In color LCDs each individual pixel is divided into three cells, or sub pixels, which are colored red, green, and blue, respectively, by additional filters (pigment filters, dye filters and metal oxide filters). Each subpixel can be controlled independently to yield thousands or millions of possible colors for each pixel. Older CRT monitors employ a similar 'subpixel' structures via the use of phosphors, although the analog electron beam employed in CRTs do not hit exact 'subpixels'.
Color components may be arrayed in various pixel geometries, depending on the monitor's usage. If software knows which type of geometry is being used in a given LCD,
this can be used to increase the apparent resolution of the monitor through subpixel rendering. This technique is especially useful for text anti-aliasing.
Passive-matrix and active-matrix addressed LCDs
LCDs with a small number of segments, such as those used in digital watches and pocket calculators, have individual electrical contacts for each segment. An external dedicated circuit supplies an electric charge to control each segment. This display structure is unwieldy for more than a few display elements.
Small monochrome displays such as those found in personal organizers, or older laptop screens have a passive-matrix structure employing super-twisted nematic (STN) or double-layer STN (DSTN) technology (DSTN corrects a color-shifting problem with STN), and (CSTN) color-STN (a technology where color is added by using an internal color filter). Each row or column of the display has a single electrical circuit. The pixels are addressed one at a time by row and column addresses. This type of display is called passive-matrix addressed because the pixel must retain its state between refreshes without the benefit of a steady electrical charge. As the number of pixels (and, correspondingly, columns and rows) increases, this type of display becomes less feasible. Very slow response times and poor contrast are typical of passive-matrix addressed LCDs.
High-resolution color displays such as modern LCD computer monitors and televisions use an active matrix structure. A matrix of thin-film transistors (TFTs) is added to the polarizing and color filters. Each pixel has its own dedicated transistor, allowing each column line to access one pixel. When a row line is activated, all of the column lines are connected to a row of pixels and the correct voltage is driven onto all of the column lines. The row line is then deactivated and the next row line is activated. All of the row lines are activated in sequence during a refresh operation. Active-matrix addressed displays look "brighter" and "sharper" than passive-matrix addressed displays of the same size, and generally have quicker response times, producing much better images.
Active matrix technologies
Twisted nematic (TN)
Twisted nematic displays contain liquid crystal elements which twist and untwist at varying degrees to allow light to pass through. When no voltage is applied to a TN liquid crystal cell, the light is polarized to pass through the cell. In proportion to the voltage applied, the LC cells twist up to 90 degrees changing the polarization and blocking the light's path. By properly adjusting the level of the voltage almost any grey level or transmission can be achieved.
For a more comprehensive description refer to the section on the twisted nematic field effect.
In-plane switching (IPS)
In-plane switching is an LCD technology which aligns the liquid crystal cells in a horizontal direction. In this method, the electrical field is applied through each end of the crystal, but this requires two transistors for each pixel instead of the single transistor needed for a standard thin-film transistor (TFT) display. This result in blocking more transmission area, thus requiring a brighter backlight, which will consume more power, making this type of display less desirable for notebook computers.
Vertical alignment (VA)
Vertical alignment displays are a form of LC displays in which the liquid crystal material naturally exists in a horizontal state removing the need for extra transistors (as in IPS). When no voltage is applied the liquid crystal cell, it remains perpendicular to the substrate creating a black display. When voltage is applied, the liquid crystal cells shift to a horizontal position, parallel to the substrate, allowing light to pass through and create a white display. VA liquid crystal displays provide some of the same advantages as IPS panels, particularly an improved viewing angle and improved black level.
Quality control
Some LCD panels have defective transistors, causing permanently lit or unlit pixels which are commonly referred to as stuck pixels or dead pixels respectively. Unlike integrated circuits, LCD panels with a few defective pixels are usually still usable. It is also economically prohibitive to discard a panel with just a few defective pixels because LCD panels are much larger than ICs. Manufacturers have different standards for determining a maximum acceptable number of defective pixels. The maximum acceptable number of defective pixels for LCD varies greatly. At one point, Samsung held a zero-tolerance policy for LCD monitors sold in Korea. Currently, though, Samsung adheres to the less restrictive ISO 13406-2 standard. Other companies have been known to tolerate as many as 11 dead pixels in their policies. Dead pixel policies are often hotly debated between manufacturers and customers. To regulate the acceptability of defects and to protect the end user, ISO released the ISO 13406-2 standard. However, not every LCD manufacturer conforms to the ISO standard and the ISO standard is quite often interpreted in different ways.
Examples of defects in LCDs
LCD panels are more likely to have defects than most ICs due to their larger size. In this example, a 300 mm SVGA LCD has 8 defects and a 150 mm wafer has only 3 defects. However, 134 of the 137 dies on the wafer will be acceptable, whereas rejection of the
LCD panel would be a 0% yield. The standard is much higher now due to fierce competition between manufacturers and improved quality control. An SVGA LCD panel with 4 defective pixels is usually considered defective and customers can request an exchange for a new one. Some manufacturers, notably in South Korea where some of the largest LCD panel manufacturers, such as LG, are located, now have "zero defective pixel guarantee" and would replace a product even with one defective pixel. Even where such guarantees do not exist, the location of defective pixels is important. A display with only a few defective pixels may be unacceptable if the defective pixels are near each other. Manufacturers may also relax their replacement criteria when defective pixels are in the center of the viewing area.
LCD panels also have defects known as mura, which look like a small-scale crack with very small changes in luminance or color.
Zero-power (bistable) displays
The zenithal bistable device (ZBD), developed by QinetiQ (formerly DERA), can retain an image without power. The crystals may exist in one of two stable orientations (Black and "White") and power is only required to change the image. ZBD Displays is a spin-off company from QinetiQ who manufacture both grayscale and color ZBD devices.
A French company, Nemoptic, has developed another zero-power, paper-like LCD technology which has been mass-produced since July 2003. This technology is intended for use in applications such as Electronic Shelf Labels, E-books, E-documents, E-newspapers, E-dictionaries, Industrial sensors, Ultra-Mobile PCs, etc. Zero-power LCDs are a category of electronic paper.
Kent Displays has also developed a "no power" display that uses Polymer Stabilized Cholesteric Liquid Crystals (ChLCD). The major drawback to the ChLCD is slow refresh rate, especially with low temperatures.
In 2004 researchers at the University of Oxford also demonstrated two new types of Zero Power bistable LCDs based on Zenithal bistable techniques.
Several bistable technologies, like the 360° BTN and the bistable cholesteric, depend mainly on the bulk properties of the liquid crystal (LC) and use standard strong anchoring, with alignment films and LC mixtures similar to the traditional monostable materials. Other bistable technologies (i.e. Binem Technology) are based mainly on the surface properties and need specific weak anchoring materials.
Drawbacks
Laptop LCD screen viewed at an extreme angle.
LCD technology still has a few drawbacks in comparison to some other display technologies:
While CRTs are capable of displaying multiple video resolutions without introducing artifacts, LCDs produce crisp images only in their "native resolution" and, sometimes, fractions of that native resolution. Attempting to run LCD panels at non-native resolutions usually results in the panel scaling the image, which introduces blurriness or "blockiness" and is susceptible in general to multiple kinds of HDTV Blur. Many LCDs are incapable of displaying very low resolution screen modes (such as 320x200) due to these scaling limitations.
Although LCDs typically have more vibrant images and better "real-world" contrast ratios (the ability to maintain contrast and variation of color in bright environments) than CRTs, they do have lower contrast ratios than CRTs in terms of how deep their blacks are. A contrast ratio is the difference between a completely on (white) and off (black) pixel, and LCDs can have "backlight bleed" where light (usually seen around corners of the screen) leaks out and turns black into gray. Nowadays the very best LCDs can approach the contrast ratios of plasma displays in terms of delivering a deep black, but most LCDs still lag behind. The very best plasma displays such as the Pioneer Kuro models still lead the way with black levels, which are simply not possible with todays LCD technology.
LCDs which use cheap parts cannot "truly" display as many colors as their CRT and plasma counterparts, typically ones that have lower-end panel types (see List of LCD matrices) such as Twisted Nematic panels (TN).
LCDs typically have longer response times than their plasma and CRT counterparts, especially older displays, creating visible ghosting when images rapidly change. For example, when moving the mouse quickly on an LCD, multiple cursors can sometimes be seen.
Some LCDs have significant input lag. If the lag delay is large enough, such displays can be unsuitable for fast and time-precise mouse operations (CAD, FPS gaming) as compared to
CRT displays or smaller LCD panels with negligible amounts of input lag. Short lag times are sometimes emphasized in marketing.
LCD panels tend to have a limited viewing angle relative to CRT and plasma displays. This reduces the number of people able to conveniently view the same image – laptop screens are a prime example. As this lack of ambient radiation is what gives LCDs their reduced power consumption in comparison to CRTs and plasma displays, it is unavoidable.
o While improved viewing angles mean that grossly incorrect color is now uncommon in normal use, viewing an LCD at ranges typical of computer use still allows small shifts in the user's posture, and even the difference in position between their eyes, to produce noticeable color distortion from even the best LCDs on the market.
Some LCD monitors can cause migraines and eyestrain problems due to flicker from fluorescent backlights fed at 50 or 60 Hz.
A small percentage of LCD screens suffer from image persistence, which is similar to screen burn on CRT and plasma displays, though in LCD monitors, this condition can be repaired very easily.
Consumer LCD monitors tend to be more fragile than their CRT counterparts. The screen may be especially vulnerable due to the lack of a thick glass shield as in CRT monitors.
Dead pixels are a common occurrence and few manufacturers replace screens with dead pixels for free.
Horizontal and/or vertical banding is a problem in some LCD screens. This flaw occurs as part of the manufacturing process, and cannot be repaired (short of total replacement of the screen). Banding can vary substantially even among LCD screens of the same make and model. The degree is determined by the manufacture's quality control procedures.
Color metering is a common problem often not thought about. For a realistic image the frequency range of each of the 3 colors should match the color perception (frequency range) of the human eye.
CRT monitors generally do a better job than that of LCD screens
Smart card
A smart card, chip card, or integrated circuit card (ICC), is defined as
any pocket-sized card with embedded integrated circuits which can process information.
This implies that it can receive input which is processed - by way of the ICC applications
- and delivered as an output. There are two broad categories of ICCs. Memory cards
contain only non-volatile memory storage components, and perhaps some specific
security logic. Microprocessor cards contain volatile memory and microprocessor
components. The card is made of plastic, generally PVC, but sometimes ABS. The card
may embed a hologram to avoid counterfeiting.
Overview
A "smart card" is also characterized as follows:
Dimensions are normally credit card size. The ID-1
of ISO 7810 standard defines them as 85.60 ×
53.98 mm. Another popular size is ID-000 which is
25 x 15 mm. Both are .76 mm thick.
Contains a security system - tamper-resistant
properties (e.g. a secure cryptoprocessor,secure file
system, human-readable features) and is capable of
providing security services (e.g. confidentiality of
information in the memory).
Asset managed by way of a central administration
system which interchanges information and
configuration settings with the card through the
security system. The latter includes card hotlisting,
updates for application data.
Card data is transferred to the central
administration system through card reading
devices, such as ticket readers, ATMs etc.
Benefits
Smart cards provide a means of effecting business transactions in a flexible, secure way
with minimal human intervention and in a standard way.
History
The chip card was invented by German rocket scientist Helmut Gröttrup and his
colleague Jürgen Dethloff in 1968; the patent was finally approved in 1982. The first
mass use of the cards was for payment in French pay phones, starting in 1983 (Télécarte).
Roland Moreno actually patented his first concept of the memory card in 1974. In 1977,
Michel Ugon from Honeywell Bull invented the first microprocessor smart card. In 1978,
Bull patented the SPOM (Self Programmable One-chip Microcomputer) that defines the
necessary architecture to auto-program the chip. Three years later, the very first "CP8"
based on this patent was produced by Motorola. Today, Bull has 1200 patents related to
6. Protect Data #12AANNFFFFFF DD! #83! (Positive Ack)
#82! (No Device Type)#89! (Invalid Security Code)#86! (Invalid Command)#85! (Invalid Parameters#8D! (Memory Over Flow)
AA = Address location of the chip in Hex NN = Number of bytes to read or to writeFFFFFF = Security CodeDD = Data to read / write or protect in BCD format
Note: Please give correct security code while writing your cards other wise they will damage. This card will allow 3 times of writing false security code later it won’t accept to write the card but you can read.
SOFTWARE
Overview of KEIL CROSS C COMPILER
It is possible to create the source files in a text editor such as Notepad, run the
Compiler on each C source file, specifying a list of controls, run the Assembler on each
Assembler source file, specifying another list of controls, run either the Library Manager
or Linker (again specifying a list of controls) and finally running the Object-HEX
Converter to convert the Linker output file to an Intel Hex File. Once that has been
completed the Hex File can be downloaded to the target hardware and debugged.
Alternatively KEIL can be used to create source files; automatically compile, link and
covert using options set with an easy to use user interface and finally simulate or perform
debugging on the hardware with access to C variables and memory. Unless you have to
use the tolls on the command line, the choice is clear. KEIL Greatly simplifies the
process of creating and testing an embedded application.
Projects
The user of KEIL centers on “projects”. A project is a list of all the source files
required to build a single application, all the tool options which specify exactly how to
build the application, and – if required – how the application should be simulated. A
project contains enough information to take a set of source files and generate exactly the
binary code required for the application. Because of the high degree of flexibility
required from the tools, there are many options that can be set to configure the tools to
operate in a specific manner. It would be tedious to have to set these options up every
time the application is being built; therefore they are stored in a project file. Loading the
project file into KEIL informs KEIL which source files are required, where they are, and
how to configure the tools in the correct way. KEIL can then execute each tool with the
correct options. It is also possible to create new projects in KEIL. Source files are added
to the project and the tool options are set as required. The project can then be saved to
preserve the settings. The project also stores such things as which windows were left
open in the simulator/debugger, so when a project is reloaded and the simulator or
debugger started, all the desired windows are opened. KEIL project files have the
extension
Simulator/Debugger
The simulator/ debugger in KEIL can perform a very detailed simulation of a
micro controller along with external signals. It is possible to view the precise execution
time of a single assembly instruction, or a single line of C code, all the way up to the
entire application, simply by entering the crystal frequency. A window can be opened for
each peripheral on the device, showing the state of the peripheral. This enables quick
trouble shooting of mis-configured peripherals. Breakpoints may be set on either
assembly instructions or lines of C code, and execution may be stepped through one
instruction or C line at a time. The contents of all the memory areas may be viewed along
with ability to find specific variables. In addition the registers may be viewed allowing a
detailed view of what the microcontroller is doing at any point in time.
The Keil Software 8051 development tools listed below are the programs you
use to compile your C code, assemble your assembler source files, link your program
together, create HEX files, and debug your target program. µVision2 for Windows™
Integrated Development Environment: combines Project Management, Source Code
Editing, and Program Debugging in one powerful environment.
C51 ANSI Optimizing C Cross Compiler: creates relocatable object modules from
your C source code,
A51 Macro Assembler: creates relocatable object modules from your 8051
assembler source code,
BL51 Linker/Locator: combines relocatable object modules created by the compiler
and assembler into the final absolute object module,
LIB51 Library Manager: combines object modules into a library, which may be used
unsigned int i=0,k=0,amount=0,number=0;unsigned char m=0,str[5],a[13],b[4],amt[4],seats[3],j=0;unsigned char *tx_dat,*wr_dat,wr_val[6],wr[21];unsigned int x1=0,x2=0,a1=0,a2=0,b1=0,b2=0,l=0,n=0;/***************************************************************/
Power supplyA power supply (sometimes called a power supply unit or PSU) is a device or system that supplies electrical or other types of energy to an output load or group of loads. The term is most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely to others.
Electrical power supplies
This term covers the mains power distribution system together with any other primary or secondary sources of energy such as:
Conversion of one form of electrical power to another desired form and voltage. This typically involves converting 120 or 240 volt AC supplied by a utility company (see electricity generation) to a well-regulated lower voltage DC for electronic devices. For examples, see switched-mode power supply, linear regulator, rectifier and inverter (electrical).
Batteries Chemical fuel cells and other forms of energy
storage systems Solar power Generators or alternators (particularly useful in
vehicles of all shapes and sizes, where the engine has rotational power to spare, or in semi-portable units containing an internal combustion engine and a generator) (For large-scale power supplies, see electricity generation.) Low voltage, low power DC power supply units are commonly integrated with the devices they supply, such as computers and household electronics.
Constraints that commonly affect power supplies are the amount of power they can supply, how long they can supply it for without needing some kind of refueling or recharging, how stable their output voltage or current is under varying load conditions, and whether they provide continuous power or pulses.
The regulation of power supplies is done by incorporating circuitry to tightly control the output voltage and/or current of the power supply to a specific value. The specific value is closely maintained despite variations in the load presented to the power supply's output, or any reasonable voltage variation at the power supply's input. This kind of regulation is commonly categorised as a Stabilized power supply.
A computer power supply typically is designed to convert 110-240 V AC power from the mains, to several low-voltage DC power outputs for the internal components of the computer. The most common computer power supplies are built to conform to the ATX form factor. The power rating of a PC power supply is not officially certified and is self-claimed by each manufacturer. The more reputable makers advertise "True Wattage Rated" to give consumers the idea that they can trust the wattage advertised.
Domestic mains adapter
A linear or (rarely) switched-mode power supply (or in some cases just a transformer) that is built into the top of a plug is known as a "wall wart", "power brick", "plug-in adapter", "adaptor block", "AC adaptor" or just "power adapter". They are even more diverse than their names; often with either the same kind of DC plug offering different voltage or polarity, or a different plug offering the same voltage. "Universal" adaptors attempt to replace missing or damaged ones, using multiple plugs and selectors for different voltages and polarities.
Because they consume standby power, they are sometimes known as "electricity vampires" and may be plugged into a power strip to allow turning them off. Expensive switched-mode power supplies can cut off leaky electrolyte-capacitors, use powerless MOSFETs, and reduce their working frequency to get a gulp of energy once in a while to power for example a clock, which would otherwise need a battery.
This type of power supply is popular among manufacturers of low cost electrical items because
1. Devices sold in the global marketplace don't need to be individually configured for 120 volt or 230 volt operation, just sold with the appropriate AC adapter.
2. The device itself doesn't need to be tested for compliance with electrical safety regulations. Only the adapter needs to be tested.
Linear power supply
A simple AC powered linear power supply usually uses a transformer to convert the voltage from the wall outlet (mains) to a different, usually a lower voltage. If it is used to produce DC a rectifier circuit is employed either as a single chip, an array of diodes sometimes called a diode bridge or Bridge Rectifier, both for fullwave rectification or a single diode yielding a half wave (pulsating) output. More elaborate configurations rectify the AC voltage at first to pulsating DC. Then a capacitor smooths out part of the pulses giving a type of DC voltage. The smaller pulses remaining are known as ripple. Because of a fullwave rectification they occur at twice the mains frequency (in USA it's
60 Hz doubled to 120 Hz - or the UK, it's 50 Hz, doubled to 100 Hz). Finally, depending on the requirements of the load, a linear regulator may be used to reduce the ripple sometimes also allowing for adjustment of the output to the desired but lower voltage. More elaborate versions used by circuit designers are adjustable up to 30 volts and up to 5 amperes output. These often employ current limiting. Some can be driven by an external signal, for example, for applications requiring a pulsed output.
In the simplest case a single diode is connected directly to the mains and uses a resistor in series with a more or less fixed load to recharge a battery. This circuit is common in rechargeable flashlights.
Switched-Mode power supply
A switched-mode power supply (SMPS) works on a different principle. AC mains input is directly rectified, obtaining DC voltage. Then this voltage is changed back to AC by using electronic switches, but with a much higher frequency (typically 10 kHz — 1 MHz). Higher frequencies require smaller transformers. Then on the transformer secondary the AC is again rectified to DC. To keep output voltage constant, the power supply needs a sophisticated feedback controller - typically a single IC chip.
Polarity
Diagram explaining standard symbols for polarity.
AC-to-DC adaptors have polarity (positive or negative). It is necessary to use an adaptor with the correct polarity to avoid damage.
Uninterruptible power supply
An Uninterruptible Power Supply (UPS) takes its power from two or more sources simultaneously. It is usually powered directly from the AC mains, while simultaneously charging a storage battery. Should there be a dropout or failure of the mains, the battery instantly takes over so that the load never experiences an interruption. Such a scheme can supply power as long as the battery charge suffices, e.g., in a computer installation, giving the operator sufficient time to effect an orderly system shutdown without loss of data. Other UPS schemes may use an internal combustion engine or turbine to continuously supply power to a system in parallel with power coming from the AC mains. The engine-driven generators would normally be idling, but could come to full power in a matter of a few seconds in order to keep vital equipment running without interruption. Such a scheme might be found in hospitals or telephone central offices.
Power conversion
The term "power supply" is sometimes restricted to those devices that convert some other form of energy into electricity (such as solar power and fuel cells and generators). A more accurate term for devices that convert one form of electric power into another form (such as transformers and linear regulators) is power converter. The most common conversion is AC-DC. This is a conversion from the household current AC, to the DC current that is used in your car, and most electronics.
Mechanical power supplies
Flywheels coupled to electrical generators or alternators
There are many types of power supply. Most are designed to convert high voltage AC mains electricity to a suitable low voltage supply for electronics circuits and other devices. A power supply can by broken down into a series of blocks, each of which performs a particular function.
For example a 5V regulated supply:
Each of the blocks is described in more detail below:
Transformer - steps down high voltage AC mains to low voltage AC. Rectifier - converts AC to DC, but the DC output is varying.
Smoothing - smoothes the DC from varying greatly to a small ripple. Regulator - eliminates ripple by setting DC output to a fixed voltage.
Power supplies made from these blocks are described below with a circuit diagram and a graph of their output:
Some electronic circuits require a power supply with positive and negative outputs as well as zero volts (0V). This is called a 'dual supply' because it is like two ordinary supplies connected together as shown in the diagram.
Dual supplies have three outputs, for example a ±9V supply has +9V, 0V and -9V outputs.
Transformer only
The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not suitable for electronic circuits unless they include a rectifier and a smoothing capacitor.
Transformer + Rectifier
The varying DC output is suitable for lamps, heaters and standard motors. It is not suitable for electronic circuits unless they include a smoothing capacitor.
Transformer + Rectifier + Smoothing
The smooth DC output has a small ripple. It is suitable for most electronic circuits.
Transformer + Rectifier + Smoothing + Regulator
The regulated DC output is very smooth with no ripple. It is suitable for all electronic circuits.
Transformer
Transformers convert AC electricity from one voltage to another with little loss of power. Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in UK) to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There is no electrical connection between the two coils, instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent the core.
Transformers waste very little power so the power out is (almost) equal to the power in. Note that as voltage is stepped down current is stepped up.
The ratio of the number of turns on each coil, called the turns ratio, determines the ratio of the voltages. A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply, and a small number of turns on its secondary (output) coil to give a low output voltage.
turns ratio = Vp
= Np
and power out = power in
Vs Ns Vs × Is = Vp × IpVp = primary (input) voltageNp = number of turns on primary coilIp = primary (input) current
Vs = secondary (output) voltageNs = number of turns on secondary coilIs = secondary (output) current
Rectifier
There are several ways of connecting diodes to make a rectifier to convert AC to DC. The bridge rectifier is the most important and it produces full-wave varying
Transformercircuit symbol
DC. A full-wave rectifier can also be made from just two diodes if a centre-tap transformer is used, but this method is rarely used now that diodes are cheaper. A single diode can be used as a rectifier but it only uses the positive (+) parts of the AC wave to produce half-wave varying DC.
Bridge rectifier
A bridge rectifier can be made using four individual diodes, but it is also available in special packages containing the four diodes required. It is called a full-wave rectifier because it uses the entire AC wave (both positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when conducting and there are always two diodes conducting, as shown in the diagram below. Bridge rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the peak voltages). Please see the Diodes page for more details, including pictures of bridge rectifiers.
Bridge rectifierAlternate pairs of diodes conduct,
changing overthe connections so the alternating
directions ofAC are converted to the one direction of
DC.
Output: full-wave varying DC(using all the AC wave)
Single diode rectifier
A single diode can be used as a rectifier but this produces half-wave varying DC which has gaps when the AC is negative. It is hard to smooth this sufficiently well to supply electronic circuits unless they require a very small current so the smoothing capacitor does not significantly discharge during the gaps. Please see the Diodes page for some examples of rectifier diodes.
Single diode rectifierOutput: half-wave varying DC(using only half the AC wave)
Smoothing
Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output.
Note that smoothing significantly increases the average DC voltage to almost the peak value (1.4 × RMS value). For example 6V RMS AC is rectified to full wave DC of about 4.6V RMS (1.4V is lost in the bridge rectifier), with smoothing this increases to almost the peak value giving 1.4 × 4.6 = 6.4V smooth DC.
Smoothing is not perfect due to the capacitor voltage falling a little as it discharges, giving a small ripple voltage. For many circuits a ripple which is 10% of the supply voltage is satisfactory and the equation below gives the
required value for the smoothing capacitor. A larger capacitor will give fewer ripples. The capacitor value must be doubled when smoothing half-wave DC.
Smoothing capacitor for 10% ripple, C =
5 × Io Vs × f
C = smoothing capacitance in farads (F)Io = output current from the supply in amps (A)Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC
f = frequency of the AC supply in
Regulator
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection').
Many of the fixed voltage regulators ICs have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown on the right. They include a hole for attaching a heatsink if necessary.
Zener diode regulator
For low current power supplies a simple voltage regulator can be made with a resistor and a zener diode connected in reverse as shown in the diagram. Zener diodes are rated by their breakdown voltage Vz and maximum power Pz (typically 400mW or 1.3W).
The resistor limits the current (like an LED resistor). The current through the resistor is constant, so when there is no output current all the current flows through the zener diode and its power rating Pz must be large enough to withstand this.
Choosing a zener diode and resistor:
1. The zener voltage Vz is the output voltage required 2. The input voltage Vs must be a few volts greater than Vz
(this is to allow for small fluctuations in Vs due to ripple) 3. The maximum current Imax is the output current required plus 10% 4. The zener power Pz is determined by the maximum current:
Pz > Vz × Imax 5. The resistor resistance: R = (Vs - Vz) / Imax 6. The resistor power rating: P > (Vs - Vz) × Imax
RS-232In telecommunications, RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment). It is commonly used in computer serial ports. A similar ITU-T standard is V.24.
Scope of the standard
The Electronic Industries Alliance (EIA) standard RS-232-C as of 1969 defines:
Electrical signal characteristics such as voltage levels, signaling rate, timing and slew-rate of signals, voltage withstand level, short-circuit behavior, maximum stray capacitance and cable length.
Interface mechanical characteristics, pluggable connectors and pin identification.
Functions of each circuit in the interface connector.
zener diodea = anode, k = cathode
Standard subsets of interface circuits for selected telecom applications.
The standard does not define such elements as
character encoding (for example, ASCII, Baudot or EBCDIC)
the framing of characters in the data stream (bits per character, start/stop bits, parity)
Protocols for error detection or algorithms for data compression.
Bit rates for transmission, although the standard says it is intended for bit rates lower than 20,000 bits per second. Many modern devices support speeds of 115,200bps and above.
Power supply to external devices.
Details of character format and transmission bit rate are controlled by the serial port hardware, often a single integrated circuit called a UART that converts data from parallel to serial form. A typical serial port includes specialized driver and receiver integrated circuits to convert between internal logic levels and RS-232 compatible signal levels.
CONCLUSION
In terms of complexity embedded systems can range from very simple with a single
microcontroller chip, to very complex with multiple units, peripherals and networks
mounted inside a large chassis or enclosure, but the project falls under the former
category making it very simple to analyze.
This embedded system often resides 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,