Products for USB Sensing and Control
Products for USB Sensing and Control

Getting Started with Raspberry Pi and Phidgets

How to configure a Raspberry Pi for working with Phidgets

by Phidgets Education


Do you have a Raspberry Pi in your classroom that you'd love to use with Phidgets? Well, you're in luck! Keep reading to find out how to add some awesome functionality to your next Raspberry Pi project.

This guide assumes the use of Raspbian OS.


This project assumes you have completed The Getting Started Kit.

You should also have previous experience with the Raspberry Pi and Thonny Python IDE.

If you have yet to boot your Raspberry Pi for the first time, follow the setup instructions.


At the end of this project you will be able to connect and use a Phidget with a Raspberry Pi.

Parts Inventory


You can connect your Getting Started Kit to your Raspberry Pi just like you would with any other computer.


Install Phidget Library

In order to use your Phidgets, you'll need to install libusb on the Raspberry Pi. The first step is to open the terminal:

Next, enter the following command:

sudo apt-get install libusb-1.0-0-dev

Now that you have libusb installed, you will need to download the Phidget library for Linux.

Next, right-click libphidget22 and select Extract To...

Change the extract location to /home/pi/ and click Extract.

Navigate to /home/pi/ where you will now find the libphidget22 folder. Right-click on the libphidget22 folder and select Open in Terminal.

Enter the following command in the terminal:


Followed with the make command (this may take some time to complete):


And finally:

sudo make install

Next, restart your terminal (or open a new one) and update the library cache.

sudo ldconfig

Configure Device

In your libphidget22 folder, navigate to /plat/linux/. Right click on the udev folder and select Open in Terminal.

In order to allow your programs to access the phidgets connected to your Raspberry Pi, you need to configure the device rules.

You can do this by entering the following command:

sudo cp 99-libphidget22.rules /etc/udev/rules.d

Navigate to /etc/udev. You should now find a folder titled rules.d containing 2 files.

Now that everything is set up properly, be sure to reboot!


Your Raspberry Pi is now set up (a one time process). Next, you can start using your Phidgets.

Open Thonny Python IDE.

Switch to regular mode.

Select Tools> Manage Packages.

Find the Phidget22 package and click install.

create a file called and add the following code to run the redLED on your Getting Started Kit.


With that, you are ready to start integrating Phidgets into your Raspberry Pi projects!

Make a cool project using Raspberry Pi and Phidgets? We'd love to hear about it at