Ever since this tiny, credit-card-sized computer, Raspberry Pi, appeared in the market, it has caught the imagination of every electronics and computer hobbyist around the world. The powerful Linux operating system combined with 26 input-output (I/O) pins can do many amazing things out-of-the-box. This article explains how to interface a USB camera and Wi-Fi with Raspberry Pi. It also explains the steps for making a webcam server using VLC Apache2 server software.

Raspberry Pi operating system
Several formats of Linux are available for installation on this tiny board. Among these, the most popular ones are Archlinux, Wheezy Linux, qtonpi, Fedora and xbmc.

I prefer Wheezy Linux because it is Debian style, where installation and tweaking is quite easy. The 2014-09-09-wheezy-raspbian.zip is available for download on raspberrypi.org. The wireless adapter, which comes in the form of a Wi-Fi dongle, can be installed out-of-the-box, so can be the USB cameras.

Fig. 1: USB camera with Raspberry Pi
Fig. 1: USB camera with Raspberry Pi

The steps to interface a USB webcam and Wi-Fi with a Raspberry Pi (model-B) board are given below. The USB webcam interfaced to a Raspberry Pi board is shown in Fig. 1.

Preparing the operating system. After downloading the zip file (wheezy-raspbian), extract the image in a folder on your computer and insert a 2GB or bigger-size SD card in the card reader slot. At this stage, check the identity of the SD card—sda, sdb or sdc—as shown in your Linux PC. After inserting the SD card, issue an ‘ls /dev/sd*’ command at a terminal prompt and see what name has been given to the card.

bera@Acer-AOD255E:~$ ls /dev/sd*
/dev/sda /dev/sda2 /dev/sda4 /dev/sda6
/dev/sda1 /dev/sda3 /dev/sda5 /dev/sda7
/dev/sdb1 /dev/sdb2 /dev/sdc

Here, my SD card has been identified as /dev/sdc. Now, go to the folder where you have extracted 2012-09-18-wheezy-raspbian.img file. This image file now needs to be written on the SD card to make it work as the operating system. Any mistake here will lead to the loss of entire data on your computer hard disk.

Look for the highest order, like sdc, sdd, etc, to identify your SD card. To be absolutely sure, just unplug and re-plug the card a few times and notice the changes.

At the terminal prompt, issue the following command:

bera@Acer-AOD255E:~/Desktop/Raspberry-
PI/OS$ sudo dd if=2012-09-18-wheezy-
raspbian.img of=/dev/sdc bs=2M

This will use dd, the powerful image-creator program of Linux, and transfer the image to the SD card.

When it prompts for ‘su’ password, enter it. (In Windows, there are several graphical image-creator programs like Nero Burner that can be used in a similar fashion.)

The above command may take several minutes. Look for HDD Lamp Busy indication. When the lamp stops blinking, go to the desktop and safely remove the SD card. (Right-click on the SD card and then click on Safely Remove.)

Connecting the display/monitor. Connect the TV screen or monitor to Raspberry Pi board using a composite video cable (AV cable) or HDMI cable, insert the SD card into the SD card slot and switch-on the power supply.

The TV screen/monitor even on the right AV channel may refuse to come up the first time. When that happens, remove the power-supply cord of Raspberry Pi board once (keeping the monitor’s power supply on) and then re-plug it. Now, the monitor should come on live, if the SD card is not removed.

Fig. 2: Raspberry Pi desktop screen
Fig. 2: Raspberry Pi desktop screen

Once the Raspberry Pi starts booting up, it will prompt you for login name and password. The login for Wheezy linux is pi and the password is raspberry. Once entered, Raspberry Pi will open the text screen. Enter Startx command at the prompt to start the beautiful GUI desktop screen (Fig. 2). The first time when I saw the image on my television screen, I was mesmerised.

To make Raspberry Pi open the GUI screen every time it boots up, all you have to do is to make a change in the raspi-config page. Select Sudo Raspi-config and bring the cursor down on Automatic GUI Boot Up. Select → Finish → Reboot. And, it’s done.

Connecting the USB camera and Wi-Fi dongle. Connect the Wi-Fi adapter and webcam to USB slots. You will run short of USB ports now because Raspi-B model has only two USB ports. Find a USB hub with multiple USB ports and grab a hub that has a small, 5V power supply input to it.

(Remember, wireless needs more power. Therefore, if the hub is not powered by a suitable 5V supply, the Raspberry Pi may malfunction.)

LEAVE A REPLY

Please enter your comment!
Please enter your name here