Learn Robotics with Raspberry Pi — Part 1: Overview and Raspberry Pi Setup

Neel Kumar

--

Introduction

  • What is Raspberry Pi and how to program on it
  • Dealing with electronics, soldering, and measuring voltage using multi-meter
  • Introduction to 3D printing
  • Classes in Python
  • Multi-threading in Python
  • Exception handling in Python

At the end of the blogs, you will have a working robot with navigation, which can be customized for any future projects. This is just the beginning, the chassis has room for additional sensors, additional ports for DC or servo motors, and GPIO pins to connect other devices. the possibilities are endless. It took me almost a year to get all of the right sensors and figure everything out, but now you don’t have to spend all of that time digging around and go straight to the interesting part!

Roadmap

For each blog there will be a parts list, assembly instructions, and an explanation of the code. At the end of each blog, you will have something working to try and do further experiments with.

  • Part 1: This blog.
  • Part 2: How to setup motors and drive straight even without a gyroscope!
  • Part 3: How each of the sensors work and how to tune them.
  • Part 4: How to put everything together to make a fully functioning obstacle avoidance robot.

Materials

Raspberry Pi 4: The brain of the robot and all of the things you will need to get it running.

GitHub Repository: This is where all of the code and files will be.

Soldering Kit: Some of the parts will need soldering. If you aren’t familiar with soldering, search on YouTube and try with an adult, and caution, to practice.

Setup

To control the Raspberry Pi we will use a VNC. It lets you use Raspberry PI without connecting keyboard, mouse or a display, via shared WiFi connection. This means that the only thing we need to control the Pi is an external computer and a power supply. For the initial setup, power it using an outlet and connect it to a display, keyboard and mouse. This has to be done only once, and after that you can just power it and log onto it using the VNC running on other computer.

  • Follow this guide on how to download the NOOBS operating system for the Pi.
  • Follow this guide to setup VNC server on your Raspberry Pi.
  • Follow this guide to download VNC viewer on your favorite computer. Make sure to follow the steps for your operating system.
  • Follow the steps to clone the learn-robotics-rpi repository to your Raspberry Pi:
    Install Git: $ sudo apt-get install git
    Clone Git Repository: $ git clone https://github.com/neel-kumar/learn-robotics-rpi.git
  • Install all of the libraries: go into the learn-robotics-rpi directory and run this command:
$ pip3 install -r requirements.txt

What’s Next

Now that you have setup the Raspberry Pi. You will setup the motors, tune them, and by the end of the next blog you will have a moving robot!

Here are the links to the rest of the blogs:

Part 1: (This Article) Overview

Part 2: Motors and Chassis

Part 3: Sensors

Part 4: Putting everything together

--

--