Wireless Transmitter Section Block Diagram

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

The block diagram represented in Figure 3.1 gives an intuitive description of the various stages involved in order to achieve real time video tracking and wireless speed control. As seen below, the project consists of two parts, transmitter section and receiver section.

FIGURE 3.1: Overview of the design shown as a block diagram

Wireless transmitter section block diagram and description

The Transmitter section consists of RS232, PIC16F877A microcontroller, encoder, RF TX Module. This section is based on computer control. The visual basic program downloaded into the PC enables the rapid application development (RDP) of graphical user interface which will allow the user to control the speed and positioning of the robot from the computer. This is made possible by interfacing the microcontroller with the computer using MAX232 through RS232 serial communication. RS232 (recommended standard 232) support both synchronous and asynchronous transmissions and its user data is send as a time series of bits. Max232 is an integrated circuit that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits such as the microcontroller. The serial data sends from the PC through RS232 gets converted to parallel data and is fed to the PIC microcontroller and vice versa. The microcontroller PIC converts the received data to pulses which undergo modulation by the encoder. RF TX transmits the modulated signals to the RF Rx section.

FIGURE 3.2: Wireless transmitter section block diagram

Wireless receiver section description

The Receiver section consists of RF receiver module, decoder, Micro controller, motor driver, transistor, and dc motors. RF_RX_315MHz receives the transmitted signals. This signal undergoes demodulation to suppress the carrier and decode back the original data. The output is finally fed to the Micro controller (PIC), which gives the directives to three major circuits respectively. These include the motor-driver circuit, and the firing control and lastly the LCD circuit depending on the user input. Output from the microcontroller is fed to C1815 transistors before going to the L293D motor driver circuit. This is because the motors attached to the output of the driver needs high current to activate.

The signals received by the motor-driver circuit will enable the motor to choose the direction that it is supposing to be running in and also to come to a complete stop if that is what the user instructed. Furthermore, one of the signals received from user inputs will be a control reference. The control reference inputted will be fed into the PIC in-built PWM circuit to generate an appropriate duty ratio that will be sent to the wheels of the motor, these PWM control signals will directly control the speed and direction of the dc motor with the aid of the motor driver. The variation of the PWM is directly proportional to the increase and decrease of the motor speed. Notice that, although the voltage has fixed amplitude, it has a variable duty cycle which means the wider the pulse, the higher the speed and vice versa. The signals received by the transistor will turn the laser gun on/off.

3.2 HARDWARE DESIGN DETAILS

3.2.1 List of Components

There are several important components involves in the project. This section will present the most important components used in the project.

(a) PIC16F877A Microcontroller

FIGURE 3.3: PIC16F877A microcontroller.

TABLE 3.1: Technical features of the microcontroller

Parameters

Technical information

Power Rating

1mW

Vcc

5V

Current

0.5mA ~ 20mA

No. terminal

40

Memory

368 Byte

I/O ports

A,B,C,D, E

PIC16F877A microcontroller is a programmable IC. It is used to detect the signal from Visual Basic or computer and trigger the Bluetooth chip. The device works in C programming. As such, there is a need of C compiler to write a program and embedded inside the device

(b) LM7805 Voltage Regulator

FIGURE 3.4: LM7805 voltage regulator.

TABLE 3.2: Technical features of the regulator.

Parameters

Technical information

No. of terminal

3

Regulated voltage

5V ~ 20V

Maximum current

1.5A

Maximum power

2W

A LM7805 is a 5V DC regulator. It regulates the input voltage down into 5V DC. The regulation only happens when input voltage is greater than 5V.

The purpose of using regulator is to supply Vcc 5V to the PIC16F877A microcontroller and the relays. Apart from that, it is also used as an input signal to the microcontroller

(c) MAX232 IC

FIGURE 3.5: A MAX 232 IC

This is an IC used to interface between PIC16F887 microcontroller and the computer via DB9 port. The IC has 16 pins with pin 16 and 15 are VCC and ground respectively. The input data from PIC16F887 microcontroller can feds into pin 7, 8, 9 and 10. According to MAXIM Company, the operation of this IC needs four capacitors to support. These capacitors are connected at pin 1, 3, 4 and 5 of the IC.

(d) DB9 port

FIGURE 3.6: DB9 and its connection.

DB9 is a serial port that interfaces data into computer. Since most of the computers are now using USB port rather than serial port, a converter must be available to convert the data send by DB9 into the format of USB.

