A microcontroller is an integrated circuit (IC) that can be programmed to perform a set of functions to control a collection of electronic devices. Being programmable is what makes the microcontroller unique.
Often thought of as a “tiny computer” on a single chip, the microcontroller is used in many applications and can be found in almost every electronic device we encounter daily. In this article, you will learn what makes the microcontroller comparable to the computer. You will also learn why the microcontroller has replaced many relays and solid-state devices in the industry.
Comparison and Contrast of the Microcontroller and the Computer
The microcontroller and the computer share many common components:
- A microprocessor to process instructions.
- Memory locations to store data and programming information.
- Input/output facilities to move data between itself and another device.
See Figure 1. Although the microcontroller and the computer share many common components, there are many distinct differences between them. The major differences between a computer and a microcontroller are
- The limitations of the microprocessor.
- The amount of memory available for data and program manipulation.
- The type of storage available to permanently store a program.
Figure 1. The microcontroller and the computer share similar components.
A microprocessor inside a computer is more powerful and more versatile than that in a microcontroller. The computer’s microprocessor allows the computer to run a variety of programs and applications.
A single computer can be used to perform a variety of functions such as word processing, playing a DVD, playing an interactive game over the Internet, monitoring security systems, and making a CAD drawing.
A microprocessor in a microcontroller has a limited instruction set that allows it to run a specific application. In other words, the microcontroller can only understand a limited number of commands, and these commands are specific to the functions the processor is designed to handle. For example, a microcontroller may be designed specifically to monitor and control a fuel injection system on an automobile.
In fact, every car manufactured today has many microcontrollers incorporated into its electrical system—antilock brakes, fuel control, air conditioning, heating, and keyless security locks. Each microcontroller on a vehicle is designed to handle a specific function.
The microcontroller, like the computer, uses RAM to store programs and data temporarily. The amount of RAM built into a microcontroller is minimal and is usually enough for its intended use. The RAM in a computer is ample enough to run a variety of memory intensive applications.
All computers and microcontrollers must have some sort of ROM that contains a permanent set of instructions so that they can communicate with other devices.
The microcontroller stores in its ROM the program it needs to perform a specific job. The computer has a ROM, called the BIOS, that contains BASIC programming functions. The computer stores the rest of its programs, operating system, and applications, in other storage devices such as a hard drive.
A larger capacity for program storage makes the computer more versatile and powerful than a microcontroller and allows it to run many different programs. Although computers are versatile and powerful, the microcontroller has its advantages.
- Microcontrollers are small and can fit inside other devices like an appliance or a vehicle.
- Microcontrollers cost less to produce, and they consume less power. Microcontrollers are used in almost all types of electronic equipment, from coffeepots to laser printers.
- They are even incorporated into computer systems. They can be found in floppy drives, CD-ROM drives, and video cards.
- A microcontroller is often embedded into the electronic circuit boards of these computer devices.
- A microcontroller is usually a single chip, but when incorporated into a large control system, it is referred to as an embedded controller, Figure 2. An embedded controller often depends on other components in the system, such as additional memory, to perform its function.
- Microcontrollers are also used heavily in industry. They have taken the place of relays, solid-state devices, and other discrete components.
Figure 2. The microcontroller inside this refrigerator contributes to energy and cost savings by monitoring temperature and controlling the compressor. (Courtesy of Motorola, Inc.)
Advantages of Using Microcontrollers in Industry
There are a number of advantages to using microcontrollers in industry. Some of the major advantages of microcontrollers are that they are reusable, dependable, cost-effective, and energy efficient.
The typical microcontroller is programmable, which means it is reusable. This is especially advantageous for prototyping control circuitry.
When developing a complex control system, it is not unusual for it to fail when first applied. As a matter of fact, a complex control project may need to be rewritten and/or rewired many times before it meets design expectations.
The fact that the control circuit can be modified by programming rather than rewiring is very advantageous for fast project prototype development.
Integrated circuits, such as the microcontroller, are much more dependable than relays. Before microcontrollers, control circuitry relied on many electromechanical relays and timers to control the system.
Relays depend on electromagnets to move armature and contact parts, so they eventually wear out due to mechanical friction. Relays are also susceptible to damage caused by dust, dirt, corrosion, rust, insects, and other contaminants that can interfere with the moving parts.
Microcontrollers have no moving parts. This provides a much higher rate of reliability. Relays and high-power transistors can be incorporated for final applications to motors, but the actual timing and control logic does not need to rely on the mechanical action of relays.
Microcontrollers can be produced at lower costs than their electromechanical predecessors. Also, microcontrollers can be reprogrammed if the designed application does not work correctly or if the application for its use changes.
Because the majority of the circuitry is made from integrated circuits, the energy cost of using a microcontroller is much less than if using individual components of a relay-type logic circuit.
Relay logic uses numerous relays wired in series and parallel to form control circuit conditions similar in function to logic gates. A microcontroller consumes less electrical energy than conventional electromechanical devices.
Disadvantages of Using Microcontrollers in Industry
There are a few disadvantages to using microcontrollers. The two most prominent disadvantages are the need for skilled programmers and the sensitivity of the controllers to electrostatic charges.
Special skills are required to program the microcontrollers. This requires a higher level of training for some personnel.
In addition, there are many different programming languages to choose from. This can lead to a compatibility problem when attempting to merge two dissimilar systems into one control system.
Most microcontrollers are composed of complementary metal-oxide-semiconductor (CMOS) integrated circuitry. CMOS can be damaged easily by a static charge. Static precautions must be strictly obeyed.