Let's address the obvious problem.
A robot that needs a laptop sitting next to it isn't really a robot. It's a very expensive remote control. Even the thinnest laptop on the market — say, an Asus Zenbook A14 — weighs over 2.5 lbs and measures 13×9 inches. That's not riding inside a robot. That's the robot riding inside a carry-on bag.
What we need is a way to squeeze all of that computing power into something that weighs 0.09 lbs and measures 3.4×2.3 inches.
Meet the Raspberry Pi 3B.
A Very Brief History (Bear With Us — It Actually Goes Somewhere)
Every computer you've ever used — HP desktop, Dell tower, iMac, MacBook, Lenovo ThinkPad — shares one thing in common: it runs an operating system.
Here's why that matters.
Early computers were built to do one thing. Like a calculator: give it numbers, get a result. But human needs kept growing. Eventually people wanted one machine that could handle everything at once — play music, run a word processor, open a spreadsheet, all simultaneously. That created a new problem: something needed to manage all of that traffic inside the machine. Something needed to be in charge.
That something is the operating system — the software layer that sits between the hardware and everything running on top of it. Without it, a computer is just an expensive paperweight.
Today there are four main families:
- Unix — servers and academic/engineering workstations
- macOS — Apple's universe
- Windows — Microsoft's universe
- Linux — open-source, runs on everything from supercomputers to smart fridges
Which brings us back to our tiny robot brain problem. A Raspberry Pi is too small for Windows or macOS. So it runs its own flavor of Linux called Raspberry Pi OS. Same idea, built for a credit-card-sized computer.
So What Exactly Is a Raspberry Pi?
In our CEO → Manager → Team Leader → Workers diagram, the Raspberry Pi takes over the CEO role entirely. Everything that used to live on the laptop — the Python programs, the decision-making logic, the commands to motors and sensors — now lives on a board the size of a deck of cards.
The Pi combines a processor, memory, and programmable input/output pins into one compact package. It can talk directly to motors, sensors, and cameras without a laptop anywhere in the loop.
In Phase 1, we used the laptop as CEO and Arduino Nano as Manager. From here on:
CEO + Manager (Python on Raspberry Pi) → Team Leader (Driver module) → Workers (Motors/Sensors)
The laptop's only job now is to set up the Pi. Once that's done, we can unplug and walk away. The robot thinks for itself.
What You Need
| Component | Notes | Est. Cost |
|---|---|---|
| Laptop | For setup only | Already owned |
| Raspberry Pi 3B | ~$50 | |
| MicroSD card (32GB or 64GB) | The Pi's "hard drive" | ~$18 |
| Portable USB Power Bank (5V) | Powers the Pi | ~$15 |
Step 1 — Flash the Operating System
The MicroSD card is where Raspberry Pi OS lives. We write it from the laptop using a free tool called Raspberry Pi Imager.
👉 Download and install Raspberry Pi Imager on your laptop.
👉 Insert the MicroSD card into your laptop.
👉 Open Raspberry Pi Imager:
- Choose OS → select the Recommended option
- Choose Storage → select your MicroSD card
👉 Before writing, click the settings gear icon and configure:
- Hostname: anything you'll remember — e.g.
pi3 - Enable SSH → Use password authentication
- Username and password: e.g. username
pi3, passwordraspberry— write these down, you'll use them constantly - Configure wireless LAN: enter your home WiFi name and password so the Pi connects automatically on first boot
👉 Click Write and wait. Done.
Step 2 — Boot the Pi and Find Its IP Address
👉 Insert the MicroSD card into the Raspberry Pi 3B. Connect power via the micro-USB port.
👉 Wait 1–2 minutes for the Pi to boot and connect to your WiFi.
👉 Now we need to find the Pi's IP address. The easiest way: download Advanced IP Scanner (free, no installation required — just run it).
Open Advanced IP Scanner, accept the terms, click Scan. After a moment, it lists every device on your network. Look for the hostname you just set — pi3 — and note its IP address. Something like 192.168.1.42.
👉 Before moving on, download and install PuTTY on your laptop (Windows users). Mac and Linux users already have everything they need.
Step 3 — Connect via SSH
SSH lets you type commands on your laptop that actually run on the Pi. No physical keyboard or monitor attached to the Pi needed.
On Windows (PuTTY):
Open PuTTY → enter the Pi’s IP address in Host Name → connection type SSH → port 22 → click Open.
On macOS / Linux (Terminal):
ssh pi3@192.168.1.42
(Replace with your actual username and IP.)
When prompted for a password, type it and press Enter. The cursor won’t move while you type — that’s normal, it’s a security feature. Hit Enter and you’re in.
You should see something like:
pi3@raspberrypi:~ $
That blinking cursor is your Pi, ready for instructions.
Step 3B — Enable VNC (Required for Remote Desktop)
SSH gives you a command line. If you want a full desktop view of the Pi on your laptop screen — mouse, icons, Thonny IDE — you need VNC enabled first.
Still in your SSH session, run:
sudo raspi-config
→ Interface Options → VNC → Yes → Finish
Then restart the VNC service:
sudo systemctl enable vncserver-x11-serviced
sudo systemctl start vncserver-x11-serviced
👉 Download and install VNC Viewer on your laptop (RealVNC, free).
Open VNC Viewer → enter the Pi’s IP address → log in with your username and password. You’ll see the Raspberry Pi desktop streamed directly to your laptop screen.
Important: If VNC Viewer shows “Timed out waiting for a response” — go back to SSH and run the two systemctl commands above. That fixes it.
Step 4 — Set Up Python the Right Way
This step matters more than it looks. How you set up the Python environment determines whether installing libraries later is smooth or painful.
First, update the system:
sudo apt update && sudo apt upgrade -y
Install pip and venv tools:
sudo apt install -y python3-pip python3-venv
Create the virtual environment — with one important flag:
python3 -m venv my_project_env --system-site-packages
source my_project_env/bin/activate
The --system-site-packages flag is critical. It lets your virtual environment access system-level libraries — like picamera2, libcamera, and RPi.GPIO — that can only be installed via apt, not pip. Without this flag, you’ll hit “No module named picamera2” or “No module named libcamera” errors later, even after installing everything correctly.
When you see (my_project_env) at the start of the command line, the environment is active.
How to Install Libraries — The Right Way for Pi
Rule 1: Always use SSH for installing libraries, not the Thonny terminal. SSH is stable and always uses the correct environment. Thonny’s terminal can behave unexpectedly with virtual environments.
Rule 2: Always activate the venv first:
source my_project_env/bin/activate
Rule 3: System libraries go through apt, Python libraries go through pip:
# System-level libraries (hardware, camera, GPIO)
sudo apt install -y python3-picamera2 python3-opencv libopenblas-dev
# Python libraries
pip install numpy opencv-python-headless pyserial
Rule 4: Verify after installing:
python3 -c "from picamera2 import Picamera2; import cv2; import RPi.GPIO as GPIO; print('All OK')"
A note on heavy libraries like PyTorch / Ultralytics:
Pi 3B runs a 32-bit ARM processor with only 1GB RAM. PyTorch has no official 32-bit ARM build — attempts to install it via pip will fail or hang midway through a 400MB+ download. For computer vision on Pi 3B, use OpenCV + picamera2 instead. Lightweight, fast, and works out of the box. We’ll cover this in Part 15.
Step 5 — Optional: VNC for a Visual Interface
If command-line feels uncomfortable, VNC gives you a full desktop view of the Pi — mouse, icons, the works — streamed directly to your laptop screen.
👉 Download and install VNC Viewer on your laptop (RealVNC, free).
👉 Open VNC Viewer → enter the Pi's IP address → log in with your username and password.
You'll see the Raspberry Pi desktop as if you were sitting in front of a monitor connected to it.
Once libraries are installed via SSH, open VNC Viewer → connect to the Pi → find Thonny at:
Menu (raspberry icon, top-left) → Programming → Thonny Python IDE
Before running any code in Thonny, make sure it’s using the right Python interpreter:
Tools → Options → Interpreter → Select: my_project_env/bin/python3
This ensures Thonny uses your virtual environment — with all the libraries you installed — rather than the system Python.
Write code, press F5 to run. Everything else works exactly like PyCharm did on your laptop.
What Just Happened
No code was written in this part. No motors turned, no sensors blinked.
But something important happened: the robot's brain moved.
Everything that used to live on the laptop — the Python environment, the decision-making, the ability to control hardware — now lives inside a board smaller than a credit card, powered by a USB power bank, sitting on the robot itself.
The laptop's job is done. It set up the Pi and can now walk away.
In the next part, we connect the C101 4WD kit to the Pi via L298N and write Python directly on the Pi to drive the car. No laptop in the loop. No USB cable. No Arduino middleman.
The robot is about to move on its own.
Next up: Part 13 — Four wheels, one brain. The C101 meets the Raspberry Pi.