Figure 3.5 shows the pin configuration of DB9 and the proper connection that must be followed if PIC microcontroller is used to send the data to the computer. Notice that pin 2 and 3 represents receive and transmit data pins. These are the pins for data reception and transmission in digital bit, 1 and 0. Pin 5 is ground and no VCC supply voltage is required.

(e) Bluetooth Chip

http://tutorial.cytron.com.my/wp-content/uploads/2011/08/IMG_4719-400x352.jpg

FIGURE 3.7: Bee 2.0 IC chip.

Bluetooth Bee 2.0 is a receiver chip. The chip operates in 2.4GHz frequency with 2.5V DC input power supply. The Bee chip support data rate of 9600 bps. A more detail about the chip can be found in appendix. This chip is important in the project to detect the transmit Bluetooth signal from the computer.

(f) Relay

FIGURE 3.8: Electromagnetic 5V relay.

Electromagnetic relay operate based on the theory of force is created when a conductor carries a current. This theory somehow has related to Ampere’s law. As a current flow in a conductor, a magnetic field is generated. However, when another conductor carries a current and places close to the first one, interaction of magnetic field will produce the force. This force create internally and pull the armature in contact with another terminal, hence connection is switches from one point to another point. Typical electromagnetic relay used in the project is 5V DC. This is suit to the microcontroller as 5V output voltage is produced.

3.2.2 DC MOTOR

This project required the design of a 4 wheel car as it is for military application therefore two motors are required to control the movement of the robot in all direction. However the control is the back wheel type whiles the front wheels moves freely. DC geared motors were selected over the stepper motors because dc motor can deliver high torque at higher speed than steppers, a feedback using IR can be used which can report back to microcontroller the actual operating speed for error correction and lastly, the requirement of the project was that the movement of the robot should be smooth in correspondence with reference input speed which can be realized practically only through dc motors as stepper motors moves in steps upon receiving input signals.

DC Motor Driver Circuit

DC motors draw a relatively higher current in comparison to servo motors. The PIC 16F877A microcontroller can only provide a maximum of 25 mA current from its I/O pins which is insufficient for motor operation. Therefore, an L293D motor driver was used which can provide a maximum of 2.0 A current to dc motors. Also, this IC has an equivalent circuit of a dual H-bridge which implies that one IC is used for bidirectional control of two motors simultaneously.

Motor driver L293D input circuit

The output from the microcontroller is approximately a 3.3 mA current and the motor driver L293D needs high current in order to drive the motor, to solve this problem transistor is used as a switch. Transistor, when used as an electronic switch is normally operated alternately in cutoff and in saturation. Digital circuits make use of the switching characteristics of transistors.

3.2.3 Transistor used as an electronic switch

The basic operation of transistor as a switching device is illustrated in Figure 3.8. In the first part, the transistor is in cutoff region because the base-emitter junction is not forward-biased. In this condition, there is, ideally, an open between collector and emitter, as indicated by the switch equivalent. While in the second part, the transistor is in the saturation region because the base-emitter junction and the base-collector junction are forward-biased and the base current is made large enough to cause the collector current to reach its saturation value. In this condition, there is, ideally, a short between collector and emitter, as indicated by the switch equivalent. Actually, a voltage drop of up to a few tenths of a volt normally occurs, which is the saturation voltage,

FIGURE 3.9: Ideal switching action of a transistor schematic

(a) Conditions in cutoff

As mentioned earlier, a transistor is in the cutoff region when the base emitter junction is not forward-biased. Neglecting leakage current, all of the currents are zero, and is equal to,

(b) Conditions in saturation

When the base-emitter junction is forward-biased and there is enough base current to produce a maximum collector current, the transistor is saturated. The formula for collector saturation current is,

3.3 TECHNICAL DESIGN

Figure 3.10 and 3.11 shows the technical design circuits to control the robot motion.

FIGURE 3.10: Bluetooth transmitter circuit control.

FIGURE 3.11: Bluetooth receiver circuit.

In the transmitter circuit, PIC16F877A microcontroller is a main controller. It control the signal read from the computer via MAX232 IC and DB9. From the schematic diagram, the Bluetooth transmitter chip is connected at pin 26 of the microcontroller. This pin is for triggering the Bluetooth chip to transmit the control signal.

There are five relays which also connected to the microcontroller via transistors. These relays are used for channels selection controls. The channels selection is to choose or let the microcontroller know which command to execute. The commands are turn left, right, move forward and reverse.

