8.1 Computer vs Microcontroller

Computers. Everyone is familiar with the use of a general purpose computer (eg, a laptop), a simplified block diagram of which is shown below.

A computer is comprised of a central processing unit (CPU)  as well as storage: mass storage for programs and other content, volatile RAM for storing information needed by the CPU during program operation, and ROM for booting the computer. The RAM is volatile, meaning that its contents are emptied when the computer is shut off, whereas the ROM is non-volatile: memory contents are permanently placed into ROM so that they are available to provide boot-up instructions on power-up.  The I/O block contains familiar devices that allow the user to interact with the computer.

Consider the physical space, weight, and power requirements for any computer: the CPU is a single IC chip, which, along with ROM, RAM, and other devices, is installed on a mother-board (circuit board). The other devices are either integrated within the housing, as in a laptop, or are arranged as desk-top peripherals. Current laptops typically weigh 1-2 kg and occupy volumes of, perhaps, 30 cm x 30 cm x 2 cm ~ 2000 cm3.  Laptops are powered by internal rechargeable batteries with typical capacity of 2800 mAh at 14 V, and these batteries are charged using AC adapters that consume ~ 80 W (80 J/s). Laptops typically cost ~ \$1000 – \$2000.

Question: 4 AA batteries wired in series would provide 6 V. With a 10 A current draw, such a battery pack could provide the 60 W draw of a laptop. How long would the batteries last? Answer: One approach is to assume each battery contains 10kJ when new. Four batteries therefore provide 40 kJ and the battery pack would last for 40,000J/(60J/s) =667 s or 11 min. Another approach is to consider rated capacity of an AA battery from a data sheet. These batteries are listed at 1 Ah when drawing 1 A. This would correspond to 1/10 h or 6 minutes when drawing 10 A. These two results, which differ by nearly a factor of two, are not difficult to reconcile when we consider that the Ah capacity of a battery is based on the around of time the battery can deliver power before the voltage cuts-out and drops below ~ 1V. Approximately half the energy remains in the battery at this point, even though it can no longer be used at such a high current.

A microcontroller, or microcontroller unit (MCU) is a small, low-power computer with CPU, memory, and I/O all integrated on single integrated circuit chip. The chip is typically installed on a printed circuit board along with power supply and arrangement of sensors and actuators to form an embedded control system. Such a circuit might draw only a few mA of current, and hence consume energy at a few mJ/s when operated at a voltage level of 5V. The circuit, with power supply and packaging might be smaller than a deck of cards and cost only a few dollars. This is is marked contrast to the larger size, weight, cost, and power consumption of a general purpose laptop computer.

A photograph of the ATmega 328P MCU is shown below. This is the MCU installed in the Arduino Uno development board, which we will be working with for  the remainder of this  book.

Photograph of the Adafruit Trinket microcontroller board. The on-board microcontroller is the ATtiny85 which has 8K of flash memory, 512 byte of SRAM and 512 bytes of EEPROM. This board is an example of a microcontroller development board produced for the making community.