Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getVBUS function output #40

Open
rmeldo opened this issue Oct 27, 2018 · 10 comments
Open

getVBUS function output #40

rmeldo opened this issue Oct 27, 2018 · 10 comments

Comments

@rmeldo
Copy link

rmeldo commented Oct 27, 2018

Hi,
A question about the function getVBUS.

I am using a Grasshopper board (LoRa), powered with two 1.5 batteries which give 3.2V. I am powering it through the LDO voltage regulator.

I would like to include the voltage level into the periodic upload message to be aware of the state of charge of the batteries.

When I call the function "Serial.print(STM32L0.getVBUS());" I get a "1" on the Arduino serial monitor.
Is this what I am supposed to get? How would the message change as the voltage drops?

Thanks
Riccardo

@kriswiner
Copy link

kriswiner commented Oct 27, 2018 via email

@kriswiner
Copy link

kriswiner commented Oct 27, 2018 via email

@rmeldo
Copy link
Author

rmeldo commented Oct 27, 2018

OK, but where does the 3v3 reference voltage comes from, when the battery voltage is 3.2V?

It maybe that I do not understand how analogRead works.
Riccardo

@kriswiner
Copy link

kriswiner commented Oct 27, 2018 via email

@rmeldo
Copy link
Author

rmeldo commented Oct 27, 2018

OK so for a test I am powering through the USB connector and the STM32L0.getVDDA() returns 3.93.
Is it Volts? is seems high. I thought the board ran on 3.3V.
Riccardo

@rmeldo
Copy link
Author

rmeldo commented Oct 27, 2018

By the way, the intention is to use supply through the 3.3V pin, for the but since I am using a couple of different battery packs I thought it would be safer to go through the LDO

@kriswiner
Copy link

kriswiner commented Oct 27, 2018 via email

@rmeldo
Copy link
Author

rmeldo commented Oct 27, 2018

the 3V3 shows 3.9 as well. I tried another board and it shows 3.3V.

could I have damaged the voltage regulator?

@kriswiner
Copy link

kriswiner commented Oct 27, 2018 via email

@rmeldo
Copy link
Author

rmeldo commented Oct 28, 2018

Thanks for the advice. STM32L0.getVDDA() is what I was looking for. Still chasing this voltage problem on my board, but that's on me.

Riccardo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants