Source Code. Projects. Nerd Stuff. Art Stuff.

What Is a Microcontroller?

A microcontroller is a small, inexpensive computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory is also often included on chip, as well as a typically small amount of RAM for executing code. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications.

Microcontrollers are often used for sensing input from the real world and controlling devices based on that input. Many electronic devices have microcontrollers in them, especially automatically controlled devices such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other embedded systems. Microcontrollers are easy to use with simple sensors and output devices, and they can communicate with desktop computers fairly simply as well. When you’re building some form of customized sensor or output device, using a microcontroller is an excellent way to separate the customized part of your project from the part that’s best done on a desktop computer. They’re also very useful for when you’re designing a simple interactive device that doesn’t need the full power of a desktop computer, but does need to be smaller or cheaper.

Like any other computer, microcontrollers have input ports to detect action by a user, and output ports through which it expresses the results of its programs (you’ll notice these as the pins sticking out of the microcontroller). Other devices, such as sensors for detecting light, heat, or motion (transducers), or motors, lights, or other sound devices, are attached to these pins to allow the microcontroller read information and provide some kind of response to that information.

There are low-level microcontrollers, which are generally very small, chip-size devices to which you have to connect your own electronics, as well as higher level microcontrollers, which are oftentimes larger, composed of several components and ports for input output, and which are ready to plug right into other devices. Higher level microcontrollers usually have a simple hardware interface to other devices (usually a plug or a couple of wires), and a simpler programming language, if at all. They will also usually be the most expensive of microcontrollers, because much of the low-level coding and wiring has been done in an effort to simplify and “hide” these aspects from the user. Lower level microcontrollers will require more work, both in terms of hardware connections (you will have to build your own circuits to interface them to other devices), and in terms of programming (you will need to use a lower level programming language like C or assembler). However, lower level processors are generally cheapest and most flexible in terms of what you can make them do.

In this class we will primarily be using a Mid-level microcontroller Arduino. For a more detailed list of other microcontroller options, visit this link.

Arduino is easy to work with because it connects directly to the programming computer. Unlike others, though, it has a built-in USB-to-serial interface, so it connect right to your USB port. Beyond that, no additional hardware is needed. Both the software and hardware for Arduno is open-source, with a huge online support community.