Reading a 12.62 Volt battery with a voltage divider on an UNO

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Billduck1302
Posts: 33
http://meble-kuchenne.info.pl
Joined: Fri Dec 06, 2024 4:41 pm
Has thanked: 2 times
Been thanked: 1 time

Flowcode v10 Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by Billduck1302 »

I have a 12.62 Volt Lithium battery (4S). The voltage goes thru a 5:1 voltage divider to AN0 on the UNO. It consistently uuder reports the voltage. (See photo) For the component, a potentiometer, I am wondering if settings for the pot need to be tweeked. From the photo, the UNO is saying the voltage is 11.18. The Voltage divider
If the attatched photo does not come thru, there are 2 connections for the Voltage to be measured. and I have connected the Signal wire to AN0 and output (-) wire to the analog input (-).
Thanks in advance.

Link to divider

https://www.ebay.com/itm/323881639189?_ ... BMiM_q-PNm
Attachments
Pack Voltage_FC_11.fcfx
(15.43 KiB) Downloaded 12 times

stefan.erni
Valued Contributor
Posts: 1148
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 219 times
Been thanked: 238 times

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by stefan.erni »

Hi Billduck1302

I suspect the link goes to the wrong module.
Perhaps you could post a schematic. Actually, you only need two resistors.

82 kΩ / 9,1 kΩ → divider 0,0999 and 0,165mA

91 kΩ / 10 kΩ → divider 0,0990 and 0,149mA

This requires a little power from the battery. You can also use higher resistance values.

910 kΩ / 100 kΩ→ divider 0,09901 14,85μA

wrong link?
2026-01-09_08-41-24.PNG
2026-01-09_08-41-24.PNG (259.63 KiB) Viewed 181 times

Billduck1302
Posts: 33
Joined: Fri Dec 06, 2024 4:41 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by Billduck1302 »

Minute 2:14 in this Youtube explanation.
https://www.youtube.com/watch?v=FaoKzi7tgME&t=280s

stefan.erni
Valued Contributor
Posts: 1148
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 219 times
Been thanked: 238 times

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by stefan.erni »

Hi Billduck1302



I found the modul:
2026-01-09_15-59-57.PNG
2026-01-09_15-59-57.PNG (230.76 KiB) Viewed 153 times
And what is used in the modul:
2026-01-09_16-01-59.PNG
2026-01-09_16-01-59.PNG (361.17 KiB) Viewed 153 times
There is a command "map" used in the software,
2026-01-09_16-31-10.PNG
2026-01-09_16-31-10.PNG (175.05 KiB) Viewed 153 times
I guess that's the same as the map component in Flowcode.
2026-01-09_16-20-14.PNG
2026-01-09_16-20-14.PNG (9.59 KiB) Viewed 153 times
I hope that helps a little.

I haven't used the map component yet, but I will be using it soon for my project.

chipfryer27
Valued Contributor
Posts: 1813
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 404 times
Been thanked: 622 times

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by chipfryer27 »

Hi

The map component is very easy to use and I think medel35 first created it years ago before it became a component.

Regards

medelec35
Valued Contributor
Posts: 2227
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 685 times
Been thanked: 759 times

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by medelec35 »

chipfryer27 wrote:
Fri Jan 09, 2026 6:07 pm
Hi
The map component is very easy to use and I think medel35 first created it years ago before it became a component.

Regards
Wow chipfryer27 , you have a good memory as that was a long time ago.
Yes, I created the map component based on the Arduino version so people moving from Arduino IDE to Flowcode will be used to the way it works.
Martin

chipfryer27
Valued Contributor
Posts: 1813
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 404 times
Been thanked: 622 times

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by chipfryer27 »

Hi Martin

it was such a useful component it immediately stuck in my mind, which is no small feat, especially as I firmly believe guys have a fixed amount of memory and can only remember so much. If full and we want to remember something new, then we must forget something else.....

I make a point of not remembering things, mainly because if my theory is true, I don't ever want to forget Halle Berry in a catsuit.... Greatest movie ever....

Regards

Billduck1302
Posts: 33
Joined: Fri Dec 06, 2024 4:41 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by Billduck1302 »

I am not seeing the MAP function in Version 11.

medelec35
Valued Contributor
Posts: 2227
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 685 times
Been thanked: 759 times

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by medelec35 »

Hi Bill.
Within Components ribbon, make sure Show Components on the far left is set for 2D & 3D.
Then click on the magnifier next to Show Components and enter map.
The Map Function can also be found within Components > Math > Calculation.
chipfryer27 wrote:
Fri Jan 09, 2026 8:41 pm
I don't ever want to forget Halle Berry in a catsuit
Oooh, yes, we can't ever forget that in our increasing age. :lol:
Martin

Billduck1302
Posts: 33
Joined: Fri Dec 06, 2024 4:41 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Reading a 12.62 Volt battery with a voltage divider on an UNO

Post by Billduck1302 »

Thank you. This interplay is what makes the Forum so great.

Post Reply