In the receiver circuit, the microcontroller is designed to control the motion of the robot. The Bluetooth at the receiver is again connected at pin 26. There is an MCP602 IC which is used to amplify the Bluetooth signals. The NOT gates are used to control the functions of the robots such as move forward, reverse, turn left and right.

3.3.1 Programming Design in C language

void main(){

ADCON1 = 0x02; // Configure PORTA.F0 and PORTA.F1 as analog input

TRISA = 0xFF; // Set Port A as Input.

TRISB = 0; // Set Port B as Output.

TRISD = 0; // Set Port D as Output.

UART1_Init(9600);

Delay_ms(100);

PORTB = 0; // Off Port B.

Delay_ms(100);

//Infinite Looping.

while(1) {

PORTD = 0xFF;

if (UART1_Data_Ready()) {

if (UART1_Read() == 'F') {

PORTB.F0 = 1;

PORTB.F1 = 0;

PORTB.F2 = 0;

PORTB.F3 = 0;

PORTB.F4 = 0;

}

else if (UART1_Read() == 'B') {

PORTB.F0 = 0;

PORTB.F1 = 1;

PORTB.F2 = 0;

PORTB.F3 = 0;

PORTB.F4 = 0;

}

else if (UART1_Read() == 'L') {

PORTB.F0 = 0;

PORTB.F1 = 0;

PORTB.F2 = 1;

PORTB.F3 = 0;

PORTB.F4 = 0;

}

else if (UART1_Read() == 'R') {

PORTB.F0 = 0;

PORTB.F1 = 0;

PORTB.F2 = 0;

PORTB.F3 = 1;

PORTB.F4 = 0;

}

else if (UART1_Read() == 'M') {

PORTB.F0 = 0;

PORTB.F1 = 0;

PORTB.F2 = 0;

PORTB.F3 = 0;

PORTB.F4 = 1;

}

else {

PORTB = 0;

}

}

}

}

The above C programming is used to send the control signal to the mobile robot. The first 8 lines of the coding are used to define the I/O ports of the microcontroller. The UART function is for start up the Bluetooth commands.

The next commands after "While(1)" function are used to control the motion of the robot. Notice that the "F", "B", "L", "R" and "M" are the commands of forward, back, left, right and missile. The programs are linked to Visual Basic which will be shown in next section.

3.3.2 GUI Window Design and Coding

A simple control panel or GUI window for controlling the robot to move is shown below:

FIGURE 3.12: GUI Window design.

The Visual Basic coding for the window above is shown below:

Public Class Form1

Private Sub btnConfirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConfirm.Click

If Not txtComNo.Text = "" Then

If IsNumeric(txtComNo.Text) Then

Try

SerialPort1.PortName() = "COM" & txtComNo.Text

If SerialPort1.IsOpen = True Then

SerialPort1.Close()

End If

SerialPort1.Open()

pnPortSetting.Visible = False

pnPortSetting.SendToBack()

pnMain.Visible = True

pnMain.BringToFront()

pnPortSetting.SendToBack()

pnPortSetting.Visible = False

SerialPort1.ReadTimeout = 1

Catch ex As Exception

End Try

End If

End If

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

pnPortSetting.BringToFront()

pnPortSetting.Visible = True

pnPortSetting.Location = New Point(10,20)

pnMain.Visible = False

End Sub

Private Sub btnForward_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnForward.MouseDown

SerialPort1.Write("F")

End Sub

Private Sub btnLeft_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnLeft.MouseDown

SerialPort1.Write("L")

End Sub

Private Sub btnRight_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnRight.MouseDown

SerialPort1.Write("R")

End Sub

Private Sub btnReverse_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnReverse.MouseDown

SerialPort1.Write("B")

End Sub

Private Sub btnMissile_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnMissile.MouseDown

SerialPort1.Write("M")

End Sub

Private Sub btnForward_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnForward.MouseUp

SerialPort1.Write("A")

End Sub

Private Sub btnLeft_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnLeft.MouseUp

SerialPort1.Write("A")

End Sub

Private Sub btnRight_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnRight.MouseUp

SerialPort1.Write("A")

End Sub

Private Sub btnReverse_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnReverse.MouseUp

SerialPort1.Write("A")

End Sub

Private Sub btnMissile_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnMissile.MouseUp

SerialPort1.Write("A")

End Sub

Private Sub pnMain_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pnMain.Paint

End Sub

End Class

3.3.3 Design of interfacing circuits

Since the circuit design and components selection is being achieved successfully, design and discussions on how to provide interaction to enable transmission and reception of signals between selected components is given below.

