Analog Signal Interfacing with Arduino 

What is Signal?

The signal is electrical or sound waves that are sent or received which carry some information in it.

There are two types of signals. Analog signal and Digital signals.

What is an Analog Signal?

 An analog signal is a type of signal that varies continuously over time and can represent any.

 Value within a given range. It is used to convey information such as sound, light, temperature, 

or pressure using continuous changes in voltage, current, or frequency.

Differences in Analog and Digital signals

Analog Signals:- 

1. Analog signals are continuous signals.

2. They are represented by a sine wave.

Digital Signals:-

1. Digital signals are discrete signals.

2. They are represented by a square wave.

Functions for analog signal interfacing:-

1. analogRead( ):- Reads the value from a specified digital pin, either HIGH or LOW.

Syntax:- analogRead(pin);

Parameters:-

Pin:- To which the object is connected.

Task 1:- print the value of the potentiometer on LCD.

Code:-

#include<LiquidCrystal.h>

LiquidCrystal lcd(13,12,5,4,3,2);

int pot=A0;

int a;

void setup ()

{

  lcd.begin(16,2);

  pinMode(pot,INPUT);

}

void loop ()

{

  a=analogRead(pot);

  lcd.setCursor(0,0);

  lcd.print(a);

  delay(1000);

  lcd.clear();

}

Output:-