0% found this document useful (0 votes)
8 views

ADC by Arduino

Uploaded by

chrislobo2830
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

ADC by Arduino

Uploaded by

chrislobo2830
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Agnel Charities’

Fr. C. Rodrigues Institute of Technology, Vashi, Navi-Mumbai


Department of Electrical Engineering
Experiment No.7 POWER ELECTRONICS LAB

Aim: Implementation of Analog to digital conversion using Arduino


Apparatus Used:
Sr No Equipment’s Name Rating Makers name
1 Arduino Uno board
2 Potentiometer

Theory

When we interface sensors to the microcontroller, the output of the sensor many of the times is analog in nature.
But the microcontroller processes digital signals. Hence, we use ADC in between the sensor and microcontroller.
It converts an analog signal into a digital and gives it to the microcontroller. There are many applications of ADC
like in a biometric application, Environment monitoring, Gas leakage detection etc.
Arduino Uno has 6 0n-board ADC channels which can be used to read analog signal in the range 0-5V.
It has 10-bit ADC means it will give digital value in the range of 0 – 1023 (2^10). This is called as resolution
which indicates the number of discrete values it can produce over the range of analog values.

Analog input pins of Arduino board


Digital Output value Calculation

ADC Resolution = Vref / ((2^n) - 1)

Digital Output = Vin / Resolution

where

Vref - The reference voltage is the maximum value that the ADC can convert.

To keep things simple, let us consider that Vref is 5V,

For 0 Vin, digital o/p value = 0

For 5 Vin, digital o/p value = 1023 (10-bit)

For 2.5 Vin, digital o/p value = 512 (10-bit)

FCRIT- IQAC/LAB-CO-DISP/01_07_23/Ver.2 1 | Page


Agnel Charities’
Fr. C. Rodrigues Institute of Technology, Vashi, Navi-Mumbai
Department of Electrical Engineering
Experiment No.7 POWER ELECTRONICS LAB

Code for ADC using Arduino


Write a program to read varying analog value generated using potentiometer which is
connected to A3 analog channel. Display the digital value on Serial monitor which we got
from the Arduino ADC.

Potentiometer connection to Arduino board

FCRIT- IQAC/LAB-CO-DISP/01_07_23/Ver.2 1 | Page


Agnel Charities’
Fr. C. Rodrigues Institute of Technology, Vashi, Navi-Mumbai
Department of Electrical Engineering
Experiment No.7 POWER ELECTRONICS LAB
Procedure:
1. Connect your Arduino board to your computer.
2. Select the right core & board by navigating to Tools > Board > Arduino AVR Boards > Board.
Make sure you select the board that you are using. If you cannot find your board, you can add it
from Tools > Board > Boards Manager.
3. Select the port. This is done by navigating to Tools > Port, where you select your board from the
list.
4. Write and save the program using the text editor.
5. Click on the arrow in the top left corner to upload the program. This process takes a few
seconds, and it is important to not disconnect the board during this process. If the upload is
successful, the message "Done uploading" will appear in the bottom output area.
6. Change the potentiometer value and take note of the corresponding digital value in the serial
monitor

Conclusion and Inference:

FCRIT- IQAC/LAB-CO-DISP/01_07_23/Ver.2 1 | Page

You might also like