#340 How good are the ADCs inside Arduinos, ESP8266, and ESP32? And external ADCs (ADS1115)

preview_player
Показать описание
I often get questions about how to measure voltage with microcontrollers. We will look at this topic, at the quality of built-in and external Analog-to-digital converters, and I will show you some “secrets.”
In this video, we will:
- See how ADCs work
- Look at how we can determine the quality of ADCs
- Compare the ADCs of different microcontrollers with external chips
- Learn how to tweak the calculations to get the best out of any ADC
- See how we can extend the range of ADCs
- Discover some “hidden” things of Microcontrollers and their ADCs
- Look at different external boards and their usage

I am a proud Patreon of GreatScott!, Electroboom, Electronoobs, EEVblog, and others.

Links:

The links above usually are affiliate links which support the channel (no additional cost for you).
If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission (of your purchases the next 24 hours) to buy new stuff for the channel

Please do not try to Email me or invite me on LinkedIn. These communication channels are reserved for my primary job
As an Amazon Associate, I earn from qualifying purchases
Рекомендации по теме
Комментарии
Автор

The external ADC at 2.5V didn't show 2.4994 as you say as per the reference but 2.4594 at 22:22 in the video.

shenlong
Автор

I am using an ESP32 to monitor the battery voltage on my boat and send an email if it gets too low. I found the measurements very noisy due to occasional glitches. My solution was to take 8 readings and ignore the largest and smallest and average the middle 6. I do this twice and average them. It is quite easy to do in the code as you just have to keep track of the largest and smallest measurements and subtract them from the sum and divide by 6. I found this better than longer averages so that I did not get multiple glitches in my sample period. The result is very stable and quite fast. I very much enjoy your videos I am a retired circuit designer. I designed test equipment for HP (Now Keysight) and things like cable modems in the early days. Now it is a hobby.

L-
Автор

Thanks for this video! I've been puzzling over how to reduce the noise of a voltage reading for a project without losing responsiveness introduced by filtering. Based on your video, I switched over to an external ADC (ADS1115) and it solved the problem. Much appreciated!

bobblaine
Автор

For a very long time I paid my studies by building accurate DAC's for the growing digital industry. Making them precise is a science! 😊

yksw
Автор

I never get tired to watch your videos. I like the fact that you put your personal opinion in each fact. I understand better this way. Thank you

ericon.
Автор

Hints for those starting out -- for built-in ADCs, throw away the bottom bit as it's most likely useless anyway. You can average samples equal to a power of 2 by adding the integer values and doing a right shift -- for example add up 8 integer ADC samples and right shift 3, a useful trick when your microprocessor doesn't have a divide instruction! What's your signal bandwidth? Adding a single pole RC low pass filter in front of the ADC can help. And do not expect the input impedance of the ADC to be constant.

artiem
Автор

If you tweak the adc settings in the ESP32 down to 10 bits, and some other changes, the noise and accuracy gets a LOT better, I’m not at my computer at the moment but I will post the code when I get a chance.

TheDefpom
Автор

Greetings from South Africa Andreas. Well done as usual! I am always surprised how much information you share with great clarity and structure in such a short video clip. When I learnt this stuff (long before internet), choices were fewer and one had to study the data sheets thoroughly (or copy somebody's example from Elektor, EE, ETI etc). Microcontrollers (with built in ADCs) only arrived later and choices were fewer - which was a blessing, because obsolescence took longer. Hobbyists today should be thankful that you share years of experience, crammed into a nutshell...and for free. Love your work and your very structured method of teaching (unlike my ADHD brain which likes to skip around). Best Regards, Allen.

agf
Автор

Thanks for putting out such high-quality videos regularly!

TannerFrisby
Автор

At 12.07, I love the way you dodge the 1023/1024 argument!

mahudson
Автор

Thanks Andreas for this interesting video. I've used ADC lots of times, and never had concerns about the quality of the conversion (noise reduction with average method). In a current project, getting feedback from the servo's potentiometers for a robotic arm, I've used a calibration table, but now I'm going to introduce your formulas. Thanks again, Juan.

juanramirezjardua
Автор

The ADS1115 is my favorite ADC for microcontrollers. I started using it when I moved over to 32bit microcontrollers, but needed a way to read 5V automotive sensors (using a Teensy 3.2). I had 4 sensors (an MPX5700AP pressure sensor, an NTC thermistor, an AEM Wideband oxygen sensor and a 0-100psi oil pressure sensor), the ADS1115 had 4 inputs, it was a match! I didn't have to average values to get a stable reading, like you said, the stability of the ADC is fantastic.

johnhutchens
Автор

Awesome. Thank you for the great content! Just my two cents:
1. I've had to learn the hard way, that many (all?) of the ADC that have a MUX only have a single S/H aufter the MUX. This leads to problems, when reading signals on different channels with very different voltages in quick succession. There is quite a bit of "crosstalk". It's really important to make sure that the inputs to such an ADC are low impedance.
2. When I do averaging on a uC, I do 2^n samles (8, 16, 32...1024) samples, add the read values up (make sure to prevent overflow) and just use shift for the division at the end. Especially on uC without an FPU this speeds the averaging up quite a bit.

MarcoTedaldi
Автор

Very interesting video as always, thank you.
Another benefit of using the ADS1115 is that the internal PGA can be configured to read a differential signal, this is very useful for measuring some sensors, although it also results in a slower data acquisition rate.

meclucas
Автор

Thank you for the breadth of the experiments to help reinforce the lessons. Seeing how externally sourced ~5v can impact the readings was an "of course!" moment, since I'm used to using a good regulator versus an adjustable power supply for projects. Spotting things like how the radios on the chip may affect the ADC are very good clues. I'll investigate some of the external ADCs, since I'm thinking about a project that will use a mesh radio network and I had planned to use analog inputs as well... thanks again!

consoleteam
Автор

Nice video.
Remember to consider the input impedance of the ADC, especially if you use high value resistors for a voltage divider in front.

jenskaa
Автор

Thanks for this awesome intro to the ADCs!
I'm going to measure voltage of my LiPo cell, so I know when to charge it :)

peterpepo
Автор

I like the fact that your opinions/observations are unfiltered. You just tell it like it is. "Subscribed"

dvohwinkel
Автор

Perfect! Thank you for this video! I am working on a project now with analog sensors and i learned everything I needed to!

Mr_Zisky
Автор

This is such an important topic. I send a million thanks and encourage this topic.
Getting signals INTO the computer is probably just as important as having the computer to begin with.
This topic makes me consider re-writing all of computer science just to make an analog computer.

tdtrecordsmusic