How to set up the Pi Cap with a Raspberry Pi
Follow this tutorial to set up your Pi Cap with a Raspberry Pi
The Raspberry Pi is the most popular computer nowadays. The Pi Cap adds capacitive sensing to your Raspberry Pi.
We are a big fan of the Raspberry Pi, because it has so many features. One benefit is that you can work on your Raspberry Pi wirelessly, via SSH. This stands for Secure SHell, it is a way of connecting to the terminal of another machine, in the case the Raspberry Pi, from your computer – provided that they are on the same network. So there is no need to connect your Raspberry Pi and Pi Cap to your computer if you want to change your code.
The Pi Cap has similar features to our Touch Board, but the Touch Board is a single board using Arduino, whereas the Pi Cap is an add-on, or HAT, for the Raspberry Pi.
This guide works for any Raspberry Pi model, you can buy a Raspberry Pi from some of our resellers. It also works for the Pi Zero, although for this Pi model, you need to connect to the WiFi.
Step 1 Install Raspbian
Before you begin, make sure you have a microSD card which is loaded with the latest NOOBs or latest Raspbian. NOOBs is aimed at beginners but doesn’t have as many features as the Raspbian OS, we usually install Rasbian. You can find the instructions for how to set up NOOBs or load Raspbian onto your card on the Raspberry Pi website.
Step 2 Add wireless features
If you are using a screen, keyboard and mouse with your Raspberry Pi, you can skip this step.
If you want to work on your Raspberry Pi headlessly, you need to enable SSH. Once you have loaded Raspbian to your SD card, you need to add a file named “SSH” onto the /boot/ partition. Simply download this file, extract it and copy-paste the extracted ssh file onto the /boot/ partition. It should show up among the other files.
If you want to add Wi-Fi, download this file. Unzip the file and then open it with a text editor. Change the country code according to the ISO list and change the name of the Wi-Fi and the password according to your Wi-Fi. Copy-paste the file also onto the /boot/ partition.
You can then eject the microSD card and insert into your Raspberry Pi.
Step 3 Connect everything together
If you are using a screen, USB keyboard and USB mouse with the Raspberry Pi, connect them now via the USB ports and HDMI port. Depending on whether you are using the latest Raspberry Pi, you need a micro HDMI cable, if you are using an older Pi model, you can use a standard HDMI cable.
Then attach an ethernet cable that will connect the Raspberry Pi to the internet.
With an ethernet cable connected, attach the Pi Cap to the Raspberry Pi via the GPIO pins. Make sure that each GPIO pin is properly aligned.
Finally, connect power to your Raspberry Pi’s power supply.
Step 4 Open up the Raspberry Pi with a terminal window
If you are using a screen connected to your Raspberry Pi, then open a terminal window.
If you are setting up the Pi Cap headlessly, then it is now time to connect to the Raspberry Pi from your computer via SSH. If you are on a macOS or Linux machine, open a Terminal window and type in
There may be a security question regarding an unknown key at this point – you can safely continue, as all this is saying is that it has not connected to the Raspberry Pi before – the message should not appear the next time you connect. You should then be prompted for a password, which is
You can change it later if you want.
If you are using a Windows machine, you have to run a program called PuTTY. When you run it, you will see a configuration screen. Under “Host Name” enter
and click Open. You may get a security prompt – you can safely continue and you should not see this prompt again. When asked for the password, enter
and you will be logged in.
In all cases, you should see a terminal window with the line “pi@raspberrypi:~ $”.
Step 5 Update your Raspberry Pi
Now that you have a terminal prompt, you can start entering commands to run on the Pi. To begin with, you are going to update the list of available packages that the Raspberry Pi can install – type
sudo apt-get update
into the terminal, followed by “Enter”. This will take a little while. Once it is done, you should then run
sudo apt-get dist-upgrade
which will ensure that Raspbian itself and all installed packages are up to date too. This will take considerably longer – around 10 minutes, and you might need to answer yes to a couple of questions about disk space. Once this is complete, you will need to reboot the Pi by entering
sync && sudo reboot
in the terminal.
Step 6 Install the picap package
With our Pi now as up-to-date as it can be, it is time to install the actual software package that supports the Pi Cap – conveniently called “picap”. If you were connected via SSH before, you will need to reconnect to the Pi as the reboot will have closed that connection.
At the terminal, type
sudo apt-get install picap
followed by”Enter”. You may be asked to confirm that you are happy to install the picap package and the other packages that it requires – simply answer “Y” to these questions.
Step 7 Configure the picap package
To configure the picap package, you need to run
at the terminal.
Firstly we ask whether you want to enable high quality audio on the Pi. We strongly recommend that you do this – it will enable the new, higher-quality audio driver that the Raspberry Pi team have worked hard on, which is a huge improvement on the previous version.
Next, we ask whether or not to install examples into your home folder. We recommend that you do this, but you can, of course, choose not to. You can install them into any directory you like later.
Once this is complete, we ask whether you would like to reboot the Pi in order to complete the installation.
Step 8 Run the intro
After SSHing back into the Pi, enter these commands
sudo dpkg -i wiringpi-latest.deb
Run picap-intro to see a get a tour of the Raspberry Pi. Simply navigate with the arrows.
Step 9 Next steps
Once you have installed the Pi Cap, you can explore all of the example code and create your own projects! All of out examples are open source and we’ve written them in Python, C++ and Node js.
If you haven’t used the terminal window before, we’ve written a short intro here.
If you are new to the Raspberry Pi, you can find more information on the Raspberry Pi foundation’s website as well as Raspberry Pi projects to get you inspired.
If you have any issues please contact us at firstname.lastname@example.org.