Introduction to Physical Computing
One of the most interesting and exciting areas in computer science is Physical Computing.
It combines computing with electronics, mechanics, and materials to create something new—the tangible world we live in.
This article has been developed specifically for beginners who are looking for an understanding of concepts related to Physical Computing!
What is Physical Computing?
Physical computing is the idea that computers or computing devices, and other electronic devices, can be made portable and used in the real world. Examples of physical computing include sensors that can sense their environment and then control lights, appliances and even entire buildings.
Physical computing is a hands-on approach to creating systems that use computing devices, sensors, and actuators. It involves building circuits, soldering, and figuring out how to best use various technologies to extend human capabilities.
So physical computing takes us away from just being confined to the traditional monitor or display, and into a world where we connect various electronic devices together, controlled by some form of programmable unit. These systems are sometimes called Embedded Systems, as they are embedded in a particular environment, to do limited tasks.
The following diagram shows how sensor information could feed into a computing device, where the data is then analyzed. Based on that analysis, the computing device can then decide how to activate the connected actuators to perform any required tasks.
Why learn Physical Computing?
One of the more interesting aspects of physical computing is that it pushes us to build and create rather than simply consume. The skills you learn from physical computing can be applied in any field, such as engineering, art, or design. Physical computing takes us to a world where we can connect the digital and physical worlds together seamlessly.
Physical computing allows us to be more aware of our surroundings. Whether it is a simple light sensor that turns on and off when the room gets dark or a device that lets you know if someone is at your door, physical computing is a great way to make the world around you more aware of your presence.
Physical computing brings together the knowledge of programming (a common area in computer science) with the knowledge of electronics. It is a far more inclusive form of computing that allows us to integrate multiple knowledge from several disciplines, together.
It’s an art form as much as it is a science. There are so many ways to approach a problem, so many ways to create a system. The possibilities are endless.
Physical computing allows us to be more creative with our projects. We can use it to create anything from a robot that can follow a line or play soccer, to an interactive art piece that reacts when someone walks by.
With a hands-on approach, you will spend a lot of time building circuits, soldering, writing programs, and just generally creating cool things! This type of learning is far more effective as it involves multiple senses as you solve problems in the real world.
How can computers sense and respond to your environment?
Computers can sense and respond to the environment by utilizing various forms of electronics that are built-in or attached to them. We can classify those attached bits of electronics as either sensors or actuators.
A sensor is a device that detects changes in its environment while an actuator is a device that causes changes in its environment. Sensors relay to the computing device information about some physical aspects of the environment. The computing device, can in turn, control actuators to perform some physical real world action.
Sensors
Some typical sensors that you can buy online are things like the ones shown below. Click on each sensor to find out what they do (note: not shown to scale).
The following table shows examples of how some sensors can be used in the real world.
Questions you may ask | Sensor : Example use-case |
Are there dangerous gases in the air? | Gas Sensor: A system to detect leakage of gases at home or on the factory floor |
Is the air temperature too hot or too cold? | Temperature & humidity sensor: Turning air-condition or fan on or off depending on the temperature and humidity of the room. |
Is there a sound when we expect silence? | Microphone: At night, when everyone is asleep, there shouldn’t be much noise. |
How fast are we moving? | Accelerometers: Tracking how fast a remote controlled platform is traveling. |
What direction are we heading with respect to the magnetic North? | Compass: A drone that must maintain its course to a certain bearing/direction as it flies through the air. |
What can we see? | Camera: An autonomous car that needs to understand its environment. |
Actuators
Actuators come in various forms too. Click on the following sample images of actuators to find out what they are (note: not shown to scale).
The following table shows some examples of actuators and how they may be used in the real world:
What would you like to do? |
Actuator: |
Start or stop an exhaust fan |
Relay: |
Unlock a door |
Solenoid valve: |
Display some information on a screen |
LCD screen: |
Sound an alarm |
Speaker: |
Spin-up drone fans to speed up a climb |
DC motor: |
What are microcontrollers?
Microcontrollers are small, low-power computers (read: can use batteries!) that are the ‘brain’ of a physical computing system. They are used in a wide variety of applications, from automobiles to consumer electronics. Microcontrollers typically have a limited number of features, but they are very efficient and can be used for a wide variety of tasks.
Just like any computer, microcontrollers need to be programmed by someone so that it can interact with whatever sensors and actuators it might be connected to. They usually have a limited program running on them, and they are typically programmed using a programming language. This often makes them difficult to use for beginners, but with the right resources, they can be a great way to learn about computing.
The following shows some examples of common microcontrollers that are placed on a piece of board, called Printed Circuit Board (PCB), that can be easily ordered online (note: not shown to scale). They are usually no bigger than the palm of your hand. Click on the images to find out what they’re called.
What programming languages are used to program microcontrollers?
A typical computer science student would probably learn over 10 types of computer languages over the course of their studies. Some of the more famous ones are languages called C, C++, Python, JavaScript, Visual Basic, C#, and so on. These are all human-enough languages that programmers or coders can use to control how a computer should behave. On a modern PC where resources like memory and graphics capability are aplenty, coders can write complex programs without worrying about running out of those resources.
In the microcontroller world, however, resources are extremely limited. Microcontrollers have much less memory, storage, processing power, and graphical capability than your average PC or mobile phone. Because of this limitation, programmers need to be very mindful of how they use these limited resources. One way that vendors of these microcontrollers do is to design their programming languages to be as efficient and effective as possible. This often means that the programming languages used are a subset of the original computer language designed for PCs.
Some examples of computer languages commonly used for various microcontrollers …
- Arduino – C++
- ARM Cortex – C++
- Micro:bit – C, Scratch, and JavaScript (for Web)
- Particle Core – Javascript, C++, and Basic (for Web)
- Intel Edison/Galileo – C and Python
- BeagleBone Black – C and Java
How are microcontrollers programmed?
Programmers use software or development tools to create programs for microcontrollers. These tools allow them to write and test (called debugging) their code. They also provide functionality to convert code written in one of the computer languages, into a series of ones and zeros (called binary) that can be understood directly by the microcontroller. This process is called ‘compiling’.
These development tools generally run on PCs. Once the code is deemed ready by the programmer to be transferred to the microcontroller, they will then connect their PC to the development boards shown earlier. These connections are typically via USB or some other connecting technology.
The following picture shows how an Arduino is connected to a laptop via a USB cable.
In conclusion
Computing is a very complex subject. It has many different branches, each with their own complexities and quirks. Physical computing is an interesting branch of this topic because it focuses on the physical aspects of the computer and how they can be used to solve problems. It is a very hands-on subject that will require students and hobbyist to get their feet wet with electronics, mechanics, and programming.