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

ADVANCED ENGINEERING TOPICS

CHAPTER 2: Input and Output as a Signal

Signal
The signals are time-varying “quantities” which convey some sort of information. Signals
are passed between devices in order to send and receive information through their outputs and
inputs terminals. Signal could be in two forms; analog and digital.
We live in an analog world. For example, there are an infinite amount of colors to paint
an object, there are an infinite number of tones that we can hear, and there are an infinite
number of smells that we can smell. The color, sound and smell signals can come in
infinite possibilities of values. Meanwhile, digital signals deal in the realm of the discrete or finite,
meaning there is a limited set of values they can be. For example, a Boolean values can either be
in two form which is 0 or 1.
Working with electronics system means dealing with both analog and digital signals,
inputs and outputs. Our system normally have to interact with the real, analog world in some
way, but most of our computers or processors are purely digital components. In electronics
system, analog signal is represented by a range of voltage such as 0V to 5V, while the digital signal
is represented by two level of voltage such as 0V and 5V. Figure 1 below, illustrates the voltage
measurement of analog and digital value in electronics system.

(a) Analog (b) Digital


Figure 1: Analog and Digital Signal in Electronics

1
ADVANCED ENGINEERING TOPICS

Analog Signals
Analog signal varies over time. A time-versus-voltage graph of an analog signal should
be smooth and continuous. While these signals may be limited to a range of maximum and
minimum values, there are still an infinite number of possible values within that range. Graph in
Figure 2 shows an example of an analog signal ranging from -120V to 120V.

Figure 2: Analog Voltage Signal Graph

Digital Signals
Digital signals must have a finite set of possible values. Most commonly digital signals will be one
of two values. Timing graphs of these signals look like square waves. Graph in Figure 3 shows an
example of digital signal with two possible values of 0V and 5V.

Figure 3: Digital Voltage Signal Graph

2
ADVANCED ENGINEERING TOPICS

Hence, we can conclude that the major difference between analog and digital waves is that
analog signal are smooth and continuous, while digital signal are stepping, square, and discrete.

Interfacing to Analog Signal


Most of the sensors that sense real world data such as temperature and light intensity
produces analog signals. Hence, digital computer requires an analog to digital converter to
convert those analog signal to digital signal before it can be processed. Meanwhile some of the
output devices such as motor and servo also requires analog signal from the computer. For this,
a digital to analog converter will be required. Figure 4 shows how digital computer can be
interfaced with analog signals.

Figure 4: Interfacing Digital Computer to Analog signal

Arduino UNO has built in AD converters to received analog inputs through the pin A0 to
A5. The AD converter convert analog input with a range 0V to 5V to a 10-bit digital signals that
represent a digital value of 0 to 1023.

Practice 2.1: Push Button as Digital Input


In this practice activity, we will utilize a push button to provide a digital input signal to our Arduino
UNO based system. We will utilize the Arduino IDE serial plotter function and the seven segment
display to display the digital input signal.

3
ADVANCED ENGINEERING TOPICS

Components Used:
1. 1 Arduino UNO
2. 1 Push Button
3. 1 2.2kΩ Resistor
4. 1 seven segment LED
5. 1 Breadboard
6. Some Jumper Wires

Instructions:
1) Construct the circuit as shown Figure 5 below:

Figure 5: Circuit for Practice 2.1

2) Program the Arduino UNO to display the state of the button press. Display ‘1’ in the seven
segment display when the button is pressed and ‘0’ when the button is released. Print the
button state into the serial monitor. Refer the program in the following page if you need
help.

4
ADVANCED ENGINEERING TOPICS

Push Button Input Program

5
ADVANCED ENGINEERING TOPICS

3) Test and verify the functionality of the system by pressing the button and observing the
seven segment display. Use the Arduino serial plotter to plot the graph of the button
press.

Practice 2.2: Potentiometer as Analog Input


In this practice activity, we will utilize a Potentiometer to provide an analog input signal to our
Arduino UNO based system. We will utilize the Arduino IDE serial plotter function and the seven
segment display to display the analog signal level. The hex display will display only 10 level of
value which is 0 to 9.

Components Used:
1. 1 Arduino UNO
2. 1 Potentiometer
3. 1 seven segment LED
4. 1 Breadboard
5. Some Jumper Wires

6
ADVANCED ENGINEERING TOPICS

Instructions:
1) Construct the circuit as shown Figure 6 below:

Figure 6: Circuit for Practice 2.2

2) Program the Arduino UNO to display the analog input signal level from the potentiometer.
Divide the analog input value by 102.4 to scale down the 0 to 1024 value to 10 levels.
Print the analog input value into the serial monitor. Refer the program in the following
page if you need help.

Potetiometer Input Program

7
ADVANCED ENGINEERING TOPICS

8
ADVANCED ENGINEERING TOPICS

3) Test and verify the functionality of the system by adjusting the potentiometer and
observing the seven segment display. Use the Arduino serial plotter to plot the graph of
the analog input.

Exercises
1) Replace the push button and the potentiometer in Practice 2.1 and 2.2 by a suitable
sensors and test it.
2) Change the behavior of the system in Practice 2.1 to increase the number displayed in the
seven segment by one everytime the button is pressed.
3) Change the behavior of the system in Practice 2.2 to display a changing alphabets (A to J)
instead of numbers.

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