Interfacing Serial (DB9) with PC

Presently, most PC’s has a 9 pin connector on either the side or back of the computer. From Table 3.3.1.1 it is seen that the PC can send data (bytes) to the transmit pin (i.e. pin 2) and receive data (bytes) from the receive pin (i.e. pin 3. The Serial port (DB9) rs232 (recommended Standard 232) is much more than just a connector to PC because it converts data from parallel to serial and changes the electrical representation of the data. If the connector on the PC has female pins, therefore the mating cable needs to have a male pin connector to terminate in a DB9 connector and conversely. Data bits flow in parallel from the PC because it uses many wires at the same time to transmit whereas serial flow in a stream of bits from the serial connector because it transmit or receive over a single wire. The serial port create such a flow by converting the parallel data to serial on the transmit pin (i.e. pin 2) and conversely. The serial port has a built-in computer chip called UART used in translating data between parallel and serial forms.

Table 3.3: RS232 pin assignments (DB9 PC signal set)

Pin 1

Input

DCD

Data Carrier Detect

Pin 2

Input

RXD

Received Data

Pin 3

Output

TXD

Transmitted Data

Pin 4

Output

DTR

Data Terminal Ready

Pin 5

Nil

Nil

Signal ground

Pin 6

Input

DSR

Data Set Ready

Pin 7

Output

RTS

Request To Send

Pin 8

Input

CTS

Clear To Send

Pin 9

Input

RI

Ring Indicator

(b) Interfacing MAX232 with serial (DB9)

Max232 is an integrated circuit that has a dual driver/receiver and typically converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits such as the microcontroller. The serial data sends from the PC through RS232 gets converted to parallel data and is fed to the PIC microcontroller and conversely. When a TTL level is fed to Max232 IC, it converts TTL logic 1 to between -3 V and -15 V, and converts TTL logic 0 to between +3 V to +15 V and conversely when converting from RS232 to TTL. The table below clarifies the RS232 transmission voltages at a certain logic state are opposite from RS232 control line voltages at the same logic state.

Table 3.4: RS232 Line Type and Logic Level

Rs232 line type and logic level

Rs232 voltage

TTL voltage to/from MAX 232

Data transmission (Rx/Tx) logic 0

+3V to +15V

0V

Data transmission (Rx/Tx) logic 1

-3V to -15V

5V

Control signals (RTS/CTS/DTR) logic 0

-3V to -15V

5V

Control signals (RTS/CTS/DTR) logic 1

+3V to +15V

0V

FIGURE 3.13: RS232 Interface with Max232

3.3.3.3 Interfacing MAX232 with PIC16F877A

To enable communication between the PC and the Microcontroller the MAX232 IC circuit serves as a tool of interface. As stated earlier, MAX232 converts parallel data (bytes) transmitted from the PC to serial bits stream because most digital devices require TTL or CMOs logic levels. The first step to consider when connecting the device to RS232 serial port is transformation of RS232 voltage levels into 0 and 5 volts. This is not possible without the RS232 level converters such as MAX232. In this project, MAX232 is one of the most important circuits used in order to interface PIC16F877A or modem of the computer. From Figure 3.2.4.3.1 it is seen that the output pin 10 of CMOS or TTL is fed to pin 17 of PIC16F877A and the output pin 18 of PIC16F877A is fed to CMOS or TTL. Hence, this is how the microcontroller communicates with the MAX232 IC.

FIGURE 3.14: MAX232 interface with PIC16F877A

3.4 SOFTWARE DESIGN

The software design serves as a vital role in the operation of the whole system, the system will not operate without the software. An algorithm needs to be established to enable the PIC controllers read the input and respond accordingly. The programming language selected for this project is the C program. The C program will enable communication between the user and the system, and many different interfaces in the system. With the software downloaded into it, microcontroller acts as brain of the whole video tracking and wireless speed control system. It will receive the desired speed from user through PC via the RS232 serial port. The actual speed will be compared with the desired speed and the correction will be done by microcontroller in order to maintain the desired speed of the motor. The flow chart diagram developed will give an intuitive description of the system software. The programs are divided into two parts which are main program and interrupt program. The microcontroller will always loop the main program until an interrupt occurred. When the controller receives an interrupt flag, then it will jump to interrupt the process.

3.4.1 MikroC Programming

Like other C compiler, Microcontroller can be used to compile and convert the C code into other code. Unlike ordinary Turbo C and Borland C compiler, these two compilers convert the C code into execute files. MikcroC convert C code into Hex file which is important to most of the PIC microcontroller.

Before using MikroC compiler to write any C codes, the programmer must be clear on what kind of microcontroller will be used in the project. Once the microcontroller has been specified, user can now open the MikroC compiler. Figure 3.13 shows the workspace of the MikroC window.

FIGURE 3.15: MikroC window.

As seen in Figure 3.13, the MikroC window generally consists of workspace, control menu and comments template. The workspace is a place where programmer should write the program in C language. The control menu content many functions such as save, edit, open, build, run, configure, library manager, tools setting and etc. The comments template is used to show the status of the program after compile. If the program has no syntax errors and successfully compiled, a red colour of words or sentence highlighted will not appears in the comments template. However, if there is a syntax errors, a highlighted of code will be shown in comments template using red color.

To program the microcontroller using MikroC, it is necessary to know what kind of microcontroller will be used in the project. In this project, PIC16F877A microcontroller is used. So, to let the MikroC know this microcontroller used in the project, programmer can go to "Project" and click on "New Project". A template show in Figure 3.14 will pop out immediately

FIGURE 3.16: New project wizard window.

The window shows in Figure 3.14 can be ignored by just clicking on "Next" button. The next window pop out is the microcontroller device selection. This is important as programmer has to tell the MikroC on which microcontroller will be used in the project. Go to selection box, scroll down and select the PIC16F877A microcontroller. This is shown in Figure 3.13.

FIGURE 3.17: Selecting the PIC microcontroller used in the project.

After selecting the P16F877A in the device name, click on "Next" to proceed to the clock frequency selection. In this clock frequency selection, changes the default 10MHz frequency to 20MHz and click "Next" again. Under this new window pop out, MikroC ask for files save location and its name. User can used any names and save the files to any place in the computer. However, a new folder should created to save those files otherwise it will end up will mess.

3.4.1.1 MikroC Programs

FIGURE 3.18: Writing the program in MikroC

3.4.2 Burning the program into the Microcontroller

PICkit2 software is a software used import the Hex file and ready to transfer the Hex into PIC16F877A microcontroller. PICkit2 comes along with programmer kit when purchased from the market. It is a license type of software. Figure 3.14 shows the window of the PICkit2 software when PIC16F877A microcontroller is loaded into the programmer kit.

FIGURE 3.19: PICkit2 window.

Notice that the device name is PIC16F877A. This indicates the microcontroller has been loaded into programmer kit and it is connected to the computer.

When programming is successfully loaded into the PIC16F877A microcontroller, a message of Hex file successfully imported will be shown in the window. This can be seen in Figure 3.15.

FIGURE 3.20: Loading the program into PIC16F877A microcontroller.

3.5 RF TRANSMITTER AND RECEIVER MODULE

One of the main objectives of this project is to achieve wireless communication between the transmitter and receiver section this is made possible using RF_TX_315 MHz transmitter and RF-Rx_315 MHz receiver module. In this project, a low cost transmitter and receiver module is used to transmit signals up to 100 meters at specified frequencies and hence the antenna design, RF_TX_315 have wide operating voltage range (3 V – 12 V), current range, transfer rate of , transmitting power of and lastly antenna length of 24 cm. While RF-Rx_315 operating voltage range starts from , operating current range , bandwidth of 2 MHz, its sensitivity is , and a transfer rate of and lastly data output is TTL. They both have the same modulation technique (ASK/OOK), the same frequency (315 MHz). The encoded waveform from DOUT (pin 14) of PT 2262 is fed to RF_Tx_315 MHz modulator for transmission. The modulated radio frequency is received by the RF demodulator at the receiver section and reshaped it back to its original waveform. It is important to note that since the module is used with microcontroller, the clock frequency should be less than or equal to 4 MHz. More also, keep distance between oscillator and the RF modules to avoid the disturbance from oscillator.

3.6 REAL TIME VIDEO TRACKING

Another important objective of this project is to obtain real time video tracking. To achieve that, a wireless ip camera was selected among other wireless camera. This camera is selected based on its transmission range and high resolution. It enables the transmission and reception of real time video up to 328.083 ft with a very high resolution. The camera transmitter and receiver need 9 V and a current of 200 – 500 mA to power on. Screws were used to install the camera on the robot, and then a 9 V battery is used to power the transmitter. The wireless receiver is connected to USB-enabled which enables the wireless receiver to be plugged into the USB port of the PC. Another advantage of selecting this camera is because of it size. It portability definitely will reduce complexity of the mechanical design.



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now