RASPBERRY PI

Photo of author

By Jackson Taylor

Home » Examples » Open Cv » RASPBERRY PI

As an Amazon Associate we earn from qualifying purchases.

The Raspberry Pi is a small, low-cost single-board computer. It is about the size of a deck of cards, yet it runs a full Linux operating system and can be connected to a keyboard, a mouse and a screen like any other computer. Its row of GPIO pins also lets it talk directly to LEDs, sensors, motors and other electronics. That mix makes it a popular board for learning programming, building electronics projects and experimenting with Linux.

This page is a starting point. It explains the basics and collects our Raspberry Pi tutorials, from blinking your first LED to image processing with Python and OpenCV.

Raspberry Pi Model B+

Many of the tutorials here were written on the Raspberry Pi Model B+. It has a 40-pin GPIO header, four USB ports and a microSD card slot that holds the operating system and your files. The diagram below shows the board layout used in our examples.

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video
Raspberry Model B+
Raspberry Pi Model B+ layout diagram

Newer boards have faster processors, more memory and extra features, but the basic ideas are the same. GPIO programming, Linux commands and remote access work in much the same way across models, so most of what you learn here carries over.

What You Need to Get Started

A basic setup needs only a few parts:

  • A Raspberry Pi board
  • A microSD card with Raspberry Pi OS written to it
  • A suitable power supply for your model
  • A keyboard, mouse and HDMI display, or another way to connect remotely
  • Jumper wires, LEDs, resistors and a breadboard if you want to try electronics

Check the power requirements for your specific board before buying a supply. An underpowered supply is a common cause of random crashes and odd behaviour.

Connecting to Your Pi Without a Monitor

You do not need to give the Pi its own screen and keyboard. Many people run it “headless” and control it from another computer over the network. This is often the easiest way to work, because you can use your normal desktop and copy code straight across.

See also
FTP -SENDING FILE BETWEEN WINDOWS AND RASPBERRY PI

If you are starting from scratch, our guide on how to configure WiFi on a Raspberry Pi covers the wireless side. You can also connect your Raspberry Pi to a laptop using SSH, VNC, Ethernet or USB, whichever suits your setup.

Once the Pi is on the network, you still need to know its address. The tutorial below shows how to find it without a display, and the other links cover control from Windows:

Your First Programs: Working With GPIO

The quickest way to see what the Pi can do is to make it control something physical. These tutorials start with an LED and build up from there. Work through them in order if you are new to the board.

When you wire an LED, always put a resistor in series with it. Connecting an LED straight to a GPIO pin can damage the LED or the board. Double-check which pin you are using before powering anything up.

Linux, Files and Other Useful Skills

Because the Pi runs Linux, a little command-line knowledge goes a long way. You will use it to install software, move files and edit code. These guides cover the essentials:

The Pi can also program other microcontrollers, which is handy if you work with small chips and want one low-cost machine to compile and flash them. These two video walkthroughs show how:

Sustainable Tech

Keep Toxic E-Waste Out of Landfills

Don't throw away your failing laptop, phone, or car batteries. Learn how to recondition them at home in just a few hours. It's better for the planet—and your wallet.

Learn How It Works
See also
STM32 BOARDS

Python and OpenCV Examples

Python is the most common language on the Pi, and it is a good first language in its own right. The lessons below start with the basics and move on to email, online data logging and camera work with OpenCV. Once you are comfortable, you can try some of our Raspberry Pi Python projects for more ideas.

Python basics

Advanced Python

Image processing with OpenCV

Python and electronics

These tutorials link Python to external hardware such as Arduino boards, XBee modules and sensors.

Choosing a Board and Where to Go Next

Raspberry Pi makes two quite different kinds of board. The full-size Pi is a small computer that runs Linux. The Pico is a microcontroller board that runs a single program and has no operating system. If you want to blink LEDs and read sensors with very low power use, browse our list of Raspberry Pi Pico projects. If you want a general-purpose computer, a full-size model is the better fit, and our look at whether the Pi 5 can replace a desktop PC covers what to expect.

Frequently Asked Questions

What is a Raspberry Pi used for?

People use it to learn programming, build electronics projects, run small servers, make media players and experiment with Linux. Its GPIO pins make it especially useful for projects that interact with sensors and other hardware.

See also
TIMER OR LED BLINKING

Do I need a monitor to use a Raspberry Pi?

No. Once it is connected to your network you can control it from another computer using SSH for the command line, or VNC for a full desktop view. A monitor is only needed if you prefer to work on the Pi directly.

Which programming language should I use?

Python is the usual choice for beginners and has good support for GPIO and OpenCV. C and C++ also work well, particularly when you want more control over hardware or are programming other chips.

Is a Raspberry Pi the same as an Arduino?

No. A Raspberry Pi is a full computer that runs an operating system, while an Arduino is a microcontroller that runs one program at a time. They work well together, and several of the tutorials above connect the two.

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works