Вы находитесь на странице: 1из 49

1|P a g e

Wi-Fi Radio
CAPSTONE PROJECT-II
Submitted in partial fulfillment of the requirement for the award of the Degree of

BACHELOR OF TECHNOLOGY IN (Electronic and Communication Engineering)


By Himanshu Gaur Shanu Mohan Vishagh George Amit Kumar - 10903689 -10900345 - 10904506 - 10900500

Under the Guidance of

Asst. Proff. Nitin Kaul

(LFTS) Lovely Professional University Punjab Month and Year of Submission (APRIL 2013)

2|P a g e

CERTIFICATE

This is to certify that the declaration statement made by this group of students is correct to the best of my knowledge and belief. The Capstone Project Proposal based on the technology / tool learnt is fit for the submission and partial fulfillment of the conditions for the award of B.Tech in Electronics and Communication Engineering from Lovely Professional University, Phagwara.

Name: Mr. NITIN KAUL

U.ID: 16861

Designation: Asst. Professor (ECE)

Signature of Faculty Mentor

3|P a g e

DECLARATION

We hereby declare that the project work entitled Wi-Fi Radio is an authentic record of our own work carried out as requirements of Capstone Project (Part-II) for the award of degree of B.Tech in Electronics and Communications from Lovely Professional University, Phagwara, under the guidance of Mr. Nitin Kaul, during January to April, 2013.

Project Group Number: G173 Name of Student 1: HIMANSHU GAUR Registration Number:10903689 Name of Student 2:SHANU MOHAN Registration Number: 10900345 Name of Student 3:VISHAGH GEORGE Registration Number:10904506 Name of Student 4:AMIT KUMAR Registration Number:10900500

4|P a g e

ACKNOWLEDGEMENT
History of all great works is to witness that no great work was ever done without either active or passive support of a person surrounding and ones close quarters. Thus it is not hard to conclude how active assistance from senior could positively impact the execution of a project. We are highly thankful to God and Mr. Nitin Kaul for her active guidance throughout the completion of project. Last but not least, we would also want to extend our appreciation to those who could not be mentioned here but have well played their role to inspire us behind the curtain.

HIMANSHU GAUR SHANU MOHAN VISHAGH GEORGE AMIT KUMAR

Signature of the Instructor

5|P a g e

ABSTRACT
The purpose of this study is to analyze the WI-FI signal propagation, using IEEE 802.11g radio interface. In most cases, the WIFI radio interface is installed by the people who are not familiar with the system, especially when dealing with signal propagation at high frequency. Hence, there is a need to understand this signal behavior particularly in indoor scenarios. This study focuses indoor signal measurement and prediction. The measurement and prediction of this signal propagation is taken at the campus environment of Lovely Professional University. Signals were monitored using a TP-LINK 3020 access point (AP) and Openwrt software runs on portable computer. The Log Distance path loss model is used as the mathematical analysis. The measured data is compared with mathematical model to obtain the new possible path loss coefficient, for 802.11g radio interface. We have been wanting to build a streaming radio for some time. We could simply buy an internet radio, but we couldnt stomach the $150-$300 price tag on most players for such a luxury. So, we decided to build one instead. We started the design process by drafting an outline of desired features, and then breaking them down into wants and needs, while trying to keep the project scope under control.

6|P a g e

LIST OF FIGURES :
1. Modulating Signals 2. Male Header 3. FTDI Device 4. Female Header 5. Capacitor 6. Quartz Crystal 7. LCD

Page Nos
9 14 14 15 16 16 17 17 19 19 37 40 41 42 45 46

8. Pin Diagram Of LCD 9. Resistor 10. AVR Microcontroller 11. Internal Structure Of TP-LINK 3020 Router 12. Antenna Hack 13. GPIO Connections 14. GPIO Pins 15. Schematic 16. Modified Schematic Of Connections

LIST OF TABLES :
1. Comaparison of Electromagnetic Radiations 2. Chipsets And Models 3. Pin Configurations 4. Hardware Summary Of Router 5. Truth Table Of Sliding Switch 6. LED Configurations 7. Hardware Buttons

Page Nos
11 15 18 37 39 39 40

7|P a g e

CONTENTS :
1..INTRODUCTION1.1. WI-FI1.2. RADIO1.3. WIFI RADIO 2. SCOPE OF THE STUDY 3. OBJECTIVES OF THE STUDY 4. RESEARCH METHODOLOGY 4.1) HARDWARE DESIGN 4.2) SOFTWARE ANALYSIS 5. EXPERIMENTAL WORKDONE 5.1) Software 5.1.1) Coding 5.2) Hardware 5.2.1) GPIOs 5.2.2) Hardware Hacks 5.2.3) Display

Page Nos
( 8-14) ( 8) (9-12) (12-14) (14) (14) (15-21) (15-20) (20-21) (21-48) (21) (22-38) (38-40) (40-41) (41-45) (45-48) (48) (48) (49)

6.CONCLUSION
7.REFERENCES 8.BIODATA OF THE CANDIDATES

8|P a g e

1. INTRODUCTION: 1.1. WIFI Wi-Fi is a popular technology that allows an electronic device to exchange data wirelessly (usingradio waves) over a computer network, including high-speed Internet connections. The Wi-Fi Alliance defines Wi-Fi as any "wireless local area network (WLAN) products that are based on the Institute of Electrical and Electronics Engineers' (IEEE) 802.11 standards. However, since most modern WLANs are based on these standards, the term "Wi-Fi" is used in general English as a synonym for "WLAN". A device that can use Wi-Fi (such as a personal computer, video-game console, Smartphone, tablet, or digital audio player) can connect to a network resource such as the Internet via a wireless network access point. Such an access point (or hotspot) has a range of about 20 meters (65 feet) indoors and a greater range outdoors. Hotspot coverage can comprise an area as small as a single room with walls that block radio waves or as large as many square miles this is achieved by using multiple overlapping access points. "Wi-Fi" is a trademark of the Wi-Fi Alliance and the brand name for products using the IEEE 802.11 family of standards. Only Wi-Fi products that complete Wi-Fi Alliance interoperability certification testing successfully may use the "Wi-Fi CERTIFIED" designation and trademark. Wi-Fi has had a checkered security history. Its earliest encryption system, WEP, proved easy to break. Much higher quality protocols, WPA and WPA2, were added later. However, an optional feature added in 2007, called Wi-Fi Protected Setup (WPS), has a flaw that allows a remote attacker to recover the router's WPA or WPA2 password in a few hours on most implementations. Some manufacturers have recommended turning off the WPS feature. The Wi-Fi Alliance has since updated its test plan and certification program to ensure all newly certified devices resist brute-force AP PIN attacks. To connect to a Wi-Fi LAN, a computer has to be equipped with a wireless network interface controller. The combination of computer and interface controller is called a station. All stations share a single radio frequency communication channel. Transmissions on this channel are received by all stations within range. The hardware does not signal the user that the transmission was delivered and is therefore called a besteffort delivery mechanism. A carrier wave is used to transmit the data in packets, referred to as "Ethernet frames". Each station is constantly tuned in on the radio frequency communication channel to pick up available transmissions.

