You are on page 1of 15

COE120L/A1 – MEMORY INPUT/OUT

1ST QUARTER S.Y. 2010-2011

USB INTERFACED FAN

By

Baldon, Michael John


Cheng, Jerry
Oballo, Kurt
Rigor, Paul Kenneth

Engr. Jocelyn Villaverde


Professor

Mapua Institute of Technology


September 2010
Table of Content
ABSTRACT

LIST OF FIGURES

Chapter 1: Design Background and Introduction


• Objective of the Problem
• Statement of the Problem
• Scope of the Project
Chapter 2: Methodology
• Schematic Diagram
• PCB Layout
• Program Layout

APPENDICES

BIBLIOGRAPHY

Abstact

The PL-2303 USB-to-Serial Bridge Controller is a low cost and high


performance single chip solution. It provides a simple and easy way to use
bridge/connectivity between the Universal Serial Bus (USB) and Serial Port
interface. With the advantage of USB port, users have the capability to utilize the
peripheral with serial port interface in an easy-to-use environment such as plug
and play & hot swap function. This single chip is designed for ideal connections
to Cellular Phone, Digital Camera, Modems or ISDN terminal adapters with over
1Mbps data transfer rate. The PL-2303 device and software drivers are capable
of providing a no-firmware-change feature that enable USB interface to be
transparent to serial port peripherals with minimum modifications.

List of Figures
Figure 1.0 Sample Device

Figure 2.0 Sample Output PCB


Figure 3 Parts Placement

Chapter 1 - Design Background and Introduction


1. The Objective of Problem
We are tasked to control a computer fan through USB. To accomplish this,
we’ve done initial researches to familiarize ourselves with USB interfacing.
After some research we found out that one easy way to interface prototypes
to USB is to make use of a USB-to-UART converter. We then searched for
available USB-to-UART converters in the market, and thus we came across
the Prolific PL2303 USB-to-UART converter which we now plan to use in our
prototype.
2. The Statement of the Problem

To develop a USB to UART converter, use to direct access the control of


computer to the devices though USB port.

3. The Scope of the project


Our project will covers the following features:
a. Full compliance with the USB Specification v1.1(0) and USB CDC v1.1
b. Support the RS232 Serial interface
c. Support automatic handshake mode
d. Over 1Mbps data transfer rate
e. Support Remote wake-up and power management
f. 96 bytes buffer each for upstream and downstream data flow
g. On chip USB transceiver
h. On chip crystal oscillator running at 12M Hz

Chapter 2 – Methodology
1.The Schematic Diagram
Schematic of USB to UART (Serial TTL) Converter

• When the Data Terminal Ready (DTR) pin of the USB to UART bridge goes high, the
transistor Q1 will switch on, which in turn will energize the relay. Due to the
energized coil the open contact will close, which will result to a closed circuit in the
path of the computer fan; hence the computer fan will turn on. The computer fan will
turn off only if the DTR pin goes low. The voltage signal of the DTR pin of the USB to
UART bridge shall be controlled through USB by a program in the computer.

2. PCB Lay-Out
• Our group made use of a relay in switching on or off of the computer
fan. A relay is a simple electromechanical switch made up of an electromagnet and
a set of contacts. Current flowing through the coil of the relay creates a magnetic
field which attracts a lever and changes the switch contacts. Relays allow one
circuit to switch a second circuit which can be completely separate from the first.
For example a low voltage battery circuit can use a relay to switch a 230V AC mains
circuit.

Circuit symbol for a SPDT relay.

3. Program Lay-Out
Initial Form

About Form
SOURCE CODE

Private Sub Form_Unload(Cancel As Integer)


On Error Resume Next
comPort.PortOpen = False
End Sub

Private Sub menuExit_Click()


Unload Me
End Sub

Private Sub switch_Click()


If deviceStatusBar.SimpleText = "Offline" Then
Exit Sub
ElseIf switch.Caption = "Turn ON" Then
switch.Caption = "Turn OFF"
comPort.DTREnable = True
indicator.FillColor = &HC000&
Else
switch.Caption = "Turn ON"
comPort.DTREnable = False
indicator.FillColor = &HFF&
End If
End Sub

Private Sub Form_Load()


Call LoadPortSetting("9600", "N", "8", "1")
End Sub

Private Sub menuAbout_Click()


aboutForm.Show
End Sub

Private Sub SysInfo1_DeviceArrival(ByVal DeviceType As Long, ByVal DeviceID As Long, ByVal


DeviceName As String, ByVal DeviceData As Long)
deviceStatusBar.SimpleText = "Verifying attached device..."
Call LoadPortSetting("9600", "N", "8", "1")
End Sub

Private Sub SysInfo1_DeviceRemoveComplete(ByVal DeviceType As Long, ByVal DeviceID As Long,


ByVal DeviceName As String, ByVal DeviceData As Long)
comPort.PortOpen = False
deviceStatusBar.SimpleText = "Offline"
End Sub
Private Sub Form_Unload(Cancel As Integer)
initialForm.Show
End Sub
Public Sub LoadPortSetting(baud As String, parity As String, databits As String, stopbit As String)
Dim portNum As Integer
Dim portFound As Boolean

portNum = 5

On Error Resume Next


Do
Err.Clear
initialForm.comPort.CommPort = portNum
initialForm.comPort.PortOpen = True
If Err.Number = 8002 Then 'Error 8002: invalid port number
portNum = portNum + 1
portFound = False
Else
portFound = True
End If
Loop Until portFound Or portNum > 20

If portFound = True Then


initialForm.comPort.Settings = baud + "," + parity + "," + databits + "," + stopbit
' initialForm.comPort.DTREnable = False
initialForm.deviceStatusBar.SimpleText = "Connected to Prolific USB to UART Bridge (COM" +
Str(portNum) + ")"
Else
initialForm.deviceStatusBar.SimpleText = "Offline"

End If
End Sub
SCHEMATIC DIAGRAM
Appendices
G6H-2-100 pinout.
Bibliography
http://www.e-gizmo.com/kit2.htm
http://www.prolific.com.tw/eng/products.asp?id=59
G6H Low Signal Relay Datasheet. Omron. PDF.

"Relays." Welcome to the Electronics Club. Web. 03 Sept. 2010.


<http://www.kpsec.freeuk.com/components/relay.htm>.

You might also like