IoT Battery Voltage Monitor Using ESP8266 and KiwisIoT
by Varun_Prasad_07 in Circuits > Arduino
7 Views, 0 Favorites, 0 Comments
IoT Battery Voltage Monitor Using ESP8266 and KiwisIoT
Battery voltage is an important parameter in many electronic and robotics projects. A battery that is running low can cause unexpected resets, motor problems, unstable sensor readings, or complete system shutdown.
In this project, we will build a simple IoT Battery Voltage Monitoring System using ESP8266 NodeMCU and KiwisIoT.
The system uses a 0–25V voltage sensor module to measure the battery voltage. The ESP8266 reads the sensor through its analog input, calculates the battery voltage, and sends the value to the KiwisIoT cloud platform over Wi-Fi.
A mini buzzer is also included as a local low-voltage warning. When the battery voltage drops below the configured threshold, the buzzer turns ON.
The KiwisIoT dashboard allows the battery voltage to be monitored remotely in real time.
For this prototype, a 9V battery is used as the demonstration battery.
Supplies
Hardware Components Required
ESP8266 NodeMCU → 1
0–25V Voltage Sensor Module → 1
9V Battery / DC Battery → 1
Mini Buzzer → 1
Breadboard → 1
Jumper Wires → As Required
Micro USB Cable → 1
5V USB Adapter → 1
Software Components Required
Arduino IDE
ESP8266 Board Package
KiwisIoT Library
ESP8266WiFi Library
Connect the Hardware
Voltage Sensor
Connect the voltage sensor to the ESP8266:
VCC → 3.3V
GND → GND
S → A0
Battery
Connect the battery to the voltage sensor input:
Battery Positive (+) → VIN+
Battery Negative (−) → VIN−
Mini Buzzer
Connect the buzzer:
Buzzer Positive (+) → D5
Buzzer Negative (−) → GND
Important
All components must have the required common ground connection.
Your basic circuit is:
Battery → Voltage Sensor → ESP8266 → KiwisIoT
and:
ESP8266 → Buzzer
Important Voltage Sensor Safety
This is one part you should not gloss over in an Instructables article.
A module marketed as a 0–25V voltage sensor does not automatically mean that its output is safe for every ESP8266 ADC configuration at 25V.
Before connecting a higher-voltage battery:
- Check the resistor-divider ratio of your module.
- Check the ADC input range of your specific ESP8266 NodeMCU board.
- Measure the voltage at the sensor's S output using a multimeter.
- Make sure the voltage reaching A0 is within the permitted range.
For this tutorial, a 9V battery is used as the demonstration source.
Prepare Arduino IDE
Install the ESP8266 board package in Arduino IDE.
Then install:
ESP8266WiFi
KiwisIoT
The KiwisIoT library is used to connect the ESP8266 to the KiwisIoT cloud platform and send the battery voltage to the dashboard.
Create Your KiwisIoT Dashboard
Open your KiwisIoT dashboard and create a new panel.
After creating the panel, copy the generated Topic ID.
You will use this Topic ID in the ESP8266 program.
Example:
KiwisIoT Widget
For this project, create:
Channel 1 → Battery Voltage
You can use a:
- Gauge
- 360° Gauge
- Display
- Chart
The KiwisIoT dashboard will then display the battery voltage received from the ESP8266.
Configure Wi-Fi
Open the Arduino code and enter your Wi-Fi details:
Replace:
YOUR_WIFI → Your Wi-Fi name
YOUR_PASSWORD → Your Wi-Fi password
YOUR_TOPIC → Your KiwisIoT Topic ID
Upload the Code
Upload and Test
Select your ESP8266 NodeMCU board and the correct COM port.
Upload the program.
Open the Serial Monitor at:
115200 baud
You should see something similar to:
The exact value will depend on your battery, voltage sensor, ESP8266 board, and calibration.
Monitor the Battery Using KiwisIoT
The KiwisIoT dashboard is used to receive, visualize, and monitor the battery voltage sent by the ESP8266. Once the ESP8266 is connected to Wi-Fi and the KiwisIoT Topic ID is configured in the code, the dashboard can display the battery voltage in real time.
7.1 Login to KiwisIoT
Open the KiwisIoT platform:
Sign in using your KiwisIoT account.
After successful login, open My Panels from the navigation menu.
7.2 Create a New Panel
From the My Panels section:
- Click Create Panel or the option to create a new panel.
- Enter a suitable panel name.
For this project, you can use:
Battery Voltage Monitoring
- Create the panel.
- Open the newly created panel.
The panel will provide a dedicated dashboard where the battery voltage can be displayed.
7.3 Get the Topic ID
After creating the panel, locate the Topic ID displayed in the KiwisIoT panel.
It will look similar to:
Copy the complete Topic ID.
Open your Arduino code and replace:
with your actual KiwisIoT Topic ID:
Important: The Topic ID in the ESP8266 code and the KiwisIoT panel must match. Otherwise, the data will not appear on the dashboard.
7.4 Add a Battery Voltage Widget
Open the Edit mode of your KiwisIoT panel.
Click:
Add Widget
KiwisIoT provides different widgets for displaying and visualizing IoT data.
For this project, you can use:
Gauge → For displaying the current battery voltage
or
360° Gauge → For a circular battery-voltage display
or
Display / Label → For showing the voltage as a numerical value
or
Chart → For observing voltage changes over time
For a simple battery-monitoring dashboard, a Gauge + Chart combination is useful.
7.5 Configure the Widget
After adding the widget, configure its data source.
Set the channel to:
Channel 1 → Battery Voltage
The ESP8266 sends the battery voltage using:
Here:
"1" → Channel 1
batteryVoltage → Voltage value
Therefore, the KiwisIoT widget must be configured to receive data from Channel 1.
7.6 Configure the Voltage Range
Set the widget's minimum and maximum values according to your battery and measurement setup.
For example, for a 9V battery demonstration:
Minimum → 0V
Maximum → 12V
If you are monitoring a different battery, configure the range accordingly.
Do not blindly set the dashboard range to 25V simply because the sensor module is marketed as a 0–25V module. The actual safe measurement range depends on the complete voltage-sensing and ESP8266 ADC configuration.
7.7 Save the Dashboard
After configuring the widget:
- Check the channel assignment.
- Check the widget range.
- Give the widget a meaningful name.
For example:
Battery Voltage
- Click Save.
Your KiwisIoT dashboard is now configured.
7.8 Upload the ESP8266 Program
Make sure the following values are correctly configured in the code:
Upload the program to the ESP8266 NodeMCU.
Once the ESP8266 connects to Wi-Fi, it starts sending battery-voltage data to KiwisIoT.
7.9 Verify the Live Data
Open the KiwisIoT dashboard.
The Battery Voltage widget should start displaying the value received from the ESP8266.
The complete communication path is:
7.10 Recommended KiwisIoT Dashboard Layout
For this project, a simple dashboard can contain:
Battery Voltage Gauge
→ Displays the current voltage
Battery Voltage Chart
→ Shows voltage variation over time
This makes the KiwisIoT dashboard useful not only for seeing the current battery voltage but also for observing how the voltage changes during operation
Results
After completing the setup, the system successfully monitors the battery voltage using the ESP8266 and sends the data to the KiwisIoT cloud dashboard.
The expected operation is:
Battery Voltage → ESP8266 → KiwisIoT → Dashboard
The Serial Monitor displays the measured voltage, while the KiwisIoT dashboard provides remote visualization.
When the battery voltage falls below the configured threshold, the mini buzzer turns ON to provide a local warning.
Expected Output
When the voltage becomes lower than the configured threshold:
At the same time:
Low Voltage → Buzzer ON
and the latest voltage value continues to be sent to KiwisIoT.
Conclusion
This project demonstrates how an ESP8266 NodeMCU can be combined with a voltage sensor and KiwisIoT to create a simple IoT-based battery voltage monitoring system.
The voltage sensor measures the battery voltage, the ESP8266 processes the analog signal, and KiwisIoT provides the cloud-based dashboard for remote monitoring.
The addition of a mini buzzer provides a local warning when the battery voltage falls below the configured threshold.
The project demonstrates a complete IoT workflow:
The system can be further expanded with current monitoring, battery percentage estimation, charging/discharging monitoring, historical data analysis, and remote notifications.
FAQ
What is KiwisIoT used for in this project?
KiwisIoT is used as the cloud monitoring platform. The ESP8266 sends the measured battery voltage to KiwisIoT, where it can be displayed through dashboard widgets.
Why is the Topic ID required?
The Topic ID identifies the KiwisIoT panel that should receive the data from the ESP8266. The Topic ID in the code must match the panel being monitored.
Which channel is used for battery voltage?
The project sends battery voltage through:
Therefore:
Channel 1 → Battery Voltage
Why is my KiwisIoT dashboard not showing data?
Check the following:
- ESP8266 is connected to Wi-Fi.
- Wi-Fi SSID and password are correct.
- KiwisIoT library is installed.
- Topic ID is correct.
- Channel 1 is assigned to the battery-voltage widget.
- ESP8266 is successfully running the program.
Why is the voltage reading inaccurate?
The voltage calculation requires calibration. Compare the ESP8266 reading with a multimeter and adjust the conversion factor according to your voltage sensor and ESP8266 board.
Can I use a different battery?
Yes, but the voltage-sensing circuit and ESP8266 ADC input must be checked before connecting a different battery.
Can I add a voltage graph in KiwisIoT?
Yes. Add a Chart widget and configure it to receive the battery-voltage data from Channel 1.
Can I monitor current as well?
Yes. A suitable current sensor can be added and its output can be sent to another KiwisIoT channel, allowing both voltage and current to be monitored.
Can I receive a low-battery notification?
The project can be extended with notification functionality so that a low-voltage condition can be communicated remotely in addition to the local buzzer alert.
Is the 7V threshold suitable for every battery?
No. The 7.0V value is only an example for this project. The appropriate low-voltage threshold depends on the battery chemistry, nominal voltage, number of cells, load, and application.