Tuesday 10 May 2016

Raspberry Pi: A computer that fits into a pocket

I assume that most modern kitchens are equipped with some kind of a food processor to do all the hard work. Mine doesn't. I don't even own a microwave oven but as like 85% of my cooking involves frozen pizza, I don't need all that fancy stuff.

However, my retro kitchen doesn't survive without its own multipurpose machine. In digital electronics development there are equipment that is absolutely essential, like the power source, the programmer for the microcontroller and the oscilloscope for debugging, just to name few. Separately these would cost an assload of money which I can't afford on a short time scale. Because I'm broke. Luckily, I don't have to.

The Raspberry Pi logo
The Raspberry Pi is a small but fully functional computer which
is surprisingly powerful for its size and price. Especially intended for learning and DIY purposes, it is equipped with a bunch most commonly used ports and connectors, making it very versatile for a wide variety of uses. People have made use of it from the living room's media center to robotics and even a small scale computing cluster. It runs an operating system called Raspbian practically out-of-the-box which as Linux-based is in my opinion the most suitable platform for programming. In addition to costing less than a long night in the pub, it is ideal for my project's needs.


I got myself a Model 2 a few months ago. My original purpose was to use it as the heart and soul of a yet-to-be-built automatic flower watering system. I thought it would be nice and simple to use the Pi to control the water valve and monitor the water level but soon I realised how fucking stupid that would have been. Not that it wouldn't work but because it would have been a total waste of the Pi's capabilities. Oh yes, I would have made it to send me email every time the water reservoir runs too low but other than that there's nothing a simple microcontroller wouldn't do. In fact, an analog clock would perform just fine if one just attaches a suitable sensor or a switch to its hour hand.

Raspberry Pi 2 Model B with various features and ports labelled. Lots of cool shit in a small package, no?

Just like a full sized computer, Raspberry Pi is packed with commonly used ports, such as USB for connecting the mouse and the keyboard (and something like 98.6% of all other connectable devices), an Ethernet port for the Internet connection, both digital and analog audio and video outputs, and a slot for a Micro SD card which functions as a hard drive. In addition there are connectors for a display and a camera specifically designed for the Pi and the whole package is powered via micro USB connector.

However, for my project the most important part in the general-purpose input/output a.k.a. the GPIO pins. As the name suggests, these pins can be programmatically set either to produce or read digital signal. The generation of the digital output is the key factor in the programming of microcontrollers as it transfers the instructions from the computer to the memory of the microcontroller. I will cover microcontrollers and their programming in more detail in the next posts.

Another practical use of the signal generation is to simulate the behavior of the unfinished parts of the circuit with it. For example, we could want to test whether the system reacts to the controller input as desired but we don't have functional controllers yet. A simple way to go around this is to write a small program on the Pi that produces the same kind of signal that a controller would and test the circuit with it. Conversely, we can use the Pi's GPIO pins as input and see if the signal produced by some part of the circuit is the way it should be. Some of the GPIO pins act as voltage sources (+3.3 and +5 volts) which can power up our circuit in the building phase.

The Raspberry Pi is truly an amazing device and without it I wouldn't probably be writing this blog. Later on I'll show you how it can be used for programming but first I want to talk about microcontrollers and microprocessors and their role in the gaming systems.

More info:

No comments:

Post a Comment