by Sean Choi

A Beginner’s Introduction to Raspberry Pi

It’s the little things that count.

1*rD9cweBR5NdgFg-l8koTOQ
Raspberry Pi 3 Model B+

Many question what the term Internet of Things (IoT) means or what it actually represents. In simple terms, IoT is a term for categorizing anything that can connect to the Internet. This includes your Alexa, HomePod, Android watch, Samsung smart refrigerator and many more. Even if you realize that IoT is a term meant to describe a group of little devices that connect to the Internet that talk to each other, it is still rather unclear how these little devices actually do what they do.

In contrast, everyone knows generally what a Macbook or a computer does and what they are capable of doing. Interestingly, the internals of these IoT devices are very similar to the computers that we use everyday, which includes a processing unit, memory, network and/or bluetooth module and some other sensors.

What many people don’t realize is how easy it is to make your own IoT device using a small computer. In fact, you might wonder if there even exists a readily available, cheap, and powerful small computer. The good news is that it actually exists and it’s really powerful.

Raspberry Pi is EXACTLY That.

1*GzvXMi0Yw0nq3tMRkoSyWQ
Raspberry Pi 3 (raspberrypi.org)

Raspberry Pi is a small computer that fits snugly in your hand. Don’t be fooled by it’s size and just look at the hardware specs for the latest (3+) generation Raspberry Pi.

  • 1.4 GHz 64-bit quad-core ARM Cortex-A53, 1GB RAM
  • 2.4/5Ghz dual band 802.11ac Wireless LAN, 10/100/1000Mbps Ethernet
  • Bluetooth 4.2
  • 4 USB ports, Full HDMI port, Combined 3.5mm audio jack and composite video port, 40 GPIO pins
  • Micro SD card slot, VideoCore IV 3D graphics core, Camera interface (CSI), Display interface (DSI),

As you can see, this little beast houses a Quad-Core CPU, fast wireless, bluetooth module and enough RAM to do most things you do on your computer. Better yet, this only costs $35, or about a reasonable dinner out (or 3 avocado toasts in SF).

Raspberry Pis have an interesting naming convention. They are categorized by a combination of model name and generation. The model names include A, A+, B, B+, Zero and Compute Module (Compute Module is intended mainly for industrial applications, so we won’t touch on it in this article).

Each model is differentiated by available connectors and the size of the main board. There are various generations built so far, which are largely categorized by numbers from 1 to 3. Each generation is mainly differentiated by the chip performance. The latest and the most powerful version is called Raspberry Pi 3+ Model B+.

As a reference, here are some images that show what parts are available in each of the models.

1*sgjYyv_QE0J8ZHyh48mCiQ
Raspberry Pi Model Zero
1*Zm0VfWGhkxG_wJPyMTXvNA
1*E4pQ7ipQ7hGuMt2kstmORQ
Raspberry Pi 1 Model A (left), Raspberry Pi 1 Model A+ revision 1.1 (right)
1*t0OXJ9YgOHEDDPYn63yPxg
1*fdW23Z7okJlTkNMyqqT9vQ
1*NjVZqwr3uKVZu_nd1f5d3g
Raspberry Pi 1 Model B (left), Raspberry Pi 1,2 Model B+ (middle), Raspberry Pi 3Model B+ (right)

Each model has it’s own tradeoffs. For example, Raspberry Pi Model Zero is the smallest of them all and consumes only 100 mA (0.5W) of power on average. (An average desktop houses a 200~1400W power supply). But, it only houses a single-core CPU, has lower RAM, and lacks a full HDMI port.

However, its smaller size allows it to fit into more spaces, which makes it useful for building devices that are space- and power-constrained. So, having multiple models to choose from increases your options for your project.

What software does it run?

Unfortunately, Raspberry Pi does not run Mac OS X or Windows. Instead, it runs a version of Linux called Raspbian. You can choose to install Raspbian on a micro SD card yourself with NOOBS installer, or purchase a pre-loaded micro SD card like one seen here. Once you plug in the micro SD card with Raspbian installed and turn on the Raspberry Pi, you get the following loading screen:

1*HBm9igWAM0uNQJdViGyGag
Raspbian loading screen. Image from https://alternativeto.net/software/raspbian/

As you can see, the desktop looks just like a regular desktop on your large PC. By default, you get a web browser, terminal, image viewer, calculator and many more features.

Raspbian also lets you install tons of software from it’s own open source software repository at no cost. The process of installing a software is also quite simple. You can utilize the apt-get command, a popular Linux command to install software from various repositories, to install any available software.

For example,sudo apt-get install scratch2 will install the popular scratch programming language. Browse around various repositories and StackOverflow, and you will soon realize you can do just about anything with these devices.

What can you ACTUALLY do with this?

Ok, so now you have a small computer that runs a bunch of free software. What can you actually do with it? Well, here’s an easy and fun Python project that I have implemented with a group of middle school students as part of a coding class.

Using a Raspberry Pi compatible temperature/humidity/pressure sensor with LED screen, I taught the concept of randomness using random colors on the LED screen rather than numbers. My students loved how they could visually and physically interact with their own code. You can see the video of the project here:

Using the same device, we also built a calculator, gaming device, weather station and much more. I found them a very useful and cost efficient way to teach introductory programming to young students. I plan to cover the details of my curriculums in an article some other time.

One of my colleagues at Stanford built a customized Raspberry Pi secured espresso machine to protect our precious coffee. The idea is somewhat similar to a Raspberry Pi secured door lock as seen here.

1*6oZ2WsV6LCygftHXzgbcig
Raspberry Pi secured door lock by HackerHouse

There are many, many articles on using a Raspberry Pi to build fun and useful IoT devices. Here are some list of them I found: Raspberry Pi Security Camera, Raspberry Pi Media Center, Raspberry Pi Code Club.

Wrapping up

I hope this article gives some basic insights on what Raspberry Pis are, how they are built and what they are used for. Also, I hope this article somewhat demystifies what IoT really means.

In essence, IoT is a movement to connect millions of little things using the Internet, and Raspberry Pi is one of the ways to power those little things. I truly believe that the future lies in IoT and I hope everyone try to participate in bringing it a step closer to us.

It’s the little things that count, hundreds of ’em.
— Cliff Shaw.

This is my first article on Medium! Any comment for corrections, improvements and applauses is greatly appreciated!