Creating a 3G hotspot with the Raspberry Pi

Do It Yourself

WiFi is available for free in so many public places that Internet access via a UMTS mobile cellular system would appear to be unnecessary. However, a Raspberry Pi with a UMTS stick can create a personal hotspot that creates independence from public WiFi networks.

A UMTS router splits mobile data connections among several devices. Using a Raspberry Pi and a UMTS stick, you can construct your own UMTS router. These router systems are commercially available at a low cost, starting at $45.

They use a SIM card for mobile access to the Internet and typically generate a WiFi network for up to five devices at one time. Differences in price are based on the capacity of the integrated battery, the quality of the workmanship, and the user interface. Many models come with an integrated OLED display that lets you see information about the status of various operations.

Some manufacturers market very inexpensive devices like the TP Link TL-MR3020 [1] as a mobile router, but if you look at the fine print for this type of router, you will learn that you need your own UMTS USB stick to use the device. With this state of affairs, why not just bypass the inexpensive devices and use your own UMTS stick to create a mobile router? The Raspberry Pi has no problems with this task with the right equipment. Because the Rasp Pi itself is more expensive than off-the-shelf mobile routers, the Rasp Pi router cannot compete in terms of price, but if you already have a Rasp Pi at hand, then the price comparison looks quite different.


A second-generation Raspberry Pi (RPi2) is ideal for this project. However, it is also possible to use a Rasp Pi Model B+. Of major importance is the ability for the Rasp Pi to deliver enough power to the USB connection, because a UMTS stick usually surpasses the capacity of a first-generation Rasp Pi (RPi1). One remedy for the capacity shortage would be to use a powered hub, but this solution would place limitations on mobility.

UMTS sticks can be purchased at a low price online or from a local electronics store. It might be true to say that the older the stick the better your chances for success. Although manufacturers very rarely guarantee support for Linux, the Linux community has taken care of compatibility issues for older sticks. Most WiFi sticks supported by Linux are suitable for the WiFi network envisioned by the project presented here. However, it is important to remember that the WiFi device will be working not just as a client: It will also function as an access point. Although the popular Edimax EW-7811Un [2] might fall short, in this article, I describe a workaround.

A possible workaround that often turns out to be feasible is a mobile power supply in the form of a larger backup battery that would typically be used for a smartphone or tablet. One advantage to this set up is that the user can position the Rasp Pi hotspot near a window for optimal UMTS reception or make an outdoor space into a WiFi zone. The power bank you use needs to deliver sufficient power to the Rasp Pi and its peripherals. Ideally, this should be more than 2A. The battery also has to last. You can find a compatible battery pack starting at $15. Figure 1 shows the completed construction with a UMTS stick and a WiFi dongle.

Figure 1: The Raspberry Pi in use as a 3G router with a WiFi dongle and a UMTS stick. A backup battery for s smartphone or tablet can make this setup mobile.


Figure 2 shows schematics for the network configuration. The Rasp Pi router has three network interfaces: One is via the UMTS-generated WAN connection (i.e., Internet access), another is the integrated Ethernet port, and the third is WiFi via a USB dongle. Connecting the Ethernet port and WiFi creates a "bridge," which makes the private network of the router available to a computer via Ethernet or the Rasp Pi WiFi.

Figure 2: This shows the schematics for the network configuration. The computer connected to the Ethernet port and the devices connected via WiFi all access the Internet via the UMTS connection.

The next step is to configure the UMTS stick. The WiFi needs to run in infrastructure mode and route all of the packets of the private network. Ultimately, the Rasp Pi will also serve as a DHCP and DNS server for the connected devices, which can be accomplished conveniently with standard Raspbian applications.

To work on a network configuration and correct errors, you need a Rasp Pi with a screen and keyboard attached. The little PC first needs to be a normal client on its own network before the necessary software is installed. Later, it will have an independent WiFi network and Internet access of its own.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content