9|P a g e

Wi-Fi networks have limited range. A typical wireless access point using 802.11b or 802.11g with a stock antenna might have a range of 32 m (120 ft) indoors and 95 m (300 ft) outdoors. IEEE 802.11n, however, can more than double the range. Range also varies with frequency band. Wi-Fi in the 2.4 GHz frequency block has slightly better range than Wi-Fi in the 5 GHz frequency block which is used by 802.11a and optionally by 802.11n. Due to reach requirements for wireless LAN applications, Wi-Fi has fairly high power consumption compared to some other standards. Technologies such as Bluetooth (designed to support wireless PAN applications) provide a much shorter propagation range of <10m and so in general have lower power consumption. Other low-power technologies such as ZigBee have fairly long range, but much lower data rate. The high power consumption of Wi-Fi makes battery life in mobile devices a concern. Researchers have developed a number of "no new wires" technologies to provide alternatives to Wi-Fi for applications in which Wi-Fi's indoor range is not adequate and where installing new wires (such as CAT-5) is not possible or cost-effective. For example, the ITU-T G.hn standard for high speed Local area networks uses existing home wiring (coaxial cables, phone lines and power lines). Although G.hn does not provide some of the advantages of Wi-Fi (such as mobility or outdoor use), it's designed for applications (such as IPTV distribution) where indoor range is more important than mobility. Due to the complex nature of radio propagation at typical Wi-Fi frequencies, particularly the effects of signal reflection off trees and buildings, algorithms can only approximately predict Wi-Fi signal strength for any given area in relation to a transmitter. This effect does not apply equally to long-range Wi-Fi, since longer links typically operate from towers that transmit above the surrounding foliage. The practical range of Wi-Fi essentially confines mobile use to such applications as inventory-taking machines in warehouses or in retail spaces, barcode-reading devices at check-out stands, or receiving/shipping stations. Mobile use of Wi-Fi over wider ranges is limited, for instance, to uses such as in an automobile moving from one hotspot to another. Other wireless technologies are more suitable for communicating with moving vehicles.

1.2. RADIO Radio is the wireless transmission of signals through free space by electromagnetic radiation of a frequency significantly below that of visible light, in the radio frequency range, from about 30 kHz to 300 GHz. These waves are called radio waves. Electromagnetic radiation travels by means of oscillating electromagnetic fields that pass through the air and the vacuum of space.

10 | P a g e

Information, such as sound, is carried by systematically changing (modulating) some property of the radiated waves, such as their amplitude, frequency, phase, or pulse width. When radio waves strike an electrical conductor, the oscillating fields induce an alternating current in the conductor. The information in the waves can be extracted and transformed back into its original form. PROCESS: Radio systems used for communications will have the following elements. With more than 100 years of development, each process is implemented by a wide range of methods, specialized for different communications purposes. Each system contains a transmitter. This consists of a source of electrical energy, producing alternating current of a desired frequency of oscillation. The transmitter contains a system to modulate (change) some property of the energy produced to impress a signal on it. This modulation might be as simple as turning the energy on and off, or altering more subtle properties such as amplitude, frequency, phase, or combinations of these properties. The transmitter sends the modulated electrical energy to a tuned resonant antenna; this structure converts the rapidly changing alternating current into an electromagnetic wave that can move through free space (sometimes with a particular polarization).

Fig.1. Modulating Signals An audio signal (top) may be carried by an AM or FM radio wave. Amplitude modulation of a carrier wave works by varying the strength of the transmitted signal in proportion to the information being sent. For example, changes in the signal strength can be used to reflect the sounds to be reproduced by a speaker, or to specify the light intensity of television pixels. It was the method used for the first audio radio transmissions, and remains in use today. "AM" is often used to refer to the medium wave broadcast band.

11 | P a g e

Frequency modulation varies the frequency of the carrier. The instantaneous frequency of the carrier is directly proportional to the instantaneous value of the input signal. Digital data can be sent by shifting the carrier's frequency among a set of discrete values, a technique known as frequency-shift keying. FM is commonly used at VHF radio frequencies for high-fidelity broadcasts of music and speech (see FM broadcasting). Normal (analog) TV sound is also broadcast using FM. Angle modulation alters the instantaneous phase of a carrier wave to transmit a signal. It is another term for Phase modulation. An antenna (or aerial) is an electrical device which converts electric currents into radio waves, and vice versa. It is usually used with a radio transmitter or radio receiver. In transmission, a radio transmitter applies an oscillating radio frequency electric current to the antenna's terminals, and the antenna radiates the energy from the current as electromagnetic waves (radio waves). In reception, an antenna intercepts some of the power of an electromagnetic wave in order to produce a tiny voltage at its terminals, that is applied to a receiver to be amplified. An antenna can be used for both transmitting and receiving. Once generated, electromagnetic waves travel through space either directly, or have their path altered by reflection, refraction or diffraction. The intensity of the waves diminishes due to geometric dispersion (the inverse-square law); some energy may also be absorbed by the intervening medium in some cases. Noise will generally alter the desired signal; this electromagnetic interference comes from natural sources, as well as from artificial sources such as other transmitters and accidental radiators. Noise is also produced at every step due to the inherent properties of the devices used. If the magnitude of the noise is large enough, the desired signal will no longer be discernible; this is the fundamental limit to the range of radio communications. Electrical resonance of tuned circuits in radios allow individual stations to be selected. A resonant circuit will respond strongly to a particular frequency and much less so to differing frequencies. This allows the radio receiver to discriminate between multiple signals differing in frequency. The electromagnetic wave is intercepted by a tuned receiving antenna; this structure captures some of the energy of the wave and returns it to the form of oscillating electrical currents. At the receiver, these currents are demodulated, which is conversion to a usable signal form by a detector sub-system. The receiver is "tuned" to respond preferentially to the desired signals, and reject undesired signals. Early radio systems relied entirely on the energy collected by an antenna to produce signals for the operator. Radio became more useful after the invention of electronic devices such as the vacuum tube and later the transistor, which made it possible to amplify weak signals. Today radio systems are used for applications

12 | P a g e

from walkie-talkie children's toys to the control of space vehicles, as well as for broadcasting, and many other applications. A radio receiver receives its input from an antenna, uses electronic filters to separate a wanted radio signal from all other signals picked up by this antenna, amplifies it to a level suitable for further processing, and finally converts through demodulation and decoding the signal into a form usable for the consumer, such as sound, pictures, digital data, measurement values, navigational positions, etc. RADIO BAND: Radio frequencies occupy the range from a few hertz to 300 GHz, although commercially important uses of radio use only a small part of this spectrum. Other types of electromagnetic radiation, with frequencies above the RF range, are infrared, visible light, ultraviolet, X-rays and gamma rays. Since the energy of an individual photon of radio frequency is too low to remove an electron from an atom, radio waves are classified as non-ionizing radiation.

