MINIDOCUMENTATION - Battery Voltage Indicator
MINIDOCUMENTATION - Battery Voltage Indicator
A Dissertation Submitted in partial fulfillment of the requirements for the award of the
degree of
BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING
BY
PRATHIK SHETTY 19BD1A1043
S. PRAVALIKA 19BD1A1046
M. KAUSHIK 19BD1A1032
K. YASHWANTH 19BD1A1022
DEPARTMENT OF EIE
CERTIFICATE
This is to certify that the project entitled “Battery Voltage Monitor and Display Using Arduino uno”
is being submitted by Mr. PRATHIK SHETTY (19BD1A1043), Ms. S.PRAVALIKA
(19BD1A1046), Mr. M.KAUSHIK (19BD1A1032), Mr. YASHWANTH (19BD1A1022) students
of Keshav Memorial Institute of Technology, JNTU in partial fulfillment of the requirement for
the award of “Bachelor of Technology” in “Electronics and Communication Engineering” as a
specialization is a record of bonafide work carried out by them under my guidance and supervision
in the academic year 2022-2023.
SIGNATURE SIGNATURE
MR.LINGA AMARENDER REDDY MS.SWAPNA BANDARI
INTERNAL GUIDE HEAD OF THE DEPARTMENT
Assistant Professor Department of ECE
Department of ECE Keshav Memorial Institute of Technology
Keshav Memorial Institute of Technology Hyderabad – 500029
Hyderabad – 500029
We take this opportunity to thank all the people who have fully supported our project work.
We render our thanks to Dr. Maheshwar Dutta, B.E, M.Tech., Ph.D., Principal who
encouraged us to do the project.
We are grateful to Mr. Neil Gogte, Director for facilitating all the amenities required to carry
out this project.
We are also thankful to Ms.Swapna bandari and the Head of the Department for providing us
with the time and amenities to make this project a success within the given schedule.
We are also thankful to Mr.Lingala Amarender reddy as our Internal Guide for his
valuable guidance and encouragement were given to us throughout the project work.
We would like to thank the entire EIE Department faculty who helped us directly and
indirectly in the completion of the project.
3
INDEX
PageNo
LIST OF FIGURES
ABSTRACT
CHAPTER-1 INTRODUCTION 1
CHAPTER-2 BATTERIES 3
CHAPTER-3 DIFFERENT TYPES OF BATTERIES 09
CHAPTER-4 ARDUINO UNO 16
CHAPTER-5 INSTALLATION OF ARDUINO IDE 24
CHAPTER-6 LIQUID CRYSTAL DISPLAY 31
CHAPTER-7 VOLTAGE SENSOR 35
CHAPTER-8 I2C 44
CHAPTER-9 COMPONENTS 46
CHAPTER-10 BLOCK DIAGRAM AND CIRCUIT DIAGRAM 47
CHAPTER-11 SOURCE CODE 48
CHAPTER-12 CONCLUSION 51
REFERENCE 52
4
LIST OF FIGURES
3.1.1 Lead-acid 12
3.3.1 Nickel-iron 14
5.6.6 Arduino.exe 30
5
5.7.1 Board selection 31
8.1 I2C 45
9.1 2D Diagram 47
6
ABSTRACT
The aim of this hardware project is to display the health of a battery with the help of an Arduino board.
The battery level indicator will let you know the status of the battery of a device on the Liquid Crystal
Display(LCD). Sometimes we do not notice that the battery has drained out and as a result, the connected
equipment does not work properly.
By connecting this simple 1.5 - 12V battery voltage level indicator circuit across the battery, you can
check its voltage level at any time. You can use this battery level indicator circuit with your inverter or
with your car battery; it will give you an indication of your battery status. So before your battery dies
you can recharge it.
Overcharging is terrible for your battery health as it can cause batteries to melt or swell. It could also be
damaging to users if not controlled. Additionally, the casting of the battery could become too hot and
cause flammable hydrogen to build up inside the sealed battery cells, leading to a bad battery. Luckily,
there is a way to prevent overcharging from damaging your batteries: battery level indicators.
The advantage of this circuit is it does not require a power supply; it will take the power supply from the
battery of the device itself. A battery indicator (also known as a battery gauge) is a device which gives
information about a battery. This will usually be a visual indication of the battery's state of charge. A
battery indicator is a feature of many electronic devices. In mobile phones, the battery indicator usually
takes the form of a bar graph - the more bars showing, the better the battery's state of charge.
7
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER - 1
INTRODUCTION
A battery indicator is a device which gives information about a battery. This will usually be
a visual indication of the battery's state of charge.
Batteries come with a certain voltage limit and if the voltage goes beyond the prescribed limits
while charging or discharging, the life of the battery gets affected or reduced. Whenever we
use a battery-powered project, sometimes we need to check the battery voltage level, whether
it needs to be charged or replaced. This circuit will help you to monitor the voltage of your
battery.
Battery level indicators are essential devices for all battery-powered devices. Without it, you
won't know when your batteries need charging or stop charging when full to prevent damage
from overcharging.
Voltage indicators continuously show the current voltage. Voltage indicators are used to check
batteries or mains voltage.
A battery level indicator is used to check the battery condition. This information is needed in
many kinds of situations. It may be used:
● Automobiles
● Computers
● Electronic devices
The small essential components that can operate many devices are the batteries. It has become
one of the key components in our everyday lives. There are some batteries which can be
recharged and are used in mostly each and every sector. Some of the applications of the
batteries are given below.
● House
● Health Instruments
● Medical
● Logistics and Construction
1
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
Sometimes we do not notice that the battery has drained out and as a result, the
connected equipment does not work properly. By connecting this simple 1.5 - 12V battery
voltage level indicator circuit across the battery, you can check its voltage level at any time.
2
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER - 2
WHAT ARE BATTERIES? WHERE DID IT ALL START?
Batteries provided the primary source of electricity before the development of electric
generators and electrical grids around the end of the 19th century. Successive improvements
in battery technology facilitated major electrical advances, from early scientific studies to the
rise of telegraphs and telephones, eventually leading to portable computers, mobile phones,
electric cars, and many other electrical devices.
One important classification for batteries is their life cycle. "Primary" batteries can
produce current as soon as assembled, but once the active elements are consumed, they cannot
be electrically recharged. The development of the lead-acid battery and subsequent
"secondary" or "chargeable" types allowed energy to be restored to the cell, extending the life
of permanently assembled cells. The introduction of nickel and lithium-based batteries
3
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
in the latter half of the 20th century made the development of innumerable portable electronic
devices feasible, from powerful flashlights to mobile phones. Very large stationary batteries
find some applications in grid energy storage, helping to stabilize electric power distribution
networks.
2.1 Invention
From the mid-18th century on, before there were batteries, experimenters used Leyden
jars to store electrical charge. As an early form of capacitor, Leyden jars, unlike batteries, stored
their charge physically and would release it all at once. Many experimenters took to hooking
several Leyden jars together to create a stronger charge and one of them, the colonial American
inventor Benjamin Franklin, may have been the first to call his grouping an "electrical battery",
a play on the military term for weapons functioning together.
Volta believed the current was the result of two different materials simply touching
each other – an obsolete scientific theory known as contact tension – and not the result of
chemical reactions. As a consequence, he regarded the corrosion of the zinc plates as an
unrelated flaw that could perhaps be fixed by changing the materials somehow. However, no
scientist ever succeeded in preventing this corrosion. In fact, it was observed that the corrosion
was faster when a higher current was drawn. This suggested that the corrosion was actually
integral to the battery's ability to produce a current. This, in part, led to the rejection of Volta's
contact tension theory in favor of the electrochemical theory.
Volta's illustrations of his Crown of Cups and voltaic pile have extra metal disks, now
known to be unnecessary, on both the top and bottom. The figure associated with this section,
of the zinc-copper voltaic pile, has a modern design, an indication that "contact tension" is not
the source of the electromotive force for the voltaic pile.
Volta's original pile models had some technical flaws, one of them involving the
electrolyte leaking and causing short circuits due to the weight of the discs compressing the
brine-soaked cloth. A Scotsman named William Cruickshank solved this problem by laying
the elements in a box instead of piling them in a stack. This was known as the trough battery.
Volta himself invented a variant that consisted of a chain of cups filled with a salt
solution, linked together by metallic arcs dipped into the liquid. This was known as the Crown
of Cups. These arcs were made of two different metals (e.g., zinc and copper) soldered
together. This model also proved to be more efficient than his original piles, though it did not
4
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
prove as popular.
Another problem with Volta's batteries was short battery life (an hour's worth at best),
which was caused by two phenomena. The first was that the current produced electrolyzed the
electrolyte solution, resulting in a film of hydrogen bubbles forming on the copper, which
steadily increased the internal resistance of the battery (this effect, called polarization, is
counteracted in modern cells by additional measures).
An English professor of chemistry named John Frederic Daniell found a way to solve
the hydrogen bubble problem in the Voltaic Pile by using a second electrolyte to consume the
hydrogen produced by the first.
In 1836, he invented the Daniell cell, which consists of a copper pot filled with a copper
sulfate solution, in which is immersed an unglazed earthenware container filled with sulfuric
acid and a zinc electrode. The earthenware barrier is porous, which allows ions to pass through
but keeps the solutions from mixing.
The Daniell cell was a great improvement over the existing technology used in the early
days of battery development and was the first practical source of electricity. It provides a
longer and more reliable current than the Voltaic cell. It is also safer and less corrosive. It soon
became the industry standard for use, especially with the new telegraph networks.The Daniell
cell was also used as the first working standard for definition of the volt, which is the unit of
electromotive force.
5
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
In the 1860s, a Frenchman named Callaud invented a variant of the Daniell cell called
the gravity cell. This simpler version dispensed with the porous barrier. This reduces the
internal resistance of the system and, thus, the battery yields a stronger current. It quickly
became the battery of choice for the American and British telegraph networks and was widely
used until the 1950s.
The gravity cell consists of a glass jar, in which a copper cathode sits on the bottom and
6
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
a zinc anode is suspended beneath the rim. Copper sulfate crystals are scattered around the
cathode and then the jar is filled with distilled water. As the current is drawn, a layer of zinc
sulfate solution forms at the top around the anode. This top layer is kept separate from the
bottom copper sulfate layer by its lower density and by the polarity of the cell.
The zinc sulfate layer is clear in contrast to the deep blue copper sulfate layer, which
allows a technician to measure the battery life with a glance. On the other hand, this setup
means the battery can be used only in a stationary appliance, or else the solutions mix or spill.
Another disadvantage is that a current has to be continually drawn to keep the two solutions
from mixing by diffusion, so it is unsuitable for intermittent use.
The cell provides 1.9 volts. It was popular with experimenters for many years due to its
7
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
relatively high voltage; greater ability to produce a consistent current and lack of any fumes,
but the relative fragility of its thin glass enclosure and the necessity of having to raise the zinc
plate when the cell is not in use eventually saw it fall out of favor. The cell was also known as
the 'chromic acid cell', but principally as the 'bichromate cell'.The Fuller cell was developed
from the Poggendorff cell. Although the chemistry is principally the same, the two acids are
once again separated by a porous container and the zinc is treated with mercury to form an
amalgam.
Alfred Dun 1885, nitro-muriatic acid (aqua regia) – iron and carbon: In the new element
they can be used advantageously as exciting-liquid in the first case such solutions as having in
a concentrated condition great depolarizing-power, which affect the whole depolarization
chemically without necessitating the mechanical expedient of the increased carbon surface. It
is preferred to use iron as the positive electrode, and as exciting-liquid nitro muriatic acid (aqua
regia), the mixture consisting of muriatic and nitric acids.
The nitro-muriatic acid, as explained above, serves for filling both cells. For the carbon
cells it is used strong or very slightly diluted, but for the other cells very diluted, (about one-
twentieth, or at the most one-tenth). The element contained in one cell carbon and concentrated
nitric-muriatic acid and in the other cell iron and dilute nitric-muriatic acid remains constant
for at least twenty hours when employed for electric incandescent lighting.
8
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER-3
WHAT ARE THE DIFFERENT TYPES OF BATTERIES?
Basically, all the electrochemical cells and batteries are classified into two types:
● Primary (non-rechargeable)
● Secondary(rechargeable)
Even though there are several other classifications within these two types of batteries,
these two are the basic types. Simply speaking, Primary Batteries are non-rechargeable
batteries i.e., they cannot be recharged electrically while the Secondary Batteries are
rechargeable batteries i.e., they can be recharged electrically.
Primary Batteries(Non-Rechargeable):
A primary battery or primary cell is a battery (a galvanic cell) that is designed to be
used once and discarded, and not recharged with electricity and reused like a secondary cell
(rechargeable battery). As a primary cell is used, chemical reactions in the battery use up the
chemicals that generate the power; when they are gone, the battery stops producing electricity.
In contrast, in a secondary cell, the reaction can be reversed by running a current into the cell
with a battery charger to recharge it, regenerating the chemical reactants. Primary cells are
made in a range of standard sizes to power small household appliances such as flashlights and
portable radios.
9
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
In 1859, Gaston Planté invented the lead–acid battery, the first-ever battery that could
be recharged by passing a reverse current through it. A lead-acid cell consists of a lead anode
and a lead dioxide cathode immersed in sulfuric acid. Both electrodes react with the acid to
produce lead sulfate, but the reaction at the lead anode releases electrons whilst the reaction
at the lead dioxide consumes them, thus producing a current. These chemical reactions can be
reversed by passing a reverse current through the battery, thereby recharging it.
Planté's first model consisted of two lead sheets separated by rubber strips and rolled
into a spiral. His batteries were first used to power the lights in train carriages while stopped
at a station. In 1881, Camille Alphonse Faure invented an improved version that consists of a
lead grid lattice into which is pressed a lead oxide paste, forming a plate. Multiple plates can
be stacked for greater performance. This design is easier to mass-produce. Compared to other
batteries, Planté's is rather heavy and bulky for the amount of energy it can hold. However, it
can produce remarkably large currents in surges, because it has a very low internal resistance,
meaning that a single battery can be used to power multiple circuits.
The lead-acid battery is still used today in automobiles and other applications where
weight is not a big factor. The basic principle has not changed since 1859. In the early 1930s,
a gel electrolyte (instead of a liquid) produced by adding silica to a charged cell was used in
the LT battery of portable vacuum-tube radios.
Today cells are classified as "primary" if they produce a current only until their
chemical reactants are exhausted, and "secondary" if the chemical reactions can be reversed
10
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
by recharging the cell. The lead-acid cell was the first "secondary" cell.
Lithium is the metal with the lowest density and with the greatest electrochemical
potential and energy-to-weight ratio. The low atomic weight and small size of its ions also
speed its diffusion, suggesting that it would make an ideal material for batteries.
Experimentation with lithium batteries began in 1912 under American physical chemist
Gilbert N. Lewis, but commercial lithium batteries did not come to market until the 1970s in
the form of lithium-ion batteries. Three-volt lithium primary cells such as the CR123A type
and three-volt button cells are still widely used, especially in cameras and very small devices.
In 1981, Japanese chemists Tokio Yamabe and Shizukuni Yata discovered a novel
nano-carbonaceous-PAS (polyacene) and found that it was very effective for the anode in the
conventional liquid electrolyte. This led a research team managed by Akira Yoshino of Asahi
Chemical, Japan, to build the first lithium-ion battery prototype in 1985, a rechargeable and
more stable version of the lithium battery; Sony commercialized the lithium-ion battery in
11
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
1991.
3.3 Nickel-iron
Waldemar Jungner patented a nickel–iron battery in 1899, the same year as his Ni-Cad
battery patent, but found it to be inferior to its cadmium counterpart and, as a consequence,
never bothered developing it. It produced a lot more hydrogen gas when being charged,
meaning it could not be sealed, and the charging process was less efficient (it was, however,
cheaper).
Seeing a way to make a profit in the already competitive lead-acid battery market,
Thomas Edison worked in the 1890s on developing an alkaline-based battery that he could get
a patent on. Edison thought if he produced lightweight and durable battery electric cars would
become the standard, with his firm as its main battery vendor. After many experiments, and
probably borrowing from Jungner's design, he patented an alkaline-based nickel–iron battery
in 1901.
However, customers found his first model of the alkaline nickel–iron battery to be prone
to leakage leading to short battery life, and it did not outperform the lead-acid cell by much
either. Although Edison was able to produce a more reliable and powerful model seven years
later, by this time the inexpensive and reliable Model T Ford had made gasoline engine cars
the standard. Nevertheless, Edison's battery achieved great success in other applications such
as electric and diesel-electric rail vehicles, providing backup power for railroad crossing
12
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
In 1866, Georges Leclanché invented a battery that consists of a zinc anode and a
manganese dioxide cathode wrapped in a porous material, and dipped in a jar of ammonium
chloride solution.
The manganese dioxide cathode has a little carbon mixed into it as well, which improves
conductivity and absorption. It provided a voltage of 1.4 volts. This cell achieved very quick
13
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
The dry cell form was used to power early telephones—usually from an adjacent
wooden box affixed to fit batteries before telephones could draw power from the telephone
line itself. The Leclanché cell can not provide a sustained current for very long. In lengthy
conversations, the battery would run down, rendering the conversation inaudible. This is
because certain chemical reactions in the cell increase the internal resistance and, thus, lower
the voltage.
In 1886, Carl Gassner obtained a German patent on a variant of the Leclanché cell,
which came to be known as the dry cell because it does not have a free liquid electrolyte.
Instead, the ammonium chloride is mixed with plaster of Paris to create a paste, with a small
amount of zinc chloride added in to extend the shelf life.
The manganese dioxide cathode is dipped in this paste, and both are sealed in a zinc
shell, which also acts as the anode. In November 1887, he obtained a U.S. Patent 373,064 for
the same device.
Unlike previous wet cells, Gassner's dry cell is more solid, does not require
maintenance, does not spill, and can be used in any orientation. It provides a potential of 1.5
volts. The first mass-produced model was the Columbia dry cell, first marketed by the National
Carbon Company in 1896.
The NCC improved Gassner's model by replacing the plaster of Paris with coiled
cardboard, an innovation that left more space for the cathode and made the battery easier to
assemble. It was the first convenient battery for the masses and made portable electrical devices
practical, and led directly to the invention of the flashlight.The zinc–carbon battery (as it came
to be known) is still manufactured today.
In parallel, in 1887 Wilhelm Hellesen developed his own dry cell design. It has been claimed
that Hellesen's design preceded that of Gassner
14
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
In 1887, a dry-battery was developed by Sakizō Yai of Japan, then patented in 1892. In
1893, Sakizō Yai's dry-battery was exhibited in World's Columbian Exposition and
commanded considerable international attention.
15
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER-4
ARDUINO UNO
It can be powered by the USB cable or by an external 9-volt battery, though it accepts
voltages between 7 and 20 volts. It is similar to the Arduino Nano and Leonardo.The hardware
reference design is distributed under a Creative Commons Attribution Share-Alike 2.5 license
and is available on the Arduino website. Layout and production files for some versions of the
hardware are also available.
The word "uno" means "one" in Italian and was chosen to mark the initial release of
Arduino Software. The Uno board is the first in a series of USB-based Arduino boards; it and
version 1.0 of the Arduino IDE were the reference versions of Arduino, which have now
evolved to newer releases. The ATmega328 on the board comes pre-programmed with a
bootloader that allows uploading new code to it without the use of an external hardware
programmer.
16
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
While the Uno communicates using the original STK500 protocol, it differs from all
preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter.
The Arduino project started at the Interaction Design Institute Ivrea (IDII) in Ivrea,
Italy. At that time, the students used a BASIC Stamp microcontroller, at a cost that was a
considerable expense for many students. In 2003, Hernando Barragán created the development
platform Wiring as a Master's thesis project at IDII, under the supervision of Massimo Banzi
and Casey Reas, who are known for work on the Processing language.
The project goal was to create simple, low-cost tools for creating digital projects by
non-engineers. The Wiring platform consisted of a printed circuit board (PCB) with an
ATmega168 microcontroller, an IDE based on Processing, and library functions to easily
program the microcontroller. In 2003, Massimo Banzi, with David Mellis, another IDII
student, and David Cuartielles, added support for the cheaper ATmega8 microcontroller to
Wiring.
But instead of continuing the work on Wiring, they forked the project and renamed it
Arduino. Early arduino boards used the FTDI USB-to-serial driver chip and an
ATmega168.The Uno differed from all preceding boards by featuring the ATmega328P
microcontroller and an ATmega16U2 (Atmega8U2 up to version R2) programmed as a USB-
to-serial converter.
17
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
● LED: There is a built-in LED driven by digital pin 13. When the pin is high value, the
LED is on, when the pin is low, it is off.
● VIN: The input voltage to the Arduino/Genuino board when it is using an external
power source (as opposed to 5 volts from the USB connection or other regulated power
source). You can supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin.
● 5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 20V), the USB connector (5V),
or the VIN pin of the board (7-20V). Supplying voltage via the 5V or 3.3V pins bypasses
the regulator, and can damage the board.
● 3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
● GND: Ground pins.
● IOREF: This pin on the Arduino/Genuino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the IOREF
pin voltage and select the appropriate power source, or enable voltage translators on the
outputs to work with the 5V or 3.3V.
● Reset: Typically used to add a reset button to shields that block the one on the board.
Each of the 14 digital pins and 6 analog pins on the Uno can be used as an input or
output, under software control (using pinMode(), digitalWrite(), and digitalRead() functions).
They operate at 5 volts. Each pin can provide or receive 20 mA as the recommended operating
condition and has an internal pull-up resistor (disconnected by default) of 20-50K ohm.
A maximum of 40mA must not be exceeded on any I/O pin to avoid permanent damage
to the microcontroller. The Uno has 6 analog inputs, labeled A0 through A5; each provides 10
bits of resolution (i.e. 1024 different values). By default, they measure from ground to 5 volts,
though it is possible to change the upper end of the range using the AREF pin and the
analogReference() function.
18
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
● Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-
TTL serial chip.
● External interrupts: pins 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value.
● PWM (pulse-width modulation): pins 3, 5, 6, 9, 10, and 11. Can provide 8-bit PWM
output with the analogWrite() function.
● SPI (Serial Peripheral Interface): pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK).
These pins support SPI communication using the SPI library.
● TWI (two-wire interface) / I²C: pin SDA (A4) and pin SCL (A5). Support TWI
communication using the Wire library.
● AREF (analog reference): Reference voltage for the analog inputs.
19
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
4.5 Communications
Arduino can be used to communicate with a computer, another Arduino board or other
microcontrollers. The ATmega328P microcontroller provides UART TTL (5V) serial
communication which can be done using digital pin 0 (Rx) and digital pin 1 (Tx). An
ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer. The ATmega16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .inf file is
required.
The Arduino software includes a serial monitor which allows simple textual data to be
sent to and from the Arduino board. There are two RX and TX LEDs on the arduino board
which will flash when data is being transmitted via the USB-to-serial chip and USB connection
to the computer (not for serial communication on pins 0 and 1).
20
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
A SoftwareSerial library allows for serial communication on any of the Uno's digital
pins. The ATmega328P also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus.
● Smart Homes:
With Arduino boards we can control the home activities with the control systems such
as motion sensors, outlet control, temperature sensors, blower control, garage door control, air
flow control, sprinkler control and bill of materials.
● Defense:
RADAR (Radio Detection and Ranging) is a radio waves based object-detection system
that can find out the range, altitude, direction, or speed of objects. A Radar can have different
sizes and have different performance specifications. It can be used for air-traffic control at
airports, long range surveillance and early-warning systems in ships. This system is the heart
of a missile guidance system. In war a number of small portable radar systems are maintained
and operated, as well as systems that occupy several large rooms.
● Industries:
Due to the easy programming environment, signal types, and easy adaptation in new set
up, Arduino is used in Many industries. Arduino boards are low cost, and flexible alternatives
to the usual industrial devices for adding remote control and monitoring functionality to small
legacy industrial systems. With the growth of wireless technologies such as WiFi and cloud
services in few past years, the wireless systems become monotonous in our daily life
Today Arduino is used for the control of traffic lights, it can also be used for the real
time control system with programmable timings, pedestrian lighting etc. . In the traffic control
system the junction timing adjusts automatically to accommodate movement of vehicles
smoothly avoiding waiting time at the junction.
● Medical:
21
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
● Laboratories:
In the laboratory for the designing and learning circuit designing Arduino provides a
useful platform. There may be chances of some damages or anything wrong by the beginners
and it may also be costly for the students to use new electronic parts. This Arduino Simulator
offers a solution depending on hardware, faster circuit prototyping and no mess with cabling
at all . Arduino based automated slide movement microscopes are very cost-effective
laboratory devices. n to these problems, no damage done to your components, no money
There are many body control devices with Arduino used for health care such as
handSight gloves, breathalyzer microphone, heart rate monitoring system etc. Arduino based
heart rate monitors are more advanced than simply measuring a user’s heart rate. Our heart
rate monitors talks! Each button gives a verbal description of its functionality and makes the
measurements visible on the screen. This monitor will save the last four readings, display
them, average them, and also offer some inspirational quotes. This sensor is used for fever,
hypothermia, and activity levels and patterns detections. This device can sense facial
expressions. With the help of this Arduino device we can find out breathing rate, breathing
depth, activity level and arousal level. For the movement monitoring we use this Arduino
device, it can detect the occurrence of muscle contractions and strength of muscle contractions.
We can check organ health and arousal and it can be used for diagnosis for medical
intervention and enhance social interaction.
● Electrodermal Activity:
Another name of this sensor is Galvanic Skin response (GSR), used for emotional and
physical arousal. Eye trackers are utilized as a part of exploration on the visual framework, in
brain research, in psycholinguistics, showcasing, as an information gadget for human PC
cooperation, and in item plans . In HandSight sensors are used to sense lights, find distance of
physical objects. In the breathalyzer microphone there is a collection of blood-alcohol content
22
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
● Aerospace
In this paper a testbed infrastructure designed for vehicle driving that includes control-
system experimentation, strategies, and sensors
● Arduino boards are able to read analog or digital input signals from different sensors
and turn it into an output such as activating a motor, turning LED on/off, connecting to the
cloud and many other actions.
● You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE (referred to as uploading software).
● Unlike most previous programmable circuit boards, Arduino does not need an extra
piece of hardware (called a programmer) in order to load a new code onto the board. You can
simply use a USB cable.
● Additionally, the Arduino IDE uses a simplified version of C++, making it easier to
learn to program.
● Finally, Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package.
23
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER-5
INSTALLATION OF ARDUINO IDE
This chapter will discuss downloading, installing, and testing the Arduino software (also known
as the Arduino IDE - short for Integrated Development Environment). Before you jump to the
page for your operating system, make sure you've got all the right equipment.
24
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
5.3 Windows:
This page will show you how to install and test the Arduino software with a Windows operating
system (Windows 10, Windows 7, Vista, and XP). Go to the Arduino download page and
download the latest version of the Arduino software for Windows if you have not already.
5.4 Installer:
The Windows version of Arduino is offered in two options: an installer or a zip file. The
installer is the easier of the two options, just download that, and run the executable file to begin
the installation.
25
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
be moving any files around unless you really know what you're doing.
On Windows 10, there is an option to install Arduino through their app store. we do not
recommend installing the Arduino IDE from the app store. You may run into issues because
the OS will automatically update to the most recent release of the Arduino IDE, which may
have unknown bugs.
Look under the Ports (COM & LPT) tree. You should see an open port named "Arduino
26
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
UNO (COMxx)". If there is no COM & LPT section, look under "Other devices" for "Unknown
Device. Right click on the "Arduino UNO (COMxx)" or "Unknown device" port and choose
the "Update Driver Software" option.
Figure 5.6.2: Updating Drive Software
27
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
selected instead.
Figure 5.6.4: Browse for Folder
Windows will finish up the driver installation from there! Your computer will
enumerate with a COM port. You may see a COM port number depending on what is currently
saved in your computer. Try to remember what the number is when uploading. If
28
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
29
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
Depending on the architecture and development board, the built-in LED may be defined
on a different pin. You may need to adjust LED_BUILTIN or pin 13 to a different value before
uploading
If everything worked, the onboard LED on your Arduino should now be blinking! You just
programmed your first Arduino!
Depending on the architecture and development board, the built-in LED may be defined
on a different pin. You may need to adjust LED_BUILTIN or pin 13 to a different value before
uploading.
For the BATTERY VOLTAGE MONITOR AND DISPLAY we have used two main
libraries for LCD.
1. <LiquidCrystal_I2C.h>
2. <LcdBarGraphRobojax.h>
30
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER 6
LIQUID CRYSTAL DISPLAY(LCD)
The LiquidCrystal library allows you to control LCD displays that are compatible with
the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them
by the 16-pin interface.
The LCDs have a parallel interface, meaning that the microcontroller has to manipulate
several interface pins at once to control the display. The interface consists of the following
pins:
● A register select (RS) pin that controls where in the LCD's memory you're writing data
to. You can select either the data register, which holds what goes on the screen, or an
instruction register, which is where the LCD's controller looks for instructions on what
to do next.
● A Read/Write (R/W) pin that selects reading mode or writing mode
● An Enable pin that enables writing to the registers
● 8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're
writing to a register when you write, or the values you're reading when you read.
31
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
There's also a display contrast pin (Vo), power supply pins (+5V and GND) and LED
Backlight (Bolt and BKlt-) pins that you can use to power the LCD, control the display
contrast, and turn on and off the LED backlight, respectively.
The process of controlling the display involves putting the data that form the image of
what you want to display into the data registers, then putting instructions in the instruction
register. The LiquidCrystal Library simplifies this for you so you don't need to know the low-
level instructions.
The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit
mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For
displaying text on the screen, you can do most everything in 4-bit mode, so an example shows
how to control a 16x2 LCD in 4-bit mode.
The way a pixel is controlled is different in each type of display; CRT, LED, LCD and
newer types of displays all control pixels differently. In short, LCDs are lit by a backlight, and
pixels are switched on and off electronically while using liquid crystals to rotate polarized
light. A polarizing glass filter is placed in front and behind all the pixels, the front filter is
placed at 90 degrees. In between both filters are the liquid crystals, which can be electronically
switched on and off.
It's made with either a passive matrix or an active matrix display grid. The active matrix
LCD is also known as a thin film transistor (TFT) display. The passive matrix LCD has a grid
of conductors with pixels located at each intersection in the grid. A current is sent across two
conductors on the grid to control the light for any pixel. An active matrix has a transistor
located at each pixel intersection, requiring less current to control the luminance of a pixel.
32
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
For this reason, the current in an active matrix display can be switched on and off more
frequently, improving the screen refresh time.
Some passive matrix LCDs have dual scanning, meaning that they scan the grid twice
with current in the same time that it took for one scan in the original technology. However,
the active matrix is still a superior technology out of the two.
LCDs are now being outpaced by other display technologies, but are not completely left
in the past. Steadily, LCDs have been being replaced by OLEDs, or organic light-emitting
diodes.
OLEDs use a single glass or plastic panel, compared to LCDs which use two. Because
an OLED does not need a backlight like an LCD, OLED devices such as televisions are
typically much thinner, and have much deeper blacks, as each pixel in an OLED display is
individually lit.
If the display is mostly black in an LCD screen, but only a small portion needs to be lit,
the whole back panel is still lit, leading to light leakage on the front of the display. An OLED
screen avoids this, along with having better contrast and viewing angles and less power
consumption. With a plastic panel, an OLED display can be bent and folded over itself and
still operate. can be seen in smartphones, such as the controversial Galaxy Fold; or in the
iPhone X, which will bend the bottom of the display over itself so the display’s ribbon cable
33
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
can reach in towards the phone, eliminating the need for a bottom bezel.However, OLED
displays tend to be more expensive and can suffer from burn-in, as plasma-based displays do.
QLED stands for quantum light-emitting diode and quantum dot LED. QLED displays
were developed by Samsung and can be found in newer televisions. QLEDs work most
similarly to LCDs, and can still be considered as a type of LCD. QLEDs add a layer of
quantum dot film to an LCD, which increases the color and brightness dramatically compared
to other LCDs. The quantum dot film is made up of small crystal semiconductor particles. The
crystal semiconductor particles can be controlled for their color output.
When deciding between a QLED and an OLED display, QLEDs have much more
brightness and aren’t affected by burn-in. However, OLED displays still have a better contrast
ratio and deeper blacks than QLEDs.
34
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER - 7
VOLTAGE SENSOR
35
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
the output is the switches, analog voltage signal, a current signal, an audible signal, etc.
Some sensors provide sine waveforms or pulse waveforms like output & others can
generate outputs like AM (Amplitude Modulation), PWM (Pulse Width Modulation) or FM
(Frequency Modulation). The measurement of these sensors can depend on the voltage
divider.
This sensor includes input and output. The input side mainly includes two pins namely
positive and negative pins. The two pins of the device can be connected to the positive &
negative pins of the sensor. The device positive & negative pins can be connected to the
positive & negative pins of the sensor. The output of this sensor mainly includes supply
voltage (Vcc), ground (GND), analog o/p data
Voltage sensors are wireless tools that can be attached to any number of assets,
machinery or equipment. They provide 24/7 monitoring, constantly watching for voltage data
that could indicate a problem. Low voltage may signal a potential issue, while other assets
may be in danger when voltage is too high.
When thresholds are exceeded, alerts are immediately sent to a centralized computer
system. Voltage sensors detect magnetic fields, electromagnetic fields, and measure contact
voltage. Maintenance teams can use this information to have a better understanding of their
equipment and assets
36
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
batteries or other sensors. This can help a maintenance team identify areas that need immediate
attention or alert the team of a rising problem.
These sensors are classified into two types like a resistive type sensor and capacitive type
sensor.
1) Resistive Type Sensor:
This sensor mainly includes two circuits like a voltage divider & bridge circuit. The
resistor in the circuit works as a sensing element. The voltage can be separated into two resistors
like a reference voltage & variable resistor to make a circuit of the voltage divider. A voltage
supply is applied to this circuit. The output voltage can be decided by the resistance used in the
37
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
The bridge circuit can be designed with four resistors. One of these resistors can be
subjected to the voltage detector device. The change in voltage can be directly exhibited. This
difference alone can be amplified but the difference within the voltage divider circuit is not
only amplified.
This type of sensor consists of an insulator and two conductors within the center. As
the capacitor is power-driven with 5 Volt, then the flow of current will be there in the capacitor.
This can create revulsion of electrons within the capacitor. The difference in capacitance
indicates the voltage and the capacitor can be connected within the series.
38
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
The Arduino analog input is limited to a 5 VDC input. If you wish to measure higher
voltages, you will need to resort to another means. One way is to use a voltage divider. The one
discussed here is found all over Amazon and online platforms. It is fundamentally a 5:1 voltage
divider using a 30K and a 7.5K Ohm resistor.
The Voltage Sensor Module is a simple but very useful module that uses a potential
divider to reduce an input voltage by a factor of 5. The 0-25V Voltage Sensor Module allows
you to use the analog input of a microcontroller to monitor voltages much higher than it is
capable of sensing.
5. Dimensions: 4 × 3 × 2 cm
Before going into the details of the Voltage Sensor like its functionality and schematic,
let me give you an overview of the available Pins of the Voltage Sensor Module. Basically, a
25V Voltage Sensor, like the one used here, has 5 pins in total. Two of them are on the two-
pin screw terminal and three are male header pins.
39
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
The Screw Terminal pins are marked as VCC and GND and they must be connected to the
external source of voltage i.e. the voltage that needs to be measured.
Coming to the three male headers, they are marked as S, + and –. The S pin is the
“Sense” pin and it must be connected to the Analog Input of the Arduino. The “–” pin must be
connected to the GND of the Arduino. The pin marked as “+” is not connected to anything (it
is an N/C Pin).
40
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
Arduino AVR chips have 10-bit AD, so this module simulates a resolution of 0.00489V
(5V/1023), so the minimum voltage of the input voltage detection module is
0.00489Vx5=0.02445V.
41
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
void loop(){
// Read the Analog Input
adc_value = analogRead(ANALOG_IN_PIN);
// Short delay
delay(500);
}
Thus, this is all about voltage sensors which can be used to detect the range of voltage in any
device. It decides the electrical charge within any device. The working principle of this sensor
mainly depends on the principle of either capacitive or resistive.
42
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
Voltage sensors are inexpensive tools that can make a big difference in improving your
predictive maintenance program. When used in combination with a reliable CMMS solution,
sensors can provide a wealth of data for your organization. This information can then help your
maintenance management team make strategic decisions about repair, investments, and process
changes.
43
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER-8
I2C CONNECTOR
44
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
● At the heart of the adapter is an 8-bit I/O expander chip – PCF8574. This chip converts
the I2C data from an Arduino into the parallel data required for an LCD display.
● The board also comes with a small trimpot to make fine adjustments to the display’s
contrast.
● In addition, there is a jumper on the board that supplies power to the backlight. To
control the intensity of the backlight, you can remove the jumper and apply external
voltage to the header pin that is marked ‘LED’.
● An important point here is that several companies manufacture the same PCF8574 chip,
Texas Instruments and NXP Semiconductors, to name a few. And the I2C address of
your LCD depends on the chip manufacturer.
45
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER-9
COMPONENTS USED FOR BATTERY VOLTAGE MONITOR AND
DISPLAY
1. Arduino UNO
2. 16 x 2 LCD Display
3. 1.2v Lithium-ion Batteries
4. 12v Lead-acid Batteries
5. Voltage Sensor
6. I2C Module
7. Connecting wires
46
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER-10
BLOCK DIAGRAM & CIRCUIT DIAGRAM
47
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER-11
SOURCE CODE
The following code written below is used for displaying the battery level indicator. This code
needs to be written in the Arduino IDE software. There are 3 main libraries in use and they are
“Wire.h”, “LiquidCrystal_I2C.h”, and “LCDBarGraphRobojax.h”.
SOURCE CODE:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LcdBarGraphRobojax.h>
int offset =20;
48
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
void loop()
{
lbg.clearLine(1);// clear line 1 to display fresh voltage value
int inpuValue = analogRead(A0);
int volt = analogRead(A0);
double voltage = map(volt,0,1023, 0, 2500) + offset;// map 0-1023 to 0-2500
voltage /=12.5;// divide by 100 to get the decimal values
// -- draw bar graph from the analog value read
lbg.drawValue( inpuValue, 520);
// -- do some delay: frequent draw may cause broken visualization
lcd.setCursor (0,1); //
lcd.print("Bat Charge:");
lcd.setCursor (11,1); //
lcd.print(voltage); // print
lcd.setCursor (15,1); //
lcd.print("%");
if(voltage>0 && voltage<=20)
{
digitalWrite(7,HIGH);
delay(1000);
digitalWrite(7,LOW);
}
else if(voltage>20 && voltage<=50)
{
digitalWrite(6,HIGH);
delay(1000);
digitalWrite(6,LOW);
}
else if(voltage>50 && voltage<=100)
{
digitalWrite(5,HIGH);
delay(1000);
49
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
digitalWrite(5,LOW);
}
else
{
digitalWrite(7,HIGH);
digitalWrite(6,HIGH);
digitalWrite(5,HIGH);
delay(1000);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
digitalWrite(5,LOW);
}
delay(100);
}
50
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
CHAPTER - 12
CONCLUSION
Battery voltage monitor and display is the project that indicates the status of the battery by
use of LCD. This project can know the status of the battery left. This is easier for people and can
be more alert than about the status of battery level.
The battery level indicator is shown in bar form on the LCD display. This can easily
recognize the battery level. Battery level indicator can present a circuit that can know the battery
level of a device with the help of a voltage sensor and display on LCD.
Battery level indicators were introduced before by people from other countries that have
the same concept such as in 1938 by Heyer. He introduced the battery capacity indicator to show
the percentage of battery.
The indicator indicates the quantity of power and voltage of the battery that is left. This
project used the LCD method to show the input. The LCD can display the percentage and voltage
of the battery.
This circuit mainly uses IC LM3914 which is basically an LCD controller to operate LCD.
Instead of using the LCD controller in this circuit, using a microcontroller is an important key to
the upgrade of this project that can make the battery level indicator more complex in electronic
devices.
51
KMIT BATTERY VOLTAGE MONITOR AND DISPLAY
REFERENCES
http://dspace.unimap.edu.my/xmlui/handle/123456789/44292
https://www.electronicshub.org/battery-level-indicator/
https://www.engineersgarage.com/battery-level-indicator/
https://en.wikipedia.org/wiki/Battery_indicator
https://circuitdigest.com/electronic-circuits/simple-battery-level-indicator-using-op-amp
https://en.wikipedia.org/wiki/History_of_the_battery
https://www.iproject.com.ng/electrical-engineering/construction-and-design-of-battery-
level-indicator-circuit/index.html
https://www.tutorialspoint.com/arduino/arduino_overview.htm
https://www.techtarget.com/whatis/glossary/Personal-Computing
https://www.electronicshub.org/interfacing-voltage-sensor-with-arduino/
https://how2electronics.com/interfacing-0-25v-dc-voltage-sensor-with-arduino/
https://www.elprocus.com/voltage-sensor-working-applications/
https://www.upkeep.com/learning/voltage-sensors
52