15 votes
Accepted

Does ADC conversion to a voltage rely on the actual value of the +5 V pin?

The ADC inside the Arduino does not measure voltage, but rather a voltage ratio. Namely the ratio from the voltage at the analog input to the voltage at the Vref pin. In the default configuration, ...
Edgar Bonet's user avatar
  • 43.1k
11 votes
Accepted

Why analogue pins affect each other?

This is to be expected. The other pins have nothing connected to it, so their voltage is floating. The Arduino MCU only has a single ADC. To read the different analog pins, it uses a multiplexer to ...
Gerben's user avatar
  • 11.3k
9 votes

Does ADC conversion to a voltage rely on the actual value of the +5 V pin?

A USB-powered Arduino Nano will have an ADC voltage reference which can't be relied on, due to the +/- 5% tolerance of the incoming USB voltage. On top of that, the Nano has an MBR0520 Schottky diode (...
Enric Blanco's user avatar
  • 2,114
8 votes

what is arduino adc reference?

The AD converter in the ATMega microcontroller (as used in Arduino) converts an input voltage to a number. This ADC happens to be 10 bit that means 2^10 states which is 1024. The number 0 (zero) ...
Bimpelrekkie's user avatar
7 votes

Expanding analog inputs to the Arduino

Expanding on part of Majenko's answer, you can use an analog multiplexer like the 74HC4051 to turn one analog port into 8. Its cousin, the 74HC4067, will multiplex 16 ports. Now with 6 analog inputs ...
Nick Gammon's user avatar
  • 38.2k
6 votes

Expanding analog inputs to the Arduino

There are two methods of doing what you want: Add more ADC channels Multiplex the existing ADC channels SPI or I2C ADC chips are readily available in a range of resolutions, sampling speeds and ...
Majenko's user avatar
  • 105k
6 votes

Uno - measure the voltage, NOT connecting GND

If I understand the description correctly, neither side of the resistor is at ground potential. There's a wide gamut of methods of dealing with this, for example using a differential ADC unit, or ...
James Waldby - jwpat7's user avatar
6 votes
Accepted

Measure Vcc on ATtiny13a?

The code you linked to measures the 1.1 V internal reference using Vcc as a reference. The ATtiny13A cannot do that. It does have a 1.1 V internal reference, but it can only use it as a reference for ...
Edgar Bonet's user avatar
  • 43.1k
5 votes
Accepted

How to set sampling rate for digital pin input?

You need: A timer A board that is capable of running fast enough to do what you want. The Nano fits the first criteria, but not the second. At 16MHz you get a clock period of 63ns. That means you ...
Majenko's user avatar
  • 105k
4 votes
Accepted

Multiplexing potentiometers

There are a few ways of doing what you want. One would be to use an analog multiplexer as in this answer: Expanding analog inputs to the Arduino Another would be to use digital I/O pins to control ...
Majenko's user avatar
  • 105k
4 votes
Accepted

Comparison of a bit vs. setting a bit

You misunderstand the meaning of: 1 << ADSC That actually means Bit-shift 1 left by the number of bits specified by the value ADSC. ADSC in this case is 6: #define ADSC 6 So if you did: ...
Majenko's user avatar
  • 105k
4 votes

Is the analogread function averaging the samples taken by the ADC?

As far as I understand the analogread() function samples an analog input at 10kHz rate. No, it samples an analog input at once per invocation. This means that if it is run 10000 times within a second ...
Ignacio Vazquez-Abrams's user avatar
4 votes
Accepted

Is the analogread function averaging the samples taken by the ADC?

If you have a loop that calls analogRead() to take a reading, and then serialPrint() to send the reading, each pass through the loop will take at least the sum of the time for those two functions ...
Neil_UK's user avatar
  • 404
4 votes
Accepted

Can I connect a voltage, higher that the 1.1V bandgap voltage, to an ADC pin

Yes, you can go above VRef. Voltage on any Pin except RESET with respect to Ground ................................-0.5V to VCC+0.5 And as the ADC reference says anything above VREF will give ...
Majenko's user avatar
  • 105k
4 votes

Lowest voltage applicable on AREF pin on Uno and Mega

According to the datasheet (page 375) the minimum voltage you are allowed to have as a reference voltage for the ADC is 1V.
Majenko's user avatar
  • 105k