NAME Gamma Ray X-Ray Ultraviolet Visible Infrared Microwave Radio

WAVELENGTH Less than 0.01 nm 0.01nm-10nm 10nm-400nm 390nm-750nm 750 nm 1 mm 1 mm - 1 meter 1 mm - km

FREQUENCY(Hz) More than 10 EHZ 0.01 to 10 nm 30 EHz 790 THz 790 THz 405 THz 405 THz 300 GHz 300 GHz 300 MHz 300 GHz 3 Hz

PHOTON ENERGY(eV) 100 keV 300+GeV 120 eV to 120 keV 3 eV - 124 eV 1.7 eV 3.3 eV 1.24 meV 1.7 eV 1.24 meV 1.24 ueV 1.24 meV 12.4 feV

Table1: Comaparison Of Electromagnetic Radiations

1.3. WI-FI RADIO In 1993, the first internet radio program began distribution. At that time, radio programs were manually downloaded to be played later on the users home computer; the user experience was far from that of listening to a traditional broadcast radio receiver. It was not until several years later that streaming radio

13 | P a g e

became common, giving birth to internet radio stations that could be listened to much like traditional radio, but with several advantages. Most notably, internet radio stations were (and still are for the most part) largely devoid of on-air advertising and stations anywhere on the globe could be received by anyone with access to the internet. Over time, improvements in audio compression (such as MP3) and larger end user bandwidth improved the fidelity and reliability of internet radio. The birth of common standards like Shoutcast made it possible to listen to many stations with a single player program, like Winamp. Today, most music playback software supports streaming radio in some way. iTunes features thousands of streaming radio stations and even supports Shoutcast streams so that users can easily add additional stations of their own. The beautiful thing about streaming radio is the huge diversity in programming that is available. Many college radio stations have a streaming server, like KDVS. KDVS (90.3 FM) is an American student and community radio station based in Davis, California . Featuring a freeform programming format, the station is owned by Regents of the University of California. Broadcasting at 9200 watts, it is currently one of the most powerful freeform university based radio stations in the United States. Gems like Slay Radio specialize in music you would never hear on broadcast FM, like Commodore 64 remixes. In the past couple years, products have started to appear that mimic the form and function of a traditional radio, but play internet radio instead. Good examples of these are the Roku Soundbridge Radio and the ASUS Internet Air. Remote speaker devices, such as the Apple Airport Express, require a PC to receive and relay streaming radio but achieve a similar end result (but dont really look much like a radio).The radios used for Wi-Fi communication are very similar to the radios used for walkie-talkies, cell phones and other devices. They can transmit and receive radio waves, and they can convert 1s and 0s into radio waves and convert the radio waves back into 1s and 0s. But Wi-Fi radios have a few notable differences from other radios:They transmit at frequencies of 2.4 GHz or 5 GHz. This frequency is considerably higher than the frequencies used for cell phones, walkie-talkies and televisions. The higher frequency allows the signal to carry more data.They use 802.11 networking standards, which come in several flavors: 802.11a transmits at 5 GHz and can move up to 54 megabits of data per second. It also uses orthogonal frequency-division multiplexing (OFDM), a more efficient coding technique that splits that radio signal into several sub-signals before they reach a receiver. This greatly reduces interference. 802.11b is the slowest and least expensive standard. For a while, its cost made it popular, but now it's becoming less common as faster standards become less expensive. 802.11b transmits in the 2.4 GHz frequency band of the radio spectrum. It can handle up to 11 megabits of data per second, and it uses complementary code keying (CCK) modulation to improve speeds. 802.11g transmits at 2.4 GHz like 802.11b, but it's a lot faster -- it can handle up to 54 megabits of data per second. 802.11g is faster because it uses the same OFDM coding as 802.11a. 802.11n is

14 | P a g e

the newest standard that is widely available. This standard significantly improves speed and range. For instance, although 802.11g theoretically moves 54 megabits of data per second, it only achieves real-world speeds of about 24 megabits of data per second because of network congestion. 802.11n, however, reportedly can achieve speeds as high as 140 megabits per second. The standard is currently in draft form -- the Institute of Electrical and Electronics Engineers (IEEE) plans to formally ratify 802.11n by the end of 2009.Other 802.11 standards focus on specific applications of wireless networks, like wide area networks (WANs) inside vehicles or technology that lets you move from one wireless network to another seamlessly.WiFi radios can transmit on any of three frequency bands. Or, they can "frequency hop" rapidly between the different bands. Frequency hopping helps reduce interference and lets multiple devices use the same wireless connection simultaneously.

2. SCOPE OF THE STUDY:


Though there are people who give internet radio a bad name, like cost of operation is too high. However, the costs of running a terrestrial radio station are way higher. Wi-Fi radio stations usually broadcast very few commercials compared to traditional radio stations. Furthermore, Internet radio is accessible 24/7 as long as your internet connection is stable. In fact, there are no geographical boundaries. Generally, a person can listen to Internet radio if he has a computer that has operating systems such as Windows, Mac OS or Linux installed on his computer. In addition, streaming radio stations can be done using non-PC devices like video game consoles and mobile phones. Opportunely, there are hundreds and thousands of radio stations that one can take advantage of that are free of charge. With this advanced progression, people can listen and be streamlined on the latest trend and news all over the world. Some people may think that local AM/FM radio is basically unsustainable. On the other hand, paying for a periodical fee for a satellite radio subscription is not clever either especially if ones are on a budget.

3. OBJECTIVES OF THE STUDY:


Unlike the conventional radio which uses transmitters at fixed locations, the WiFi radio is built with a WiFi connection to the Internet. Wi-Fi radio is actually limitless. A person can listen to more than 20, 000 simulcast stations worldwide? Yes, with WiFi radio it is possible. Radio stations on the Internet enable people to listen to different stations in a better and easier way. For instance, an American living in Australia could hear an American radio station or a Chinese studying in the United States could hear Chinese relay station. It is imaginable since Wi-Fi radio receives stations as long as that station is connected to Internet.

Thanks to the high speed power of the Internet, Wi-Fi radio can transmit fast and reliable signals. It is automatically updated with the different lists of radio stations, arranged by country or genre. As a result, choosing or discovering new stations is very simple.

15 | P a g e

4. RESEARCH METHODOLOGY:
4.1. HARDWARE DESIGN: 1.A strip of breakaway 0.1 male header

Fig.2. Male Header

2.FTDI-232-3V3 USB :A (Future Technology Device International) FTDI-232-3V3 USB to serial adapter cable or some other means of connecting a 3.3V level serial port to one PC.

Fig.3. FTDI Device

16 | P a g e

3.A small scrap of perfboard and a strip of female 0.1 header (not strictly necessary, see below)

