Introduction

This document will provide a instructions on how to use the oscilloscope, to read the electrical signal that is being transimitted from the Arduino Uno development board out of the Tx pin.


As a reminder, you are to:

  1. Interrogate the signal displayed on the oscilloscope so that you translate the electrical signal to a series of 1's and 0's

  2. Then workout which way the signal is being transmitted, is it Least to Most signficant bit or vice versa?

  3. What is the decimal representation of the signal?

  4. What is the ASCII character?

  5. Calculate the speed of the transmitted signal

  6. Save the digital representation of the signal to usb, so you can place it in your report.

  7. Reset the Arduino and do it again until you have five different signals


Deferral/Referral Students

If you are are a deferral or referral student you will have access to click this, RANDOM_SIGNALS, to obtain five pre-captured signals.

Any problems please contact the module leader!


Code Snippet

So you can see what is going on under the hood, the snippet of code below demonstates that all characters are randomly generated from the ASCII table:

You can see firstly that a random baudrate is selected by creating a random seed from the analogue pin 2 of the Arduino.

randomSeed (analogRead(2));
Serial.begin(baudRate[random(0,3)]);

... Next a random symbol is picked from the printable ASCII table.

randomSeed (analogRead(5));
int startingPos = 33;
int selectedPos = random(0,94);
char symbol = (char)(startingPos + selectedPos);

Finally, the symbol is sent to the Tx pin every 2 secs until you reset the Arduino, which then starts the whole sequence off again.

while(true)
{
    Serial.print(symbol);
    delay(2000);
}

Arduino Setup

  1. Ensure one end of the one cable is secured into the TX connection (Tx->1) on the Arduino, the other end of the cable to be attached to the red oscilloscope crocodile clip. As shown below:

  2. Similarly ensure that the Arduino has been grounded to the oscilloscope by connecting the GND pin of the Arduino to the black crocodile clip of the oscilloscope.

Light         Dark

Dark

  1. Similarly ensure that the Arduino has been grounded to the oscilloscope by connecting the GND pin of the Arduino to the black crocodile clip of the oscilloscope.

  2. Now you can power on the Arduino with the power adapter provided.

Oscilloscope Setup

Using the oscilloscope, we will be able to capture the randomly generated signal being transmitted from the Arduino.

Light

  1. Turn the oscilloscope on and ensure that the channel is connected to the selected the BNC cable connection. The Channel selected should be highlighted as shown below. The signal to be shown will represent the colour shown next to the scale, i.e. channel 1 will be yellow., channel 2 blue.

Light         Dark

  1. Adjust the scale knob above the BNC connector to set the scale to the 2V range. Visible in the left-hand corner of the screen.

Light

  1. Press the button labelled measure. A list of commands will now be displayed on the screen, select ‘Add Measurement’ option.

Light

  1. Next select the ‘time period’ option. Using the knob labelled ‘Variable’ highlight the frequency option and press select.

Light

  1. Press the measure button again to remove the menu

  2. Now press the Zoom button, this will provide another menu on the screen, highlight the one labelled ‘Horizontal Time/Div. Set the scale to read 100µS using the variable knob.

Light

  1. To hide the menu options press ‘menu off’ on the right-hand side of buttons.

  2. You should now see the transmitted data flashing intermittently. Press the run/stop button to capture the signal. Adjust if needed the scale and position controls to place signal to the centre of the screen.

Light

  1. When you have positioned your signal to the middle of the screen to show the start and finish of the transmitted character Byte, press the Run/Stop button. This will then capture the signal and will stop flashing in time with the Baud rate, allowing you to calculate the binary representation. This may take a couple of attempts to get the timing right. If this is the case, just press the Run Stop button again and retry.

  2. Insert the USB drive provided into the Oscilloscope to download your signal to use in your written report and enable you to analyse the data. Once the USB has been attached press the hardcopy button located on the top right of the screen as shown below

Light

Reading the Data

  1. You should now have a hard copy of the transmitted signal, which will look something like the image below:

Light

  1. The Byte shown above is represented as 8 bits of Binary 0 or 1. We can then work out proportionally the binary code representation. Remembering to read right to left. The example above is displaying 00100001 .

Remember that:

  • A 0 is represented when the signal is on the 0V line indicated on the screen represented in the left-hand side of the screen

  • A 1 is represented as 5V as indicated on the right-hand side of the screen

  1. Using the ASCII code conversion table you can now identify the character being displayed below once you have converted the binary notation into a decimal number:

ASCII Table

DecCharDecCharDecCharDecCharDecCharDecChar
32SPACE50268D86V104h122z
33!51369E87W105i123{
34"52470F88X106j124
35#53571G89Y107k125}
36$54672H90Z108l126~
37%55773I91[109m127DEL
38&56874J92\110n
39'57975K93]111o
40(58:76L94^112p
41)59;77M95_113q
42*60<78N96`114r
43+61=79O97a115s
44,62>80P98b116t
45-63?81Q99c117u
46.64@82R100d118v
47/65A83S101e119w
48066B84T102f120x
49167C85U103g121y

Calculate the Baud Rate

As part of the assignment you have to calculate the baudrate or transmission speed of the signal displayed on the oscilloscope.

\[ time_{perbit} = \frac{timeDivision\cdot10^{unit}}{bits} \]

\[BR_{est} = \frac{1}{time_{perbit}} \]

Match \(BR_{est}\) with list of baudrates:

  • 2400 (\(a\ bit\ per\ 416\mu s\))
  • 4800 (\(a\ bit\ per\ 208\mu s\))
  • 9600 (\(a\ bit\ per\ 104\mu s\))
  • 19200 (\(a\ bit\ per\ 52\mu s\))
  • 38400 (\(a\ bit\ per\ 26\mu s\))

For example:

\[ 50\mu s = \frac{50\cdot 10^{-6}}{1}\ || \frac{5\cdot 10^{-5}}{1}\]

\[ 20000 = \frac{1}{50\cdot 10^{-6}}\ || \frac{1}{5\cdot 10^{-5}} \]

Therefore the closet baudrate is \(19200\) which is \(1\ bit\ every\ 52\mu s\)