Sei sulla pagina 1di 13

Lab Report – Experiment 6:

RS-232 Breakout Box Mini Project

Name DARREL WONG YE KHAI

Student ID 700014611 / 18908419

Name of the Unit TRANSMISSION AND INTERFACE DESIGN

Submission Date 3 JUN 2019

Due Date 3 JUN 2019

Lab Day(s) and Time(s) THURSDAY 8AM

Lab Supervisor(s) DR LAW KAH HAW

DECLARATION
Lab Report
I hereby declare this …………………………… is entirely my own work except for the
references quoted. I declare that I have read the University’s statement on plagiarism and
copyright protection and that I have upheld them in producing this work.

…….. ………………...
SIGNATURE
TABLE OF CONTENTS

1.0 Abstract 3
2.0 Aim 4
3.0 Introduction 4
4.0 Equipment 4

5.0 Stage 1 5
5.1 Pin-out
5.2 Purpose of Signal/pin
5.3 Voltages Identification
5.4 Direction and Sequence of Signal

6.0 Stage 2 8
6.1 List of Pins for 9-pin RS-232 Connector
6.2 Signal Handling
6.3 Procedure to Connect Signals to Arduino Pins
6.4 Schematic of Proposed Circuit

7.0 Stage 3 10
7.1 Circuit Assembly
7.2 Code Implementation
7.3 Echo a Character
7.4 Demonstration of RS-232 Breakout Box

8.0 Discussion 12
9.0 Conclusion 12
10.0 References 13
1.0 ABSTRACT

The outcome of the mini project is to develop and build RS232 breakout box using
RS232 interface standard between two Arduino boards. In this report, the procedures to achieve
the outcome are:
1. First physical connection was built, then operations of the RS232 were
restudied,
2. Mapping and identification of the pins were done,
3. Circuit of break-out box were assembled by compiling and run the required
code to RS232 break-out box work.

The required notes and values were recorded and discussed in the discussion and observation
section.
2.0 AIM
The purpose of this report is to understand the operation of designing and developing a
RS-232 breakout box, and also to be able to demonstrate a RS-232 breakout box.

3.0 INTRODUCTION

This report will justify the knowledge and skill to design and develop a RS232 breakout
box. A breakout box is an item of test equipment that is used to monitor the signals of a
communication part for the purpose of diagnosing issues. It has LEDs to represent each signal
of the port and they will turn on when a signal is active in the signal line.

4.0 EQUIPMENT

Equip. Qty.
1 Arduino Uno boards and USB cables 2
2 Matrix board 1
3 10𝑘𝛺 Resistors 2
4 LEDs 2
5 RS-232 Cable with Male Pin 1
6 Wire cutter and wires 1
Table 1: List of Equipments
5.0 STAGE 1

5.1 Pin-out

DE-9 Pin Signal Name Direction Description


1 DCD <-- Data Carrier Detect
2 RXD <-- Receive Data
3 TXD --> Transmit Data
4 DTR --> Data Terminal Ready
5 GND --- System Ground
6 DSR <-- Data Set Ready
7 RTS --> Request to Send
8 CTS <-- Clear to Send
9 RI <-- Ring Indicator
Table 2: List of Each Signal/pin of a 9-pin RS-232 Connector

Figure 1: RS-232 DB9 Connector Male and Female Pin-out list


5.2 Purpose of Signal/pin

DE-9 Signal Description Functions


Pin Name
Pin 1 DCD Data Carrier After a data terminal is detected, a signal is sent to the
Detect data set that is going to be transmitted to the terminal
Pin 2 RXD Receive Data The data set receives the initial signal via the receive
data line (RxD)
Pin 3 TXD Transmit Data The data terminal gets a signal from the data set, a
confirmation that there is a connection between the data
terminal and the data set
Pin 4 DTR Data Terminal A positive voltage is applied to the data terminal ready
Ready (DTR) line, a sign that the data terminal is prepared for
the transmission of data
Pin 5 GND Signal Ground A return for all the signals on a single interface, the
signal ground (SG) offers a return path for serial
communications. Without SG, serial data cannot be
transmitted between devices
Pin 6 DSR Data Set Ready A positive voltage is applied to the data set ready
(DSR) line, which ensures the serial communications
between a data terminal and a data set can be completed
Pin 7 RTS Request to Send A positive voltage indicates the request to send (RTS)
can be performed, which means the data set is able to
send information to the data terminal without
interference
Pin 8 CTS Clear to Send After a connection has been established between a data
terminal and a distant modem, a clear to send (CS)
signal ensures the data terminal recognizes that
communications can be performed
Pin 9 RI Ring Indicator The ring indicator (RI) signal will be activated if a
modem that operates as a data set detects low
frequency. When this occurs, the data terminal is
alerted, but the RI will not stop the flow of serial data
between devices
Table 3: List of Purpose of each Signal/pin
5.3 Voltages Identification

For RS232 transmitter and receivers to function as it was designed, the voltage
levels were identified for the data transmission. There are two logical states which are
defined as per voltages identification listed below:

Signal Voltage Levels (Volts) Logical state


-3 to -25 1
+3 to +25 0
Table 4: Signal voltage levels and Logical states

The voltage states for the control signal were also defined to be used within
RS232.

Signal Voltage Levels (Volts) Logical state


-3 to -25 OFF
+3 to +25 ON
Table 5: Control voltage levels and Logical states

5.4 Direction and sequence of Signal

Most RS232 devices implement additional handshaking pins. The most useful
are called RTS (Request To Send) and CTS (Clear To Send). The CTS pin is a DCE
output and is used by the DCE to indicate that it can accept data on the TxD line. The
RTS line is an output on a DTE and is used to indicate that the DTE wants to send (RTS
was originally used to control half-duplex modems- these are rarely seen today.) Since
these signals are used to control the flow of data from the DTE (and optionally from
the DCE) these pins are called (hardware) “Flow control” signals.

Figure 2: Direction and sequence of Signals


6.0 STAGE 2

6.1 List of Pins for 9-pin RS-232 Connector

Figure 3: Maxim chip pin mapping

6.2 Signal Handling

Figure 4: Signal handling between RS-232 and Arduino Uno


6.3 Procedure to Connect Signals to Arduino Pins

For this part, previously used signally handling method were used by
connecting Arduino and RS-232 connector physically to transmit-receive the signals.
The following schematic show the physical connection used to connect each signal to
Arduino pins.

Figure 5: Physical connection for each signal to Arduino Pins

6.4 Schematic of Proposed Circuit

Figure 6: Schematic Diagram of Proposed Circuit


7.0 STAGE 3

7.1 Circuit Assembly

Circuit were assembled as shown in the Schematic Diagram in Figure 6.


Following shows the assembled circuit:

Figure 7: Assembled circuit based on Schematic Diagram

7.2 Code Implementation

Figure 8: Implemented code and compiled on Arduino Software


7.3 Echo A Character

In the developed code as shown in Figure 8 above, hardware handshaking


functionality was also added to echo a character and screenshots were also taken for
demonstration of echo.

Figure 9: LED toggled during Echo A Character

7.4 Demonstration of RS-232 Breakout Box

Demonstration were done after successful designing and developing the RS-232
Breakout Box with various codes implemented and compiled with the Arduino
Software.

Figure 10: Final Outcome of the Demonstration


8.0 DISCUSSION

The aim of the experiment was to understand the operation of designing and developing
a RS-232 breakout box
• RS-232 is used for communication between the serial monitor and Hyper Terminal.
• All Arduino boards have at least one serial port.
• Serial (RS-232) communicated with the computer via USB when established
communication but when communicating using hardware handshaking then the
board must use the specific signals which is explained in the previous part of the
project to communicate via DB9 RS-232 connector.
• Hardware handshaking used for this project is a technique for regulating the flow of
data across an interface by means of signals carried on separate wires. For example,
the Rx (Receive data) and Tx (Transmit data) signals on a RS-232 interface.

The Arduino serial library does not support full hardware flow control or handshaking.
Therefore, the Arduino code was developed to implement that facility using code rather than
using the provided code. Finally, whenever any signal passed from either serial monitor to
HyperTerminal or HyperTerminal to serial monitor, LEDs used to toggle which proves that
breakout communications successful.

9.0 CONCLUSION

In conclusion, the experiment was successful as the serial communication of the RS-
232 and Arduino were observed moreover the implementation of handshaking in the event of
garbage text due to the logic voltage level being too low to be either logic 1 or logic 0. It was
proved that without the IC the serial communication between the RS232 and the Arduino UNO
would not be possible as the voltages levels were not right, but the IC uses charge pumps and
external capacitors to adjust the voltage levels to allow the communication. The message sent
from RS232 to the Arduino UNO was delivered unaffected which proves that the objectives of
the experiment were accomplished.
10.0 REFERENCES

Arduino. (NIL). RS-232. Retrieved from Arduino:


https://www.arduino.cc/en/Tutorial/ArduinoSoftwareRS232
Kirstein, B. (2016, Juky 20). RS232 9 Pin Pinout: Here’s What You Need to Know. Retrieved
from Stratus Engineering INC: https://www.stratusengineering.com/rs232-9-pin-
pinout/
RS232 Voltage Levels & Signals: DTR, CTS, RTS. (2018, NIL). Retrieved from electronics
notes: https://www.electronics-notes.com/articles/connectivity/serial-data-
communications/rs232-signal-voltage-levels.php

Potrebbero piacerti anche