Fig.4. Female Header 4.TP-Link 3020 : Even though it is marketed as a "3G travel router", the TL-MR3020 does not include a 3G modem. It simply means that the OEM firmware and GUI support a certain range of USB 3G modems. OpenWRT supports USB 3G modems, too. The router is powered through a mini-USB socket stub (5V) and comes with a USB power adapter. The router is very similar to the TL-WR703N. Launch OpenWrt Version 2011Date Trunk (r29651 Supported 2012Trunk (r29763 12 [https://dev.openwrt.org/changeset/296 2012Trunk (r30753 01 [https://dev.openwrt.org/changeset/297 51]) 201212.09-RC1, Trunk (r32786 03 [https://dev.openwrt.org/changeset/307 63], probably earlier) ?? 12.09-RC1 (tested) 05 [https://dev.openwrt.org/changeset/327 53], probably earlier) 86]) Table2: Chipsets And Models Features: CPU Atheros Ram Flash Network 32Mi 4Mi 1 x USB Seria JTag 1 x Yes No l Model v1.0 Version v1.4 v1.6 v1.7 v1.8 Model AR9331 chipset Specific AR9331 chipset Notes AR9331 chipset AR9331 chipset AR9331(-AL1A ?); internal serial port has no pins, only solder-pads (P1 clearly visible

System on ChipB Atheros rev 1 2.0 AR7240@400MHz B AR9330 100MBit 802.11 b/g/n 150Mbps Powered via mini-USB (5V) Tiny form factor 5.7cm x 5.7cm PCB 6.7cm x 7.4cm x 2.2cm case

Input voltage: the router will function correctly when powered with voltage as low as 2.6V (determined experimentally) instead of 5V. Thus it can be powered directly from Li-Ion batteries (3.7V) without the need for an external adapter to 5V.

17 | P a g e

5.Capacitor: A capacitor contains two conductor plates which are generally made of metal and an insulator between them. This insulator also known as dielectric is made up of material like paper, plastic, ceramic or glass. The two plates are electrically connected to the external circuit with the help of two thin metal rods also known as the legs of the capacitor. These two plates are used to store charge between them. One is connected with positive voltage and other one with negative voltage. A capacitor is characterized by the parameter capacitance. Capacitance is measured as ratio of difference of charges between the plates and total voltage drop between the plates. C = dQ/dV .The unit of capacitance is FARAD.

Fig.5: Capacitor 6. Quartz crystal : This crystal resonator plays a vital role in electronics oscillator circuitry. Sometimes mispronounced as crystal oscillator, it is rather a very important part of the feedback network of the oscillator circuitry. Electronics oscillators are used in frequency control application finding their usage in almost every industry ranging from small chips to aerospace. A quartz crystal is the heart of such type of resonators. Their characteristics like high quality factor (Q), stability, small size and low cost make them superior over other resonators like LC circuit, turning forks, ceramic resonator etc. The basic phenomenon behind working of a quartz crystal oscillator is the inverse piezo electric effect i.e., when electric field is applied across certain materials they start producing mechanical deformation. These mechanical deformation/movements are dependent on the elementary structure of the quartz crystal. Quartz is one of the naturally occurring materials which show the phenomena of piezo electricity, however for the purpose of resonator it is artificially developed since processing the naturally occurring quartz is difficult and costly process.

Fig.6:Quartz Crystal

18 | P a g e

7.LCD: (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

Fig.7: LCD

Pin Diagram:

Fig.8: Pin Diagram Of LCD

19 | P a g e

Pin No 1 2 3 4 5 6 7 8 9 10

Function Ground (0V) Supply voltage; 5V (4.7V 5.3V) Contrast adjustment; through a variable resistor Selects command register when low; and data register when high Low to write to the register; High to read from the register Sends data to data pins when a high to low pulse is given

Name Ground Vcc VEE Register Select Read/write Enable DB0 DB1 DB2 DB3

8-bit data pins 11 12 13 14 15 16 Backlight VCC (5V) Backlight Ground (0V) DB4 DB5 DB6 DB7 Led+ Led-

Table3: Pin Configuration Of LCD

8. Resistors: It is one of the most crucial parts of any circuit. They vary from micro-ohms to mega-ohms in terms of their value. Also, they come in various forms like embedded as a chip in an IC, can be a bare metal or can be in form of a conductive plastic. This Insight will give a detailed exploration of carbon film resistor which has a ceramic core. Resistor looks like a solid capsule with leads at both ends which are used to

20 | P a g e

connect it to the circuit. On the capsule body, there are colored bands, typically four to six in number which tells the value of the resistance.

Fig.9: Resistor 9.AVR Micrrocontroller (Atmel): The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller

families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

Fig.10: AVR Microcontroller

4.2. SOFTWARE ANALYSIS: OPEN WRT Open Wrt is an operating system primarily used on embedded devices to route network traffic. The main components are the Linux kernel, uClibc and BusyBox. All components have been optimized for size, to be small enough to fit the limited storage and memory available in home routers. OpenWrt is configured using a command-line interface (ash), or a web interface (LuCI). There are about 2000 optional software packages available for install via the opkg package management system. OpenWrt replaces the stock firmware on the TP-LINK 3020 with an open source Linux distribution that aims to be extremely powerful and flexible. This is important for us because in turning a wireless router into a Wifi radio, we using the device in a way that the manufacturer never intended for it to be used. In addition to

21 | P a g e

including a stripped down version of the Linux operating system, drivers for wireless networking and all the basic functionality of a residential network gateway, a package manager called opkg allows you to install a wide variety of add-on modules to extend the functionality even further. HYPERTERMINAL: Hyperterminal is a software used for data communication via serial port com or TCP/IP winsock.

5. EXPERIMENTAL WORKDONE:
5.1. Software: Method Using Web GUI : Connect to the TL-MR3020 router via Ethernet cable at IP address 192.168.0.254, log in to the router's web GUI (default login/password: admin / admin) and overwrite the factory firmware by installing the openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin firmware image like a regular firmware update.

Wait for the progress bar to finish twice (the device will reset itself in the process), and proceed with basic configuration as with any fresh OpenWRT install. Web GUI upload has been confirmed to work with v1.0, v1.4, v1.6 and v1.7 hardware and requires no serial access unless something goes wrong.

Manual Method Using Serial Console and TFTP : To install OpenWrt from the U-Boot

console, we need

to install a TFTP server on one computer (tftp-hpa is recommended). Then download OpenWrt factory image to /srv/tftp (for example), and execute the TFTP server by typing tftpd -l -s /srv/tftp. Connect the TL-MR3020 using a serial console and power up the TL-MR3020. After a 1-2 seconds it shows Autobooting in 1 seconds, when displaying this enter tpl immediately.

22 | P a g e

One got a U-Boot-console, it shows as hornet>, and entered the following commands:

FailsafeMode Set one computer's IP to 192.168.1.2, subnet 255.255.255.0 Connect the TL-MR3020 to one computer via ethernet Power on the TL-MR3020 When the WPS Button starts to blink , push it until it blinks faster The device is now in Failsafe-Mode You may access it by using telnet 192.168.1.1

5.1.1. Coding:
#include <inttypes.h> #include <avr/io.h> #include <avr/pgmspace.h> #include "lcd.h" #define DDR(x) (*(&x - 1)) /* address of data direction register of port x */

#if defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) /* on ATmega64/128 PINF is on port 0x00 and not 0x60 */ #define PIN(x) ( &PORTF==&(x) ? _SFR_IO8(0x00) : (*(&x - 2)) ) #else #define PIN(x) (*(&x - 2)) /* address of input register of port x #endif */

23 | P a g e

#if LCD_IO_MODE #define lcd_e_delay() __asm__ __volatile__( "rjmp 1f\n 1:" ); #define lcd_e_high() #define lcd_e_low() LCD_E_PORT |= _BV(LCD_E_PIN); LCD_E_PORT &= ~_BV(LCD_E_PIN);

#define lcd_e_toggle() toggle_e() #define lcd_rw_high() LCD_RW_PORT |= _BV(LCD_RW_PIN) #define lcd_rw_low() LCD_RW_PORT &= ~_BV(LCD_RW_PIN)

#define lcd_rs_high() LCD_RS_PORT |= _BV(LCD_RS_PIN) #define lcd_rs_low() #endif #if LCD_IO_MODE #if LCD_LINES==1 #define LCD_FUNCTION_DEFAULT #else #define LCD_FUNCTION_DEFAULT #endif #else #if LCD_LINES==1 #define LCD_FUNCTION_DEFAULT #else #define LCD_FUNCTION_DEFAULT #endif #endif #if LCD_CONTROLLER_KS0073 #if LCD_LINES==4 #define KS0073_EXTENDED_FUNCTION_REGISTER_ON 0x24 /* |0|010|0100 4-bit mode extensionbit RE = 1 */ #define KS0073_EXTENDED_FUNCTION_REGISTER_OFF 0x20 /* |0|000|1001 4 lines mode */ #define KS0073_4LINES_MODE #endif #endif #if LCD_IO_MODE static void toggle_e(void); #endif static inline void _delayFourCycles(unsigned int __count) { 0x09 /* |0|001|0000 4-bit mode, extension-bit RE = 0 */ LCD_FUNCTION_8BIT_2LINES LCD_FUNCTION_8BIT_1LINE LCD_FUNCTION_4BIT_2LINES LCD_FUNCTION_4BIT_1LINE LCD_RS_PORT &= ~_BV(LCD_RS_PIN)

24 | P a g e

if ( __count == 0 ) __asm__ __volatile__( "rjmp 1f\n 1:" ); else __asm__ __volatile__ ( "1: sbiw %0,1" "\n\t" "brne 1b" : "=w" (__count) : "0" (__count) ); } #define delay(us) _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 ) #if LCD_IO_MODE static void toggle_e(void) { lcd_e_high(); lcd_e_delay(); lcd_e_low(); } #endif #if LCD_IO_MODE static void lcd_write(uint8_t data,uint8_t rs) { unsigned char dataBits ; if (rs) { /* write data lcd_rs_high(); } else { /* write instruction (RS=0, RW=0) */ (RS=1, RW=0) */ // 4 cycles/loop // 2 cycles

lcd_rs_low(); } lcd_rw_low();

if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT ) && (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) ) { /* configure data pins as output */

25 | P a g e

DDR(LCD_DATA0_PORT) |= 0x0F;

/* output high nibble first */ dataBits = LCD_DATA0_PORT & 0xF0; LCD_DATA0_PORT = dataBits |((data>>4)&0x0F); lcd_e_toggle();

/* output low nibble */ LCD_DATA0_PORT = dataBits | (data&0x0F); lcd_e_toggle();

/* all data pins high (inactive) */ LCD_DATA0_PORT = dataBits | 0x0F; } else { /* configure data pins as output */ DDR(LCD_DATA0_PORT) |= _BV(LCD_DATA0_PIN); DDR(LCD_DATA1_PORT) |= _BV(LCD_DATA1_PIN); DDR(LCD_DATA2_PORT) |= _BV(LCD_DATA2_PIN); DDR(LCD_DATA3_PORT) |= _BV(LCD_DATA3_PIN);

/* output high nibble first */ LCD_DATA3_PORT &= ~_BV(LCD_DATA3_PIN); LCD_DATA2_PORT &= ~_BV(LCD_DATA2_PIN); LCD_DATA1_PORT &= ~_BV(LCD_DATA1_PIN); LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); if(data & 0x80) LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN); if(data & 0x40) LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN); if(data & 0x20) LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); if(data & 0x10) LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); lcd_e_toggle();

