Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

How to Connect Raspberry Pi to WiFi- (Part 3/12)

By Prabakaran P.M

This article is to make the procedure of setting up the WiFi. The Raspberry Pi is connected to Windows PC through Ethernet cable and the GUI is obtained using a VNC server. Although Raspberry Pi Model B comes with 100Mbps wired Ethernet, it is also essential to connect WiFi. The best arrangement is to purchase a cheap USB WiFi connector and utilize one of the USB ports to get to our WiFi home router. Setting up a Raspberry Pi utilizes the Raspbian OS to get to your remote system is simple – This article will guide you through the procedure.


Prerequisites & Equipment:

You will need the following:

  1. A Raspberry Pi Model B or greater.

  2. A USB WiFi Adapter (Edimax – Wireless 802.11b/g/n nano USB adapter is used here – it’s small and cheap!)

  3. An SD Card flashed with the Raspbian OS (Here is a guide if you need)

  4. Access to the Raspberry either via a keyboard and a monitor or remotely.

Before we continue I need to call attention to the significance of purchasing the compatible USB WiFi Adapter. Since not all the wifi dongles are plug and play to the Raspberry Pi. Some of the time you will need to download a driver to make them work. While drivers are typically accessible for Windows PCs – it is an alternate world for Linux and Raspberry Pi’s. This is the reason it is critical to purchase a WiFi Adapter that says “Linux” in the package. I utilize the Edimax – Wireless 802.11b/g/n nano USB adapter because I have found it to be cheap and very easy to work with. http://elinux.org/RPi_USB_Wi-Fi_Adapters — This link gives the list of plug and play compatible USB WiFi dongles for Raspberry Pi.

Adding WiFi adapter to the Raspberry Pi:

In this tutorial the Raspberrypi board is booted with the Ubuntu OS and is connected to the Ethernet port of a Windows7 PC. The board is connected to the internet connection as explained in the article Connecting the Raspberry pi to the internet. The IP address of the Raspberrypi board has been obtained to remote login in the TUI using the PUTTY and is remotely accessed using VNC.

After booting and logging-in you want to make sure that the new wireless adapter is found by Raspberry Pi. To look at which peripherals the operating system found when booting run the following command:

lsusb

This will give the list of USB devices connected to the Raspberry Pi.

Detecting USB devices connected to Raspberry Pi

Fig. 2: Detecting USB Devices Connected To Raspberry Pi

Your device should be in the list. Followed by this command will ensure that WiFi dongle is Recognized.

dmesg | more

You can use the space-bar to scroll down a page at a time – towards the end you will see something similar to the following lines:

Raspberry pi Recognizing the USB Device

Fig. 3: Raspberry Pi Recognizing The USB Device

This means that the operating system recognized the USB WiFi Adapter using one of the built-in drivers (you can return to the terminal by pressing “q”). All that is left is to configure your WiFi connection.

Adding the network details to the Raspberry Pi:

Open a Terminal session enter the following command into it:

sudo nano /etc/network/interfaces

This will open the file in nano editor. After opening the file in nano, you will see a screen like this:

Adding network details to Raspberry Pi

Fig. 4: Adding Network Details To Raspberry Pi

To configure your wireless network you want to modify the file such that it looks like the following:

auto lo

iface lo inet loopback

auto eth0

allow-hotplug eth0

iface eth0 inet manual

auto wlan0

allow-hotplug wlan0

iface wlan0 inet manual

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

After editing the file you should see something like the following:

Editing a File in Raspberry Pi to configure Wireless Network

Fig. 5: Editing A File In Raspberry Pi To Configure Wireless Network

To save the file, press Ctrl+O this will write the file to the disk – afterwards you can exit nano by pressing Ctrl+X. If nano asks if you want to Save modified buffer? Press “Y” followed by hitting enter to confirm the filename.

Now open the wpa-supplicant configuration file in nano by entering this command:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Go to the bottom of the file and add the following:

network={

ssid=”Your_SSID_name”

psk=”Your_wifi_password”

}

Now save the file by pressing ctrl+x then y, then finally press enter.

At this point, wpa-supplicant will normally notice a change has occurred within a few seconds, and it will try and connect to the network. If it does not, either manually restart the interface with sudo ifdown wlan0 and sudo ifup wlan0, or reboot your Raspberry Pi with sudo reboot.

Testing Raspberry Pi connected to Wifi

Fig. 6: Testing Raspberry Pi Connected To Wifi

You can verify if it has successfully connected using ifconfig. If the inet addr field has an address beside it, the Pi has connected to the network. If not, check your SSID and password are correct.


Filed Under: More Editor's Picks, Raspberry pi, Tutorials

 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What is a loop calibrator? 
  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Measure AC current accurateley (100mA to 10A)
  • 74HC595 creating Fake output
  • What was before microcontrollers ?
  • NEED HELP FOR OP-AMP IN BGR
  • Check undesired substrate mode...

RSS Electro-Tech-Online.com Discussions

  • Sla ir li ion
  • Need a ducted soldering fan for solder smoke extraction
  • Question about ultrasonic mist maker
  • Best way to reduce voltage in higher wattage system?
  • Two 300nH inductor in series, can get higher current?
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering