Skip navigation

Raspberry Pi Accessories

2 Posts authored by: biglesp





Wireless networking is something that we really take for granted. Nearly every device that we own has some form of technology to wireless connection. Wireless is getting cheaper and we this is evident in the proliferation of new components such as the esp 8266, a $3 hackable WIFI device with limited GPIO (General Purpose Input Output).


When the Raspberry Pi first hit the world in 2012 it came with a 100MB Ethernet connection for wired network access. Thanks to the Raspberry Pi Community and the Raspberry Pi’s sound Linux foundation, WIFI dongles were quickly tested with the Pi and with varying degrees of success. The issues faced were mainly based upon the chipsets used for the radio transceivers that make WIFI possible. On a typical Linux system there will be many different firmwares to cope with the myriad of chipsets on offer. But for the Raspberry Pi and it’s reduced storage capacity, a number of these had to be removed.


Popular chipsets such as Ralink and Broadcom were retained and this is where we start our look at the Wi-PiWi-Pi WIFI dongle.




The Wi-Pi wireless dongle uses the common Ralink rt5370usb chipset which provides b,g, and n WIFI certifications which means that this dongle can connect to many different types of access points.


We ran the “lshw” terminal command to list the hardware attached to our Raspberry Pi and we found the following information.

lshw is not installed as standard but can be installed via a terminal by typing sudo apt-get install lshw but it is not required to install the W-Pi dongle.




  description: Wireless interface


  physical id: 2


  bus info: usb@2:1.1


  logical name: wlan7


  serial: 00:c1:41:39:01:98


  capabilities: ethernet physical wireless


  configuration: broadcast=yes driver=rt2800usb driverversion=3.13.0-24-generic firmware=0.29 ip= link=yes multicast=yes wireless=IEEE 802.11bgn


Which is where we learnt about the firmware used for this chipset.


We also used “lsusb” to list the USB devices attached to our Raspberry Pi and found the Wi-Pi dongle listed as


Bus 002 Device 010: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter






As you can see the lshw and lsusb information conficts, with lshw reporting an RT2800 device, this is just the driver used and the real chipset is RT5370. This information is not really necessary for everyday use, but using lshw and lsusb is an invaluable tool in diagnosing hardware issues, so keep it in mind for any future projects.


Installing the dongle


Installation of the dongle is a breeze using the latest version of Raspbian from the Raspberry Pi Foundation. With their new and improved user interface, courtesy of the remarkable Simon Long and his relentless quest to refine and simplify the interface, we now have an easier method of connecting to WIFI, rather than using the of WIFI Utility that was found in the Internet sub menu.


To install Wi-Pi on all models of Raspberry Pi using the latest Raspbian release.


With your Raspberry Pi powered down insert Wi-Pi into a spare USB port.




Insert your keyboard, mouse, HDMI and lastly the insert the power to turn on your Raspberry Pi.


Your Raspberry Pi will boot as normal and you should login to your Pi and then start the desktop environment using “startx” if your Pi is not configured to boot directly to the desktop.


With your Pi at the desktop, look to the top right of the screen and you will see the WIFI icon.




Left click on the icon and the application will scan for nearby access points, this will take a few seconds.


Click on the access point name that matches your router.


A dialog box will appear and ask for your pre shared key, this is the password for your router. Enter it and press Ok.




After a few seconds your Raspberry Pi will be connected to the router and in turn will have a connection to the Internet.


To test your connection open a new browser window and head over to, after a few seconds the page will load. You can also test your connection via the terminal. Open a new terminal session and type




This will send a ping of data to the IP address, which just happens to be one of Google’s DNS (Domain Name Server) this will produce output like this.


PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=50 time=981 ms
64 bytes from icmp_seq=2 ttl=50 time=31.6 ms
64 bytes from icmp_seq=3 ttl=50 time=99.1 ms
64 bytes from icmp_seq=4 ttl=50 time=73.5 ms
64 bytes from icmp_seq=5 ttl=50 time=37.7 ms
64 bytes from icmp_seq=6 ttl=50 time=39.8 ms
64 bytes from icmp_seq=7 ttl=50 time=80.2 ms

--- ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6007ms
rtt min/avg/max/mdev = 31.621/191.971/981.560/323.197 ms


What’s important is that we sent 7 packets of data to the IP address, and that we received 7 replies which is 0% loss, in other words we are connected to the Internet.


With the Wi-Pi wireless dongle you can finally untether your projects and truly go mobile!