/* output low nibble */ LCD_DATA3_PORT &= ~_BV(LCD_DATA3_PIN); LCD_DATA2_PORT &= ~_BV(LCD_DATA2_PIN);

26 | P a g e

LCD_DATA1_PORT &= ~_BV(LCD_DATA1_PIN); LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); if(data & 0x08) LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN); if(data & 0x04) LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN); if(data & 0x02) LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); if(data & 0x01) LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); lcd_e_toggle();

/* all data pins high (inactive) */ LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN); LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN); } } #else #define lcd_write(d,rs) if (rs) *(volatile uint8_t*)(LCD_IO_DATA) = d; else *(volatile uint8_t*)(LCD_IO_FUNCTION) = d; /* rs==0 -> write instruction to LCD_IO_FUNCTION */ /* rs==1 -> write data to LCD_IO_DATA */ #endif

/************************************************************************* Low-level function to read byte from LCD controller Input: rs 1: read data 0: read busy flag / address counter Returns: byte read from LCD controller *************************************************************************/ #if LCD_IO_MODE static uint8_t lcd_read(uint8_t rs) { uint8_t data;

if (rs)

27 | P a g e

lcd_rs_high(); else lcd_rs_low(); lcd_rw_high();

/* RS=1: read data

*/

/* RS=0: read busy flag */ /* RW=1 read mode */

