The Ultimate Guide to Set Up the Arduino Integrated Development Environment (IDE) on a Raspberry Pi

A step-by-step guide to install Arduino IDE on your Raspberry Pi, so you can start programming your microcontroller projects. …


Updated October 19, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


A step-by-step guide to install Arduino IDE on your Raspberry Pi, so you can start programming your microcontroller projects.

Arduino is an open-source electronics platform based on easy-to-use hardware and software. It’s popular among hobbyists, students, and professionals for its accessibility and ease of use. To program Arduino boards, you need the Arduino Integrated Development Environment (IDE), which runs on various operating systems including Windows, macOS, and Linux. In this guide, we will show you how to install the Arduino IDE on a Raspberry Pi, a popular single-board computer for IoT projects.

Prerequisites

Before installing the Arduino IDE on your Raspberry Pi, make sure you have the following:

  1. A Raspberry Pi (any model will do) with Raspbian OS installed. If you haven’t set up a Raspberry Pi yet, follow this official guide to get started.
  2. A USB cable to connect your Arduino board to the Raspberry Pi.
  3. An Arduino Uno or any compatible board.
  4. An internet connection on your Raspberry Pi.

Installing the Arduino IDE on Raspberry Pi

Here are the steps to install the Arduino IDE on your Raspberry Pi:

  1. Open a terminal window by clicking on the “Terminal” icon in the top menu or pressing CTRL + ALT + T.
  2. Update and upgrade your system packages by running the following commands:
sudo apt-get update && sudo apt-get upgrade
  1. Install the necessary dependencies for the Arduino IDE:
sudo apt-get install build-essential python3 python3-pip libudev-dev
  1. Download the latest version of the Arduino IDE from the official website:
wget https://downloads.arduino.cc/arduino-1.8.13-linuxarm.tar.xz
  1. Extract the downloaded file using the following command:
tar xf arduino-1.8.13-linuxarm.tar.xz
  1. Move the extracted folder to /opt:
sudo mv arduino-1.8.13 /opt/arduino
  1. Create a symbolic link to make it easier to launch Arduino:
sudo ln -s /opt/arduino/arduino /usr/local/bin/arduino
  1. Launch the Arduino IDE by typing arduino in the terminal and pressing ENTER.

Installing the necessary drivers for your Arduino board

The Arduino IDE needs a driver to communicate with your Arduino board over USB. Follow these steps to install the appropriate driver:

  1. Connect your Arduino board to your Raspberry Pi using a USB cable.
  2. Open the Arduino IDE if it’s not already open.
  3. Go to File > Preferences.
  4. In the Additional Boards Manager URLs field, add this URL:
https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/package_stmicroelectronics_index.json
  1. Click on OK.
  2. Go to Tools > Board > Boards Manager.
  3. Search for STM32 and install the latest version of the package. This package includes drivers for many STM32-based Arduino boards, including the Arduino Nano 33 IoT.
  4. After installation is complete, select your board from the Tools > Board menu.
  5. Select the appropriate port under Tools > Port. You should see a list of available ports, including your Arduino board. Choose the one that corresponds to your board.

Testing your setup

To test if everything is working correctly, follow these steps:

  1. Open the Arduino IDE if it’s not already open.
  2. Create a new sketch by going to File > New.
  3. Add the following code to the sketch:
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("Hello, world!");
  delay(10000);
}
  1. Connect your Arduino board to your Raspberry Pi using the USB cable.
  2. Click on Tools > Board and select your board (if it’s not already selected).
  3. Click on Tools > Port and select the appropriate port for your Arduino board.
  4. Click on the upload button (the right-pointing arrow) or press CTRL + U to compile and upload the code to your board.
  5. Open the Serial Monitor by clicking on Tools > Serial Monitor.
  6. You should see “Hello, world!” printed every second in the Serial Monitor.

Congratulations! You have successfully installed the Arduino IDE on your Raspberry Pi and can now start programming your Arduino projects. Try out some of the official Arduino tutorials to get started.