Go Down

### Topic: Measuring USB voltage with 32U4 and potential divider (Read 175 times)previous topic - next topic

#### johnerrington

##### Sep 14, 2019, 10:08 am
I'm trying to build a unit to display the USB voltage.  I've tried the "secret voltmeter" - see my other post.  This is a different approach.

I have connected an analog input pin (A9) to Vcc (the pin on the Micro Pro board) via a 3.3:1 potential divider.

(Vcc - 33k - A9 - 10k - GND)

The USB voltage is read externally as 4.99V

however when I read Vcc - ground with a voltmeter at the Micro Pro board I only see 4.6V
and this is also what the Arduino reads.

When I look at the schematic it only shows a fuse which does not to me explain the voltage drop, especially as the current drawn is only 50mA.

I have read previously "Vcc is not the same as Vin".

Does anyone have an explanation for this?

#1
LDO?

#### PaulRB

#2
##### Sep 14, 2019, 10:29 amLast Edit: Sep 14, 2019, 10:40 am by PaulRB
Not LDO, that's between Vin and Vcc.

You say 32U4, but what board is the chip on? Pro Micro, Leonardo...?

There may be a diode to protect the PC if the USB is plugged in while the Arduino is powered externally (i.e. through Vin, via the LDO). That diode is probably dropping the ~0.3V

What does your multimeter read on the 5V/Vcc pin, rather than the direct USB voltage?

Quote
a 3.3:1 potential divider.

(Vcc - 33k - A9 - 10k - GND)
That's 4.3:1, not 3.3:1. The resistors have a ratio 3.3:1, but the voltage divider they make has a ratio of Vin:Vout = (33+10):10. Are you calculating incorrectly in your code?

The internal voltage reference on atmega32U4 is 2.56V, not 1.1V as on atmega328.

#### jremington

#3
##### Sep 14, 2019, 06:01 pmLast Edit: Sep 14, 2019, 06:02 pm by jremington
The code may be incorrect, and if you take the time to post it, using code tags, forum members can help.

#### Robin2

#4
##### Sep 14, 2019, 06:10 pm
I'm trying to build a unit to display the USB voltage.  I've tried the "secret voltmeter" - see my other post.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

#### johnerrington

#5
##### Sep 14, 2019, 07:09 pm
Thanks all for your prompt input.

LDO: its a 5V board running AFAIK directly from USB. The schematic Pro Micro Rev 13 shows UVcc connected directly through a 500mA fuse and a closed jumper to Vcc.

PaulRB of course you are correct I meant 33k:10k which is of course 4.3:1

Hi JR thanks for input: the code actually reads correctly, the same as the multimeter.

To clarify: an external meter reads the usb voltage as 4.99V. A multimeter conected between "Vcc" and "Ground" pins on the pro micro board reads 4.6 V approximately.

https://forum.arduino.cc/index.php?topic=636038.0;topicseen

#### Paul__B

#6
##### Sep 16, 2019, 12:14 am

https://forum.arduino.cc/index.php?topic=636038.0;topicseen
Then why are you cross posting?

#### johnerrington

#7
##### Sep 16, 2019, 08:19 am
Sorry Paul, its two completely different approaches to making the same measurement. Pl explain how that is cross-posting, as I'm new to this forum, and more than happy to abide by rules.

#### Robin2

#8
##### Sep 16, 2019, 09:07 am
Sorry Paul, its two completely different approaches to making the same measurement.
It is much easier to help when all the info about one project is in one place. It also avoids wasting time with duplicate questions and duplicate answers.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up