if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT ) && ( LCD_DATA0_PIN == 0 )&& (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) ) { DDR(LCD_DATA0_PORT) &= 0xF0; /* configure data pins as input */

lcd_e_high(); lcd_e_delay(); data = PIN(LCD_DATA0_PORT) << 4; lcd_e_low(); /* read high nibble first */

lcd_e_delay();

/* Enable 500ns low

*/

lcd_e_high(); lcd_e_delay(); data |= PIN(LCD_DATA0_PORT)&0x0F; lcd_e_low(); } else { /* configure data pins as input */ DDR(LCD_DATA0_PORT) &= ~_BV(LCD_DATA0_PIN); DDR(LCD_DATA1_PORT) &= ~_BV(LCD_DATA1_PIN); DDR(LCD_DATA2_PORT) &= ~_BV(LCD_DATA2_PIN); DDR(LCD_DATA3_PORT) &= ~_BV(LCD_DATA3_PIN); /* read low nibble */

/* read high nibble first */ lcd_e_high(); lcd_e_delay(); data = 0;

28 | P a g e

if ( PIN(LCD_DATA0_PORT) & _BV(LCD_DATA0_PIN) ) data |= 0x10; if ( PIN(LCD_DATA1_PORT) & _BV(LCD_DATA1_PIN) ) data |= 0x20; if ( PIN(LCD_DATA2_PORT) & _BV(LCD_DATA2_PIN) ) data |= 0x40; if ( PIN(LCD_DATA3_PORT) & _BV(LCD_DATA3_PIN) ) data |= 0x80; lcd_e_low();

lcd_e_delay();

/* Enable 500ns low

*/

/* read low nibble */ lcd_e_high(); lcd_e_delay(); if ( PIN(LCD_DATA0_PORT) & _BV(LCD_DATA0_PIN) ) data |= 0x01; if ( PIN(LCD_DATA1_PORT) & _BV(LCD_DATA1_PIN) ) data |= 0x02; if ( PIN(LCD_DATA2_PORT) & _BV(LCD_DATA2_PIN) ) data |= 0x04; if ( PIN(LCD_DATA3_PORT) & _BV(LCD_DATA3_PIN) ) data |= 0x08; lcd_e_low(); } return data; } #else #define lcd_read(rs) (rs) ? *(volatile uint8_t*)(LCD_IO_DATA+LCD_IO_READ) : *(volatile uint8_t*)(LCD_IO_FUNCTION+LCD_IO_READ) /* rs==0 -> read instruction from LCD_IO_FUNCTION */ /* rs==1 -> read data from LCD_IO_DATA */ #endif

/************************************************************************* loops while lcd is busy, returns address counter *************************************************************************/ static uint8_t lcd_waitbusy(void)

{ register uint8_t c;

/* wait until busy flag is cleared */

29 | P a g e

while ( (c=lcd_read(0)) & (1<<LCD_BUSY)) {}

/* the address counter is updated 4us after the busy flag is cleared */ delay(2);

/* now read the address counter */ return (lcd_read(0)); // return address counter

}/* lcd_waitbusy */

/************************************************************************* Move cursor to the start of next line or to the first line if the cursor is already on the last line. *************************************************************************/ static inline void lcd_newline(uint8_t pos) { register uint8_t addressCounter;

#if LCD_LINES==1 addressCounter = 0; #endif #if LCD_LINES==2 if ( pos < (LCD_START_LINE2) ) addressCounter = LCD_START_LINE2; else addressCounter = LCD_START_LINE1; #endif #if LCD_LINES==4 #if KS0073_4LINES_MODE if ( pos < LCD_START_LINE2 ) addressCounter = LCD_START_LINE2; else if ( (pos >= LCD_START_LINE2) && (pos < LCD_START_LINE3) ) addressCounter = LCD_START_LINE3; else if ( (pos >= LCD_START_LINE3) && (pos < LCD_START_LINE4) )

30 | P a g e

addressCounter = LCD_START_LINE4; else addressCounter = LCD_START_LINE1; #else if ( pos < LCD_START_LINE3 ) addressCounter = LCD_START_LINE2; else if ( (pos >= LCD_START_LINE2) && (pos < LCD_START_LINE4) ) addressCounter = LCD_START_LINE3; else if ( (pos >= LCD_START_LINE3) && (pos < LCD_START_LINE2) ) addressCounter = LCD_START_LINE4; else addressCounter = LCD_START_LINE1; #endif #endif lcd_command((1<<LCD_DDRAM)+addressCounter);

}/* lcd_newline */

/* ** PUBLIC FUNCTIONS */

/************************************************************************* Send LCD controller instruction command Input: instruction to send to LCD controller, see HD44780 data sheet Returns: none *************************************************************************/ void lcd_command(uint8_t cmd) { lcd_waitbusy(); lcd_write(cmd,0); }

/*************************************************************************

31 | P a g e

Send data byte to LCD controller Input: data to send to LCD controller, see HD44780 data sheet Returns: none *************************************************************************/ void lcd_data(uint8_t data) { lcd_waitbusy(); lcd_write(data,1); }

/************************************************************************* Set cursor to specified position Input: x horizontal position (0: left most position) y vertical position Returns: none *************************************************************************/ void lcd_gotoxy(uint8_t x, uint8_t y) { #if LCD_LINES==1 lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+x); #endif #if LCD_LINES==2 if ( y==0 ) lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+x); else lcd_command((1<<LCD_DDRAM)+LCD_START_LINE2+x); #endif #if LCD_LINES==4 if ( y==0 ) lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+x); else if ( y==1) lcd_command((1<<LCD_DDRAM)+LCD_START_LINE2+x); else if ( y==2) lcd_command((1<<LCD_DDRAM)+LCD_START_LINE3+x); (0: first line)

32 | P a g e

else /* y==3 */ lcd_command((1<<LCD_DDRAM)+LCD_START_LINE4+x); #endif

}/* lcd_gotoxy */

/************************************************************************* *************************************************************************/ int lcd_getxy(void) { return lcd_waitbusy(); }

/************************************************************************* Clear display and set cursor to home position *************************************************************************/ void lcd_clrscr(void) { lcd_command(1<<LCD_CLR); }

/************************************************************************* Set cursor to home position *************************************************************************/ void lcd_home(void) { lcd_command(1<<LCD_HOME); }

/************************************************************************* Display character at current cursor position Input: character to be displayed

33 | P a g e

Returns: none ****************************************************************** *******/ void lcd_putc(char c) { uint8_t pos;

pos = lcd_waitbusy(); // read busy-flag and address counter if (c=='\n') { lcd_newline(pos); } else { #if LCD_WRAP_LINES==1 #if LCD_LINES==1 if ( pos == LCD_START_LINE1+LCD_DISP_LENGTH ) { lcd_write((1<<LCD_DDRAM)+LCD_START_LINE1,0); } #elif LCD_LINES==2 if ( pos == LCD_START_LINE1+LCD_DISP_LENGTH ) { lcd_write((1<<LCD_DDRAM)+LCD_START_LINE2,0); }else if ( pos == LCD_START_LINE2+LCD_DISP_LENGTH ){ lcd_write((1<<LCD_DDRAM)+LCD_START_LINE1,0); } #elif LCD_LINES==4 if ( pos == LCD_START_LINE1+LCD_DISP_LENGTH ) { lcd_write((1<<LCD_DDRAM)+LCD_START_LINE2,0); }else if ( pos == LCD_START_LINE2+LCD_DISP_LENGTH ) { lcd_write((1<<LCD_DDRAM)+LCD_START_LINE3,0); }else if ( pos == LCD_START_LINE3+LCD_DISP_LENGTH ) { lcd_write((1<<LCD_DDRAM)+LCD_START_LINE4,0); }else if ( pos == LCD_START_LINE4+LCD_DISP_LENGTH ) { lcd_write((1<<LCD_DDRAM)+LCD_START_LINE1,0); }

34 | P a g e

#endif lcd_waitbusy(); #endif lcd_write(c, 1); }

}/* lcd_putc */