The Raspberry Pi comes with two methods of displaying video on a compatible screen. Firstly we can use the HDMI connection along with an HDMI lead connected to a compatible TV or monitor. Or we can secondly use the composite connection which is the yellow jack on the Model A and B Raspberry Pi, but for the Models A+, B+ and Pi 2 this is integrated into the 3.5mm headphone jack.


What you will not find on the Raspberry Pi is a VGA connection, but why? To be honest VGA is an old standard and it is slowly reaching end of life. So why incorporate a legacy connection which will undoubtedly increase the cost of manufacturing which would be passed on to the buyer. The Foundation took the decision to invest in the more modern HDMI standard as this can handle HD video and audio via one cable and so the Raspberry Pi started to come off the production line with this common connection.


HDMI is a great connection but the biggest issue faced is that schools, clubs and home users have access to many VGA screens so how can we connect our Raspberry Pi to these screens? In steps Pi-ViewPi-View one of the first Raspberry Pi Foundation approved components. Pi-View is an adapter between the digital HDMI signal and the analogue VGA signal. Using Pi-View we can easily attach our Raspberry Pi to many different types of VGA monitor and the circuitry inside Pi-View will automatically detect the monitor resolution ensuring that your Pi is ready to go. Pi-View is unable to transmit the audio from the HDMI to VGA as VGA is a video only connection. To play audio on your Raspberry Pi you will need to connect headphones or a speaker to the 3.5mm jack, and then select the audio output via the new audio menu, present in the top right of the Raspbian desktop. Just hover your mouse over the icon and right click to bring up the menu.


Pi-View is a very handy piece of kit for any school, club or group that have access to cheap VGA monitors and wants to get their team hacking quickly.


The Raspberry Pi is capable of many great things but one of the most accessible and rewarding is something incredibly simple, taking a photograph. We take this for granted as a camera comes with our cell phone, but how do I take a photograph?

With our cell phone we open the camera application, frame the shot and then touch the screen to take a picture. But behind the scenes there are many steps to be taken in sequence in order to capture an image or a video.

In this tutorial we will learn via three projects how to use the official Raspberry Pi CameraRaspberry Pi Camera to take a photograph using a command from the terminal, then using the Python AP and finally we shall record video in super slow motion!

The code and commands used in this tutorial will also work with the Pi NoirPi Noir camera to capture low light images as essentially they are the same camera but the Pi Noir does not have an infra red (IR) filter which when used with an IR light source, such as an IR LED, it can see in the dark! Pi Noir is a great piece of kit and it enables nocturnal projects to be created such as a nature camera or CCTV system.


All of these projects can be completed with either of the cameras, but remember that the Pi Noir requires an IR light source in order for it to take photos/video in low light.

Raspberry Pi CameraRaspberry Pi Camera

Pi NoirPi Noir

All of the projects can be completed with any model of Raspberry Pi but for best results we recommend the Raspberry Pi 2Raspberry Pi 2

Getting started


Installing the camera is quick and easy and to start the installation you will need to power down your Raspberry Pi and remove the power cable from the Pi. Next you will need to locate the port marked CAMERA between the HDMI and Ethernet ports.

Carefully lift the top and bottom edges of the connector vertically, they will gently slide up and then stop when in place. Be careful as the connector is rather fragile, you will only need to use a little pressure to lift the cover of the port

Remove your camera from the box and slide the ribbon connector into the CAMERA connector, ensure that the blue edge faces the ethernet port. Be careful handling the camera it is rather fragile and sensitive to static. With the ribbon inside the connector gently push the connector edges back down, locking the ribbon in place. With the camera hardware installed you can now power up your Raspberry Pi.

You should now boot up your Raspberry Pi to the desktop and when ready open up a new terminal and type the following, remember to press Enter to run the command

sudo raspi-config




Raspi-config is a configuration suite to automate setting up your Pi, in this case we want to enable the camera, which is option 5.

At the menu navigate to Enable Camera and press enter. In the next screen select Enable, and then navigate to Finish, which will prompt you to reboot your Raspberry Pi. Do this and allow the Pi to reboot, thus enabling your camera.


With the camera enabled we next need to check that it has been configured correctly and to do that we use the command raspistill in  LXTerminal.

raspistill -o image.jpg

The camera will now activate, we can see this via a red light on the unit, and a preview will appear on screen for a few seconds, compose yourself and it will take the picture. You can then open the picture via the file manager. It should be in /home/pi or in the directory where you used the command. If this does not work, check that you have connected the camera correctly and that raspi-config shows the camera as enabled. Remember do not remove the camera from the connector while the Raspberry is on, it will cause damage to the camera.


With a successful test of the camera we now need to install the latest Python API for the camera. Chances are that you are using the latest version of Raspbian but it is always prudent to update your software. For this next step your Pi will require an Internet connection and the easiest way to do that is by using an Ethernet cable direct to your router, once connected open a terminal.

In a terminal type the following, remember to press Enter to run the command.

sudo apt-get install python-picamera python3-picamera python-rpi.gpio

Once complete we are ready to take a picture using Python 3.

Project 1: Taking One Picture Using Python 3 (Both Cameras)

If you wish to capture images in low light or at night, then please use an infra red LED connected to the Raspberry Pi 3v3 and GND pins via a 220 ohm resistor. All models of Raspberry Pi have two 3v3 pins, located at Pin 1 and Pin 17.

To open Python 3 go to the main menu, in the latest Raspbian this is the top left of the screen. Left click and navigate to Programming and select Python 3. An application called IDLE will open and you will see the IDLE Python shell, in here we can write code that will produce instant results, we don’t want that so lets click on File >> New Window to open a blank document where we shall store our code.

Our code is relatively simplistic for this test.

Firstly we import two libraries, time which is used to control the duration of the preview and picamera which is the Python API for the camera.

We then move to the main body of code where we start a preview window, wait 2 seconds before capturing the image as ‘foo.jpg’ in the same directory as where the code is ran.

Save you code as and click on Run >> Run Module in IDLE to run the code. You should see a preview window appear, then resize after 2 seconds to indicate that a picture has been taken. Open the File Manager and navigate to where you saved the Python code. Your photo will be ready to view. Remember that every time the code is ran the original file is overwritten so make sure to backup or rename the file if you wish to keep it.

Project 2: Creating a timelapse (Both Cameras)

If you wish to capture images in low light or at night, then please use an infra red LED connected to the Raspberry Pi 3v3 and GND pins via a 220 ohm resistor. All models of Raspberry Pi have two 3v3 pins, located at Pin 1 and Pin 17.

In Project 1 we captured a single file that was overwritten each time the code was ran. But what if you wish to create a sequence of images? Timelapse videos take one image every minute, hour,day (the choice is yours) and are then stitched together to form a video that accelerates through that time period. For example a plant growing from seed. We are going to create a timelapse to capture an image every 5 minutes as a separate file.


This code looks very similar to Project 1 but it uses a for loop to capture an image every 30 seconds and automatically create a filename by setting the variable i to 0 and then incrementing it by 1 every time the loop is run. We use the try..except construction to instruct the code to attempt the code in the try section first. If there is an error or if the user presses CTRL + C to close the application then “Exiting’ is printed to the screen.

Save the code as and compose your shot. When ready click on Run >> Run Module to launch the code. The camera will come to life and start a preview window before taking your picture. It will then wait 30 seconds before repeating the process. To stop at any time press CTRL + C on your keyboard.


Project 3: Slow Motion (Both cameras)

For our final project we shall push the camera to its limits and use it to record 90 frames per second!

At the time of writing the Python picamera library is not able to record at such speed but we can use the raspivid command at the terminal instead.

in a terminal type the following and press Enter to run

raspivid -w 640 -h 480 -fps 90 -t 100000 -o slowmo.h264

This command will record 10 seconds of video at a resolution of 640 x 480 pixels and at 90 frames per second. The camera will provide a preview window for you to compose a shot and once it has finished recording it will return the terminal control to you.

To play the video, in the terminal type

omxplayer slowmo.h264

You should see the video appear in super slow motion!

This is great fun to use with fast moving projects such as robotics and recording races.

Just for fun I created a simple Python script to automate the process. It uses the os library to enable Python to run terminal commands. Then an infinite loop contains the code to be constantly ran. It creates a variable called name which is used to store the user input for the filename. The input is wrapped inside of a str() function which converts the data captured into a string. The next line handles attaching the suffix “.h264” to the filename provided and this updates the name variable. Then using the os.system function we call the raspivid terminal command to record the video. You can see at the end of the line that the name variable is used for the filename. The last line of code handles the playback of the video.


So there we have three projects for the Raspberry Pi Camera and the Pi Noir Camera.

Happy hacking!