• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How Analog-to-Digital Converter (ADC) Works

By Abhishek Ghosh June 28, 2023 8:56 am Updated on June 28, 2023

How Analog-to-Digital Converter (ADC) Works

Advertisement

An analogue-to-digital converter (ADC) is an electronic device whose function is to translate an analogue quantity into a digital value encoded on several bits. The converted signal is usually an electrical voltage.

As we have explained before, the GPIO pins of any microcontroller board such as Arduino, ESP32 etc can handle digital input or output only. The analogue pins of Arduino are an implementation of an Analog-to-Digital Converter (ADC).

When we are using Arduino UNO and want to read analog pin input in volts (which can be 0 to 5 V) then we can give digital output (0 to 1023) depending upon microcontroller resolution. Arduino has a 10-bit ADC which means it can detect (2^10 = 1024) discrete analog levels.

Advertisement

---

The conversion process is based on the quantization of a signal, i.e. by matching it to the nearest quantized level. The quantification of a signal degrades its richness (there is a loss of information), so it is a destructive transformation that takes place. The greater the number n of bits of the converter on which the conversion is performed, the more the quantization has a reduced effect on the degradation of the signal (without ever cancelling it).

An ADC converts a continuous input signal (analog signal) into a discrete-time and discrete-value sequence of digitally represented values. Due to a finite number of possible output values, quantization always takes place. The result of an AD conversion can be imagined in a signal-time diagram in a sequence of dots with stepped horizontal and vertical distances. The main parameters of an ADC are the bit rate (explained above) and its maximum sampling rate. The conversion time is usually much smaller than the reciprocal of the sampling rate.

How Analog-to-Digital Converter ADC Works

Even the bit depth of an AD converter limits the maximum possible accuracy with which the input signal can be converted. The usable accuracy is lower due to further sources of error of the ADU. In addition to methods that are as fast as possible, there are also slow (integrating) methods for suppressing interference coupling.

In case of Arduino, the simplified equation ADC uses is:

ADC reading = (1023/5) * Analog voltage measured

So, the (1023/5) part becomes a constant. The topic ADC is highly complex. The things to remember for building projects are resolution (in bits), maximum sampling rate and noise.

Previously we talked about Kalman filter to “smoothen” the output. You’ll get the required library for Arduino to use the Kalman Filter.

The problem of ADC and PWM with simple code like this one:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
int sensorValue = 0;
int outputValue = 0;
 
void setup()
{
  pinMode(A0, INPUT);
  pinMode(9, OUTPUT);
  Serial.begin(9600);
}
 
void loop()
{
  // read the analog in value:
  sensorValue = analogRead(A0);
  // map it to the range of the analog out:
  outputValue = map(sensorValue, 0, 1023, 0, 255);
  // change the analog out value:
  analogWrite(9, outputValue);
  // print the results to the serial monitor:
  Serial.print("sensor = ");
  Serial.print(sensorValue);
  Serial.print("\t output = ");
  Serial.println(outputValue);
  // wait 2 milliseconds before the next loop for the
  // analog-to-digital converter to settle after the
  // last reading:
  delay(2); // Wait for 2 millisecond(s)
}

… is the “jitteriness” out of noise and other factors. You’ll never a get steady output out of the box such as 3.3v, it will dance from something 2.8 to 3.7v :

To solve this issue, you can use any algorithm like Kalman Filter. There are simple Kalman filer libraries with easy examples:

Vim
1
https://github.com/denyssene/SimpleKalmanFilter/blob/master/examples/BasicKalmanFilterExample/BasicKalmanFilterExample.ino

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How Analog-to-Digital Converter (ADC) Works

  • Detect Smartwatch With ESP32 on IBM Watson IoT Widget

    In our previous guide, we have shown that we can trigger ESP32 (with Arduino IDE) to send message to IBM Watson IoT in Presence of a Particular Samsung Galaxy Smartwatch. That process involves BLE and WiFi. In our one series of articles on Samsung Smartwatch as Proximity Switch, we triggered a local event, such as […]

  • ESP32 MAX30102 Pulse Oximeter Code

    In the previous guide of MAX30102, we have shown a test code with the MAX30102 module build/sold by Maker Focus mounted on a MH-ET LIVE breakout board. Our two challenges are – ESP32 is not exactly same as Arduino UNO and the good looking MH-ET LIVE breakout board is not same as the MAX30102 module […]

  • WROOM ESP32 Example Codes For IBM Watson IoT Platform

    Here Are Few WROOM ESP32 Example Codes For IBM Watson IoT Platform So That Anyone Can Get Started With Both of Them Without Huge Experience.

  • Arduino With DHT 11 Sensor and Arduino Online IDE : Basic IoT

    Arduino With DHT 11 Sensor and Arduino Online IDE is Example of Basic IoT Which Needs No Special Hardware But Arduino, DHT11, Internet Connection & Web Browser.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy