Skip to main content

Input vs output

A system is only limited if it performs operations on constant things, meaning that it's not worth the hassle to use a microcontroller to print the number 5 forever, to add the numbers 2 and 6 for the rest of its lifetime, to turn a buzzer on indefinitely.

You also don't want it to work randomly. You don't buy and use a microcontroller if you expect it to randomly turn on the buzzer or calculate the sum of any two random numbers.

The best thing a microcontroller gives you is control, and this control is given to you through the privilege of interacting with your device.

This interaction is presented to you through the concepts of inputs and outputs.

Input signals

An input to a system can be:

  • Inputted data: like the different numbers I want to calculate the sum of.
  • Signals: like a signal coming from an input device that tells the microcontroller I want the buzzer to turn on at this exact moment.

The most common input signal sources with microcontrollers are sensors!

Sensors are electronic components that sense specific things and send a signal to the microcontroller accordingly. For example, a motion detection sensor gives a signal when someone or something moves around it. This signal is considered an input signal to the connected microcontroller. The same things apply to input components like push buttons or switches, when they're pressed, an input signal is sent to the microcontroller.

Motion Detection Sensor

Output signals

An output from a system can be:

  • Results: data like the result of the addition of the entered numbers.
  • Signals: like the signal sent to the buzzer to turn on.

Output devices can be as simple as LEDs or as complicated as motors, but the concept of outputting remains the same. For example, a traffic light requires a microcontroller to generate a signal to the red LED for a period of time, then generate a signal to the yellow LED for a period of time, do the same for the green LED, then repeat the whole process all over again.

LED MOTOR

So, to sum up, in a system where we have a push button and an LED connected to a microcontroller where pushing the button turns the LED on, the push button is an input device that sends a signal to the microcontroller, and the LED is an output device that receives a signal from the microcontroller that turns it on.

If you're still a bit confused about which is which, think of this example: in a computer (which is a bigger microcontroller), we use a keyboard to write into the computer, and a speaker to listen to music that comes out of the computer. In this example, a keyboard is considered an input device and a speaker is considered an output device.

Similarly, any device or peripheral you use to write to the Tamra board is an input device and any device you use to see the results coming out of the microcontroller is an output device.