-
Notifications
You must be signed in to change notification settings - Fork 62
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
Comments
getVBUS is simple a TTL indicator whether there is 3V present on the USB
detect pin. You cannot get a voltage measure from this function. You can
simply connect the battery anode by wire to an analog pin and use the ADC
(i.e., analogRead) to measure voltage.
…On Sat, Oct 27, 2018 at 9:11 AM rmeldo ***@***.***> wrote:
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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AGY1qmsbDrLVMVabNNw2W5yRGtxYii5Vks5upIWfgaJpZM4X9go4>
.
|
This works because you maximum battery voltage is < 3.3 V, the analog
reference voltage. If you were to use a LiPo battery then you would need a
violtage divider to bring the max voltage back to 3.3 V or less. Be careful
on your choice of analog pins since some are not 5 V tolerant. As long as
the battery voltage or input voltage is 3.3 V or less this is not an issue.
On Sat, Oct 27, 2018 at 9:21 AM Tlera Corporation <[email protected]>
wrote:
… getVBUS is simple a TTL indicator whether there is 3V present on the USB
detect pin. You cannot get a voltage measure from this function. You can
simply connect the battery anode by wire to an analog pin and use the ADC
(i.e., analogRead) to measure voltage.
On Sat, Oct 27, 2018 at 9:11 AM rmeldo ***@***.***> wrote:
> 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
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#40>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AGY1qmsbDrLVMVabNNw2W5yRGtxYii5Vks5upIWfgaJpZM4X9go4>
> .
>
|
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. |
Well, quite right, if you supply the board with 3.2 V the board voltage
will be ~3.1 V or so, so this will be the analog voltage too. This can be
read by STM32L0.getVDDA() IIRC. So you could just read the VDDA and maybe
get a measure of your input voltage, but it won't be exact since for some
reason you are going through the LDO. I wouldn't. Just connect 3.2 V to the
3V3 on the board edge, then the board voltage will be a good measure of
your battery voltage and you can read this via VDDA.
…On Sat, Oct 27, 2018 at 9:45 AM rmeldo ***@***.***> wrote:
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
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGY1qmEOgrqX1eQy4HMdQ_QZH0t9wKSSks5upI26gaJpZM4X9go4>
.
|
OK so for a test I am powering through the USB connector and the STM32L0.getVDDA() returns 3.93. |
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 |
" STM32L0.getVDDA() returns 3.93."
Then something is very wrong with your board...What does 3V3 show?
…On Sat, Oct 27, 2018 at 1:36 PM rmeldo ***@***.***> wrote:
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
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGY1quunAAkwRUV1q5rtGdwdpsYBLnMsks5upMO4gaJpZM4X9go4>
.
|
the 3V3 shows 3.9 as well. I tried another board and it shows 3.3V. could I have damaged the voltage regulator? |
Hard to imagine 3.2 V damaging anything, 6 V or 9 V, likely...
…On Sat, Oct 27, 2018 at 2:01 PM rmeldo ***@***.***> wrote:
the 3V3 shows 3.9 as well. I tried another board and it shows 3.3V.
could I have damaged the voltage regulator?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGY1qvsdOe_-n1KBtdZiBsSdzinlu8Zaks5upMnGgaJpZM4X9go4>
.
|
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 |
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
The text was updated successfully, but these errors were encountered: