### Arduino 101: Tutorial #3 |Analog and Digital Signals|

Hello everyone!

In this tutorial we will try to understand the true meaning of analog and digital signals. I will try to explain it in the simplest way possible without using any fancy terms. So let's get started.!

### Consider an example

Let us try to understand analog and digital signals using an example.

Suppose one day you go out to play football with your friends in a nearby park. After an hour of playing, you realize that you're thirsty and need to drink water. So you go to your home, fill a big glass of water and start drinking from it. After finishing three quarters of a glass you realize that you're full and can't drink any more water. So you decide to throw the remaining quarter of water of glass in the sink, and go out to play again.

In this case you had the choice on how much water you want to drink. You chose to drink three quarters of a glass. As a matter of fact, there are almost infinite number of possibilities in which you can drink water from that glass. You can decide to drink 0.6735384 parts of water in a glass, or 0.8927263562729 parts from an infinite set of possibilities. But in this case you waste the remaining water in the glass.(Not a good thing!)

On the other hand, let's consider a situation where you have only two possibilities to drink water from the glass. Either you drink half of the water in the glass, or whole of the water in the glass. If you drink half the glass, you will still be thirsty. Or, if you decide to drink the whole glass of water, you will be so full that you will not be able to go out and play again.(On the plus side, at least you didn't waste water! :) )

The purpose of this example is to convey the idea that there are two ways to utilize a resource:

- Either you choose from an infinite set of possibilities
- Or you chose from a discrete set of possibilities.

Neither of both these systems are ideal for a given situation. But in any given situation, we make a compromise between the two systems.The case in which you choose from an infinite set of possibilities, is an analog system. On the other hand, the case of discrete set of possibilities is a digital system.

### Back to Electronics

Ok. So now that we understand the two kind of systems. Let's move back to the electronics world.

####
- Analog: The term analog specifically refers to a set of voltage values that can exist in an infinite possible ways within two voltage limits. For eg. in a rotary potentiometer with an input voltage of 5volt, you can turn the knob to obtain any value of voltage from an infinite set of possible values from 0 to 5 volt.
- Digital:The term digital specifically refers to a set of voltage values that can exist only in a finite possible ways within two voltage limits. For eg. You can join six AA size 1.5volt cells in series to make a 9volt battery. In this system, between 0volt and 9volt, we have only six possible steps from which we can choose to make our battery. They are, 1.5volt, 3volt, 4.5volt, 6volt, 7.5volt and 9volt. Hence we have a finite voltage values, and not infinite as in case of analog.

Now that we understand what the terms analog and digital mean in electronics, let's understand analog and digital signals. Infact, let's first understand what "signal" means.

#### Signal: A signal, by definition, conveys information about the behavior or attributes of some phenomenon with respect to change in time or space. In simple terms,it means, that a time varying quantity can be used to convey information about some phenomena.

Now let us try to apply this definition to define analog and digital signals.

- Analog Signal: It is any continuous variation in voltage with respect to time, representing some other time varying quantity. For eg. in an analog audio signal, the instantaneous voltage is a direct representation of instantaneous air pressure of sound wave. The image below is an example of the same.
#### Digital Signal: It is any discrete variation in voltage with respect to time, representing some other time varying quantity.For eg. in a digital audio signal, the instantaneous voltage is a direct representation of instantaneous air pressure of sound wave corresponding to a discrete voltage level. The image below is an example of the same.

Note: There is a common misconception that digital signals have only two states, that is either 0 or 1. This is totally wrong. As we discussed in this tutorial, any signal that exists in discrete levels can be termed as a digital signal. However, the digital signal that we use in modern day digital electronics is a 2-bit signal. i.e it has only two states, either 0 or 1. Hence, in some situations it may be acceptable to call digital signal as a two state signal. But in general, digital signals can take any number of bits, or for that matter, any number of finite levels.

I hope this tutorial gives you a basic insight about analog and digital signals. In next tutorial, we'll see how we can use these signals in our arduino projects.

## Comments

## Post a comment