/************************************************************************* Display string without auto linefeed Input: string to be displayed

Returns: none *************************************************************************/ void lcd_puts(const char *s) /* print string on lcd (no auto linefeed) */ { register char c;

while ( (c = *s++) ) { lcd_putc(c); }

}/* lcd_puts */

/************************************************************************* Display string from program memory without auto linefeed Input: string from program memory be be displayed

Returns: none *************************************************************************/ void lcd_puts_p(const char *progmem_s) /* print string from program memory on lcd (no auto linefeed) */ { register char c;

35 | P a g e

while ( (c = pgm_read_byte(progmem_s++)) ) { lcd_putc(c); }

}/* lcd_puts_p */

/************************************************************************* Initialize display and select type of cursor Input: dispAttr LCD_DISP_OFF LCD_DISP_ON display off display on, cursor off display on, cursor on

LCD_DISP_ON_CURSOR

LCD_DISP_CURSOR_BLINK display on, cursor on flashing Returns: none *************************************************************************/ void lcd_init(uint8_t dispAttr) { #if LCD_IO_MODE /* * Initialize LCD to 4 bit I/O mode */

if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT ) && ( &LCD_RS_PORT == &LCD_DATA0_PORT) && ( &LCD_RW_PORT == &LCD_DATA0_PORT) && (&LCD_E_PORT == &LCD_DATA0_PORT) && (LCD_DATA0_PIN == 0 ) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) && (LCD_RS_PIN == 4 ) && (LCD_RW_PIN == 5) && (LCD_E_PIN == 6 ) ) { /* configure all port bits as output (all LCD lines on same port) */ DDR(LCD_DATA0_PORT) |= 0x7F; } else if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )

36 | P a g e

&& (LCD_DATA0_PIN == 0 ) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) ) { /* configure all port bits as output (all LCD data lines on same port, but control lines on different ports) */ DDR(LCD_DATA0_PORT) |= 0x0F; DDR(LCD_RS_PORT) DDR(LCD_RW_PORT) DDR(LCD_E_PORT) } else { /* configure all port bits as output (LCD data and control lines on different ports */ DDR(LCD_RS_PORT) DDR(LCD_RW_PORT) DDR(LCD_E_PORT) |= _BV(LCD_RS_PIN); |= _BV(LCD_RW_PIN); |= _BV(LCD_E_PIN); |= _BV(LCD_RS_PIN); |= _BV(LCD_RW_PIN); |= _BV(LCD_E_PIN);

DDR(LCD_DATA0_PORT) |= _BV(LCD_DATA0_PIN); DDR(LCD_DATA1_PORT) |= _BV(LCD_DATA1_PIN); DDR(LCD_DATA2_PORT) |= _BV(LCD_DATA2_PIN); DDR(LCD_DATA3_PORT) |= _BV(LCD_DATA3_PIN); } delay(16000); /* wait 16ms or more after power-on */

/* initial write to lcd is 8bit */ LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); // _BV(LCD_FUNCTION)>>4; LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); // _BV(LCD_FUNCTION_8BIT)>>4; lcd_e_toggle(); delay(4992); /* delay, busy flag can't be checked here */

/* repeat last command */ lcd_e_toggle(); delay(64); /* delay, busy flag can't be checked here */

/* repeat last command a third time */ lcd_e_toggle(); delay(64); /* delay, busy flag can't be checked here */

37 | P a g e

/* now configure for 4bit mode */ LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); // LCD_FUNCTION_4BIT_1LINE>>4 lcd_e_toggle(); delay(64); /* some displays need this additional delay */

/* from now the LCD only accepts 4 bit I/O, we can use lcd_command() */ #else /* * Initialize LCD to 8 bit memory mapped mode */

/* enable external SRAM (memory mapped lcd) and one wait state */ MCUCR = _BV(SRE) | _BV(SRW);

/* reset LCD */ delay(16000); /* wait 16ms after power-on */

lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */ delay(4992); /* wait 5ms */

lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */ delay(64); /* wait 64us */

lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */ delay(64); #endif /* wait 64us */

#if KS0073_4LINES_MODE /* Display with KS0073 controller requires special commands for enabling 4 line mode */ lcd_command(KS0073_EXTENDED_FUNCTION_REGISTER_ON); lcd_command(KS0073_4LINES_MODE); lcd_command(KS0073_EXTENDED_FUNCTION_REGISTER_OFF); #else lcd_command(LCD_FUNCTION_DEFAULT); #endif lcd_command(LCD_DISP_OFF); lcd_clrscr(); /* display off */ /* set entry mode */ */ /* function set: display lines */

/* display clear

lcd_command(LCD_MODE_DEFAULT);

38 | P a g e

lcd_command(dispAttr);

/* display/cursor control

*/

}/* lcd_init */

5.2. Hardware Opening the Case: The case consists of two parts: a white base and a gray lid. The lid has two snap hinges, one right above the mini USB connector and one on the opposite side about 10 mm left of the "TP-LINK" logo. The lid is additionally glued in place on the underside on all four sides. We can try to pry it open with a thin but very stable blade tool. Start above the ethernet port where the case is not glued, and work one way around the glued corner towards the "3G USB" port (no glue there) until we reach the logo side. we should now be able to peek inside the case on the lose corner. Next proceed along to the LED side, but beware of the fragile light conductors running straight down beneath the clear plastic. They easily bend or break when you push-in one tool too far. Once three sides are open, you can steadily lift the lid until the remaining side breaks lose and neatly frees the second hinge in the process. If we work carefully and manage not to break either one of the two hinges, the gray lid should snap neatly back into place after some manual cleaning with a cutter knife.

Fig.11. Internal Structure Of TP-LINK3020 Router Hardware summary: IC Processor Flash ROM SDRAM Chipset (Wi-Fi controller) AR7240 Spansion S25FL032P Windbond W9425G6JH AR9331

39 | P a g e

Table4: Hardware Summary Of Router

Serial Console-Pinout: 1 2 3 4 T R GN VC SJ Pin 1 is clearly marked on the board. 1 X X D C To get a reliable serial connection, you might have to connect a 10k pullup resistor between TX and VCC. This is because the TX pin is connected to a voltage divider (2x5.6k) and a capacitor is put between the real pin and the TX connector. Some serial adaptors might work without the pullup resistor (confirmed for one ST3232-based adaptor), but others definitely require it (confirmed for a FTDI FT232RL-based model).

Bits per second: 115200 Data bits: 8 Stop bits: 1 Parity: None Flow control: None

If using a Linux or Mac system, the easiest way to connect to the serial console would be the screen command. It comes pre-installed on OS X, but must usually be installed on Linux systems. When installed, just type in a terminal: screen /dev/[device name] 115200

U-Boot Bootloader Console

The password to get the U-Boot prompt is tpl. You must type it quickly while the serial console is displaying:

U-Boot accepts several commands. Type help to display the list of available commands.

40 | P a g e

Linux Console: Once the original firmware has booted up completely, you can press return to activate the Linux login prompt. The password to get a root Shell access is 5up:

5.2.1.GPIOs: The AR933x platform provides 30 GPIOs. Some of them are used by the router for status LEDs, buttons and other stuff. To make the GPIOs available via sysfs, the required ones have to be exported to userspace, as it is explained on a page of the Squidge-Project. Kernel modules occupying that resource need to be removed before (e.g. "leds-gpio" and "gpio-buttons"). In output-mode, voltage levels of the GPIOs were measured against GND, after the value 1 or 0 had been written to

/sys/class/gpio/gpioX/value. In input-mode, the value of the file /sys/class/gpio/gpioX/value was read when the GPIO was floating (initial state), pulled to GND or pulled to Vcc.

The Sliding Switch has the following truth table: Mode GPIO GPIO 3G Switch 18 1 20 0 WISP 0 1 AP 1 1 Table5: Truth Table Of Sliding Switch

LEDS: How to configure the ledsLED name LED print Internal name Trigger Power Power symbol N/A (fixed supply) N/A 3G Internet tl-mr3020:green:3g USB:1-1 phy0tpt Wireless WLAN tlsymbol LAN LAN symbol tlLAN symbol mr3020:green:wla netdev:eth0 WPS WPS tlUser mr3020:green:lan n Table6: Configuration Of LEDs mr3020:green:wps preference

41 | P a g e

Buttons: Hardware.buttons :The TP-Link TL-MR3020 has one button and one sliding switch with three positions: BUTTON Event Sliding BTN_0 and WPS Button WPS Switch Hardware BTN_1 Table7: Buttons The WPS button is located at the top (illuminated by the WPS LED) and can be easily pressed with a finger. The sliding switch is located at the side and has three positions: 3G, WISP, AP.

5.2.2.Hardware Hacks: External Antenna Hack

Fig.12: Antenna Hack

If one wants to add an external antenna connector or would like to know more about the MR3020 power consumption in different op-states one can find more info Apollo-NG MR3020 External Antenna Hack [https://apollo.open-resource.org/lab:argus#modifications]

Adding I2C Bus

If one wants to add I2C bus to one MR3020, you can use GPIO 7 and 29. Remove R15 and R17, then add pullup between 3.3v and gpio pin.

42 | P a g e

Fig.13: GpIO Connections

Next step, add this line i2c-gpio-custom bus0=0,7,29

to /etc/modules.d/99-i2c and load i2c-gpio-custom

USB Hub Hack:

One can embedded usb hub to add more peripheral to one best router.

One hack a 3$ STOREX usb hub, a 2$ SD card reader and a 10$ webcam to build a robot with my MR3020.

43 | P a g e

Fig.14: GPIO Pins

USBportandmonitoringSerialConsoleviaUSB-Serial

The USB port on the TL-MR3020 is not compatible with USB1 devices (aka full speed) and only works properly with USB2 (aka high speed) devices. One can however plug a USB-Serial adapter as long as one plug that through a <$10 USB2. While one is at it, use another USB port to plug in a USB key and write data there (like serial console logs) so as not to wear out the built in flash.

Factory Boot Log

44 | P a g e

45 | P a g e

5.2.3.Display: The Atmel AVR Microcontroller: One will need to install some software to work with the AVR:

AVR MacPack for OS X (the Adafruit tutorial recommends OSX-AVR, use this instead) WinAVR for Windows

One will need:


one A-B USB cable (the kind with one flat and one square end) an AVR programmer, such as the Adafruit USBTinyISP an Atmel ATmega168 AVR microcontroller a working AVR development suite or at least a way to get a .hex file onto an AVR (see above) an LCD display like this fancy LED backlit Sparkfun 162 Character STN a solderless breadboard, like this one (comes with precut wires!) or this one. a 4-pin female 0.1 header, this breakaway header is handy. two 22pF ceramic capacitors, rated >6V (mine are 25V)

46 | P a g e

a 0.1uF capacitor, rated >6V a 10 Ohm resistor for contrast adjustment, a small 1k or 10k potentiometer a few feet of 20 to 24 gauge solid hookup wire also nice, but not required: a Sparkfun ISP breakout board to simplify connecting the programmer to the breadboard

a normally-open pushbutton switch to reset the circuit

Schematic Diagram:

Fig.15: Schematic

47 | P a g e

Modified Schematic: Fig.16: Modified Schematic Of Connections

Firmware: The AVR firmware has been significantly expanded, slightly reworked and cleaned up in some areas. The most important changes are:

The addition of a serial transmit function so the AVR can talk to the router (based on the uart_putchar function).

New code supporting the analog to digital converter (ADC) which reads the value of a potentiometer connected to ADC4.

A new Timer1 overflow interrupt has been added, which occurs roughly every 0.5 seconds. The interrupt service routine (ISR) checks the position of the tuner control, and if it has changed, sends

48 | P a g e

the value to the router. The ISR is towards the top of the file, see the SIGNAL (TIMER1_OVF_vect) section.

The ADC range of the ATmega is 0 1024 for an input voltage from 0 to 5V. The AVR sends serial data in the format Tuner: Value back to the router when the tuner position changes by more than ADC_SENS counts (default is 5). The AVR waits for an AVR Start! command from the router before sending any data, this avoids filling up the serial receive buffer on the router before its ready to start processing data. An important consequence of this is that the AVR must be reset before running the control script on the router. One can download the source code and compiled .hex file . Flash it to the AVR using any compatible ISP programmer and one should be good to go.

6. Conclusion:
The best thing about Internet radio is that it is not complicated to use. Some products have a lot of features, which make them confounding to set up and activate. Another benefit of Wi-Fi radio is its wide array of available relay stations. These choices extend far beyond basic genres such as classic rock and pop. One can choose anything from new wave to hip-hop, electronic, trance, video game soundtracks and more. Radio streaming is also available for people who are seeking free downloads of the up-to-the-minute gossip, entertainment and music.

7. REFERENCES: 1.www.musicpd.org/doc/protocol/( Music Player Daemon Protocol) 2.openwrt.org(Information about the Open Wrt Linux Distribution for Embedded Systems) 3.clockwork.craigandheather.net/internetradio.html(Information about Internet Radio MPC) 4.www.instructables.com/id/Build-your-own-Wifiradio/(Instructables Internet Radio Build)

49 | P a g e

8. BIODATA OF THE CANDIDATES:


Himanshu Gaur : I am a resident of Jhansi, Uttar Pradesh, doing B.Tech in Electronics and Communication from LPU, Phagwara. My hobbies are Singing and Listening to Music. Shanu Mohan: I am a resident of Bihar, doing B.Tech in Electronics and Communication from LPU, Phagwara. My hobbies are Photography and listening to Music. Vishagh George: I am a resident of Delhi, doing B.Tech in Electronics and Communication from LPU, Phagwara. My hobbies are Watching Movies and listening to Music. Amit Kumar: I am a resident of Patna, Bihar., doing B.Tech in Electronics and Communication from LPU, Phagwara. My hobbies are Watching Movies and listening to Music.

Вам также может понравиться