## Theory of digital and analog signals (basic)

To start this topic we should know the basic definition of a sensor, a sensor is a device that converts real world quantities such as temperature and light into electrical signals, these signals can be either analog or digital. A signal is an electrical quantity such as voltage that changes over time.

Just for teaching purpose we can assume we are using 5 volt supply, this is just an arbitrary value and nothing special about it, so the voltage cannot get higher than 5.  An analog signal can take any value between 0 and 5 so 0.00000002, 4.998, 3.51, 1.56, 0.5 are all valid values, assuming we are reading temperature, the temperature is no just 32 C/F but in reality it is 32.something. So analog signal are precise but unfortunately computers cannot process any value but only discreet values call digital signals

Digital signals have definite values. Assuming this signal has a “resolution” of 5 volts we would only have 5 values, 0,1,2,3,4,5. It cannot recognize nothing in between.  So 4.5V is an invalid value.  An example would be a stairs,  If you a have a floor 3  meters  (about 11 feet) high and we  have 20 steps (resolution) you could only go up by 15 cm at a time so you can be 30 cm off the ground buy it is impossible to stand 50 cm of the ground because a digital signal can only hold discreet steps.  Digital is the only way we can talk to a computer or microprocessor.

A graph of analog (black) versus digital (yellow) is found attached

AttachmentSize
analog vs digital.png37.2 KB