In this guide I will explain to you how I built my battery voltage monitor for my electric longboard. Mount it however you want and connect just two wires to your battery (Gnd and Vcc). This guide assumed that your battery voltage exceeds 30 volt, which is greater than the maximum voltage of the "Mini Digital Volt Meter" linked below. However, this voltage meter will in this guide be modified so that it can measure voltages exceeding 30 volt.
First off, you'll need the following:
Step 1: Modifying the "Mini Digital Volt Meter" to Handle Voltages > 30 V
The "Mini Digital Volt Meter" when delivered will have two wires, Vcc and Gnd. The measurement is conducted directly from the Vcc wire and will be in the range of ~2 to ~30 volt. Applying a higher voltage might damage the chip so just don't do it. However, the chip can easily be modified to measure the voltage from one wire (0 - 100 V) and be powered from another (~2 - 30 volt).
To do this, you'll need a soldering iron and maybe a pincer. First off, remove the small 0 Ω resistor shown in the picture. This is done be heating the solder on both sides whilst bending and twitching it. Secondly, add a third wire, also indicated in the picture.
Done! The chip now has three wires, one for ground, one for powering and one for measurements.
Step 2: Adding a "Voltage Divider Circuit"
Okey, so now you have a chip with three wires. The measurement range is 0 to 100 V and the powering range is about 2 to 30 V. Now we have to assume that you'll be measuring something higher than, let's say, 30 V. Than you will not be able to power the chip directly from the power source without risking to damage it. On the other hand, you would not want a second power source to provide voltage just for this little chip in the range of 2 to 30 V.
The solution is to use a so called "Voltage Divider Circuit" as seen in the picture. In the picture there is a 50 V battery that is to be measured. Using the voltage divider circuit, one is able to power the module from 12.5 V whilst measuring 50 V. However, this will only function as the "mini digital volt meter" draws such small current.
The higher the voltage that you'll be measuring, the higher the values of the resistors have to be as the current flowing through the resistors increase with the applied voltage. Increasing the resistor value will decrease the current.
Finding the correct resistor values for your case is best done by trying. In my case with my 38 V battery, I found that a 1000 Ω resistor as R1 and a 1800 Ω resistor for R2 did the trick.
The voltage divider circuit can easily be done right on the cables and then be wrapped in heat shrink tube for protection.
Step 3: Mounting the "Mini Digital Volt Meter"
This step differs from every case but I'll thought I show you how I mounted mine on my longboard. Just for inspiration :)
The white plastic piece is custom made to fit inside the socket from the drop-down longboard truck, 3D printed in ABS. I made the plastic part to fit the voltage meter tightly, but made sure that the voltage meter had 1 mm left to be aligned with the plastic upper side. To protect the display of the voltage meter I poured some Epoxy to fill the 1 mm hollow were the display is. In one of the pictures you can see some reflections on the epoxy layer on top the display.