Using battery voltage reading for battery indicator gauge

Introduction and miscellaneous that we haven't created categories for, yet
Post Reply
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Using battery voltage reading for battery indicator gauge

Post by m.art.y »

Hi, has anybody tried to use voltage of the battery to calculate and represent battery SOC level? I know it might not be very accurate but it should be better than nothing. I have got battery voltage reported on CAN and I have got a battery level gauge that receives CAN and displays % and it goes from 0 to 100 % decimal directly converted to hexadecimal where 0x64 =100%. Now I can't figure out how to calculate the reported voltage into % in a way that 144 V = 100 % and 44 V = 0%. I want to include the calculation in arduino code. Anybody has any ideas for a calculation algorithm? Thanks
LRBen
Posts: 471
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 42 times
Been thanked: 99 times

Re: Using battery voltage reading for battery indicator gauge

Post by LRBen »

x = voltage - 44
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Using battery voltage reading for battery indicator gauge

Post by m.art.y »

LRBen wrote: Mon Oct 25, 2021 7:18 pmx = voltage - 44
Thanks. It works now 😊
Post Reply