4 votes
Accepted

Waterlevel sensor disrupts PH reading

That water level sensor uses bare metal which is in contact with the water. The PH sensors are sensitive for that kind of voltage in the water, even if it would be 0V. There are isolated PH sensor ...
Jot's user avatar
  • 3,246
4 votes
Accepted

Measuring Battery level with ADC already in use

As @dandavis rightly says in the comments, you can't measure the battery voltage from a power bank. This is because the power bank typically includes a step-up converter to turn the batter voltage (3....
Majenko's user avatar
  • 105k
4 votes
Accepted

Inaccurate and non-precise voltage reading from Arduino Analog pin

This should be a lot of fun but you might consider doing some research on analog circuits and A/D circuits. You have way too many digits to the right of the decimal, the accuracy is not there. The ...
Gil's user avatar
  • 1,833
4 votes
Accepted

Avoid 1-LSB noise on ADC readings

When you reduce the resolution from 10 bits to 7 bits, every possible output corresponds to an interval of inputs. If you add some hysteresis, then those intervals should overlap. Below is a ...
Edgar Bonet's user avatar
  • 43.1k
3 votes
Accepted

How to keep accurate millis() while using ADC_sleep mode?

Rather than trying to update TCNT0, it might be better to track the number of cycles lost to ADC conversions, and in an intermediate routine – eg, omillis() – compensate for those cycles. [Edit: See ...
James Waldby - jwpat7's user avatar
3 votes

Cheapest and easiest Arduino board for 12 bit ADC, thinking of M0

Use a Teensy 3.x. Those have 13 bit ADCs
Gerben's user avatar
  • 11.3k
3 votes
Accepted

Integration of signal

Sorry, but.. Why integration? Just use a peak detector like this one: The output will "float" to the peak value of the input signal, minus the voltage drop across the diode: The output oscillates ...
frarugi87's user avatar
  • 2,721
3 votes
Accepted

What will happen if I supply greater than 1.1V to analogue inputs if analogReference set to INTERNAL?

You will read 1023. The limit of the voltage is not the reference voltage but the chip supply voltage - so 5v on a 5v board.
Majenko's user avatar
  • 105k
3 votes

ADC with better performance

ADS7835 from Texas Instrument. can be interfaced with Arduino Mega or Raspberry Pi It is interfaced through SPI, 12 bit data, and up to 500kHz throughput rate.
duck's user avatar
  • 1,258
3 votes
Accepted

Can I set arbitrary SPI clock speeds?

You are limited to what your microcontroller supports. You could use a 12MHz oscillator to clock your Arduino and set the SCK divider to fOSC/2 = 6MHz (even if it was possible, I wouldn't go higher. ...
mic's user avatar
  • 584
3 votes

Does ADC conversion to a voltage rely on the actual value of the +5 V pin?

I have a page about the ADC converter on the Atmega328P. Somewhat down the page I describe voltage references. You can use the TL431 chip to provide assorted reference voltages, for example 4V: By ...
Nick Gammon's user avatar
  • 38.2k
3 votes

what is arduino adc reference?

The default behaviour is for the analog reference to be Vcc which on many Arduinos is 5V. In that case do not connect anything to AREF. However if you have a precision voltage reference then you can ...
Nick Gammon's user avatar
  • 38.2k
3 votes
Accepted

ESP8266: system_adc_read_fast() always gives 1024 as output

I created a test circuit using an AC transformer to produce a 50 cycles / second sine wave signal and tried a number of variations on the system_adc_read_fast sample program in the Espressif SDK ...
Steve's user avatar
  • 46
3 votes

How to set sampling rate for digital pin input?

Note: this is an attempt to answer the question as asked. This answer is unlikely to be of any use to the original poster, who presumably asked the wrong question. I am writing this only as a way to ...
Edgar Bonet's user avatar
  • 43.1k
3 votes
Accepted

What will happen if I set ARef to 3.3V and try to use adc connected to 5V

The datasheet of the Atmega328P does not give a direct answer to this, but Single ended channels that exceed V REF will result in codes close to 0x3FF. (Datasheet Chapter 24.5.2) sounds, as it ...
chrisl's user avatar
  • 16.3k

Only top scored, non community-wiki answers of a minimum length are eligible