1.1V reference voltage (Nano)

Hello everyone.

I am trying to measure the reference voltage of my circuit. I have connected an ADC, a shiftregister, a few LED, thermistor, etc. to the chips. Everything is supplied using the Arduinos own 5V. This 5V are not always that stable. Therefore I wanted to measure the supply voltage back to itself.

I read in another topic

http://forum.arduino.cc/index.php?topic=220044.0

that it is possible to measure the external voltage using the internal reference (1.1V for Nano).

In idle mode (no leds are turned on) the measured voltage is 4830mV and my oscilloscope shows the same value. After turning on a few things the voltage drops a little e.g. 4810mV from the Arduino and 4785mV on the oscilloscope. At first I thought this was just a standardized error.

Connecting a MQ-2 Sensor (+5V-GND) the voltage drops to 4005mV on the oscilloscope but the reference on the Arduino shows 4630mV.

Does the 1.1V refer to the Arduinos power supply? Is it even possible to measure the 5V/3.3V output back to itself?

v3xX:
Connecting a MQ-2 Sensor (+5V-GND) the voltage drops to 4005mV on the oscilloscope but the reference on the Arduino shows 4630mV.

This is the moment you scribble a schematic on a sheet of paper, take a reasonably good quality picture of that schematic, then post the picture.

v3xX:
that it is possible to measure the external voltage using the internal reference (1.1V for Nano).

It is...

https://forum.arduino.cc/index.php?topic=38119.0

a sketch is attached.



I used the code in your link

int getBandgap(void)
    {
       
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
     // For mega boards
     const long InternalReferenceVoltage = 1115L;  // Adust this value to your boards specific internal BG voltage x1000
        // REFS1 REFS0          --> 0 1, AVcc internal ref.
        // MUX4 MUX3 MUX2 MUX1 MUX0  --> 11110 1.1V (VBG)
     ADMUX = (0<<REFS1) | (1<<REFS0) | (0<<ADLAR) | (1<<MUX4) | (1<<MUX3) | (1<<MUX2) | (1<<MUX1) | (0<<MUX0);
#else
     // For 168/328 boards
     const long InternalReferenceVoltage = 1050L;  // Adust this value to your boards specific internal BG voltage x1000
        // REFS1 REFS0          --> 0 1, AVcc internal ref.
        // MUX3 MUX2 MUX1 MUX0  --> 1110 1.1V (VBG)
     ADMUX = (0<<REFS1) | (1<<REFS0) | (0<<ADLAR) | (1<<MUX3) | (1<<MUX2) | (1<<MUX1) | (0<<MUX0);     
#endif
        // Start a conversion 
     ADCSRA |= _BV( ADSC );
        // Wait for it to complete
     while( ( (ADCSRA & (1<<ADSC)) != 0 ) );
        // Scale the value
     int results = (((InternalReferenceVoltage * 1024L) / ADC) + 5L) / 10L;
     return results;
    }

and my result is now 459 (mV?).

The code I originally used was

long internalVcc() {
    long result;
    // Read 1.1V reference against AVcc
    ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
    delay(2); // Wait for Vref to settle
    ADCSRA |= _BV(ADSC); // Convert
    while (bit_is_set(ADCSRA,ADSC));
    result = ADCL;
    result |= ADCH<<8; //result |= ADCH<<6;
    result = 1125300L / result; // Back-calculate AVcc in mV
    return result;

  }

which gives 4603mV (with the MQ2 connected -> dotted line).

Since I do not understand what both codes exactly do, and still do not now if it is possible to measure the 5V-GND line back to the same Arduino I am a little stuck.

A thermistor/resistor is ratiometric.
If you read that with a ratiometric A/D (default Aref), then the returned A/D value is independent of supply voltage.

If you read that thermistor/resistor with a constant voltage A/D (1.1volt Aref), then the thermistor becomes voltage dependent (bad).
Leo..

v3xX:
and my result is now 459 (mV?).
Since I do not understand what both codes exactly do

As long as the supply voltage >3.3V the reference voltage is high enough to supply the chips.

I have a correction to make. The answer from 'Coding Badly' leads to my solution.

The voltage difference at the pins are 475 (4.75V). So it was not a problem from the measurement method, since the value at the +5V-GND is correct.

This sadly leads to my actually problem. I measured every point where I connect to the +5V supply line of my circuit and I noticed that I get different voltage level across the boards. I attached an exact copy of my schematic and the measure voltages between my elements and noticed voltage drops when the LED is turned on.

How can the voltage drop from 4.75V to different voltages if all elements are connected in parallel? Especially when current is drawn from the LED. It is only 20mA and is well in the confines of the Arduino and the shiftregister.

Quick update:

  1. In the post above the Arduino is powered via USB and the voltage drops are noticeable.

  2. Now I power the Arduino using a stable power source 12V@6A (max draw) using Vin. The USB connections still persists to check the serial outputs and messages.

In case 2. the voltage drops only for a <1ms and then stabilizes at 5.02V.

My conclusion is, that the power conversion from the USB alone is not enough to draw the power for the Arduino and all peripherals. I was always >3.3V since the chips do not draw much power, but with other elements (LED, MQ2, ...) the power draw is between 20-150mA.

I will now try to design my circuit where I power all measurement elements (ADC, buttons,...) via the Arduino and all the elements that draw power with a separate line only connected via Common. I still can switch or measure the elements using their datapins, because their power draw is usually <10nA.

Is this a good approach for designing such circuits?