Industrial machines and electrical equipment require regular maintenance to operate efficiently. Unexpected equipment failures can cause production delays, increased maintenance costs and operational problems.
Traditional maintenance methods often depend on fixed inspection schedules or manual observation. However, continuous monitoring can help identify unusual machine behaviour at an early stage.
In this project, I developed an IoT-based Predictive Equipment Maintenance System using a NodeMCU ESP8266. An ADXL345 accelerometer measures machine vibration, while a DS18B20 temperature sensor monitors equipment temperature.
The ESP8266 collects and processes the sensor readings and transmits the information through Wi-Fi to the KiwisIoT platform. Users can monitor equipment conditions through a cloud dashboard and identify abnormal vibration or temperature changes.
This project demonstrates how IoT technology can support equipment condition monitoring and early maintenance alerts.
Hardware and Software ComponentsHardware ComponentsThe hardware consists of a NodeMCU ESP8266 as the main controller, an ADXL345 three-axis accelerometer for monitoring machine vibration and a DS18B20 waterproof temperature sensor for measuring equipment temperature.
Additional components include a 4.7kΩ resistor, jumper wires, a breadboard, a regulated power supply and a suitable enclosure for protecting the electronic components.
Software ComponentsThe software development is carried out using Arduino IDE with the ESP8266 Board Package. The Adafruit ADXL345 Unified Library and Adafruit Unified Sensor Library are used for vibration monitoring. The OneWire and DallasTemperature libraries are used for temperature measurement.
The KiwisIoT Arduino Library is used for cloud communication, while the ESP8266WiFi library provides wireless connectivity.
Circuit ConnectionsThe NodeMCU ESP8266 acts as the main controller. The ADXL345 communicates through I2C communication, while the DS18B20 temperature sensor uses a digital data connection.
ADXL345 Vibration Sensor ConnectionsThe ADXL345 VCC is connected to NodeMCU 3.3V, and GND is connected to NodeMCU GND. The SDA pin is connected to D2, and the SCL pin is connected to D1.
DS18B20 Temperature Sensor ConnectionsThe DS18B20 VCC is connected to NodeMCU 3.3V, and GND is connected to NodeMCU GND. The DATA pin is connected to NodeMCU D4. A 4.7kΩ pull-up resistor is connected between DATA and 3.3V.
Power Supply ConnectionsThe NodeMCU ESP8266 is powered through its USB input using a regulated 5V supply. Both sensors share a common ground with the controller.
The ADXL345 should be securely mounted on the equipment being monitored so that it can measure machine vibration accurately. The DS18B20 should be positioned near the equipment surface where temperature monitoring is required.
Arduino CodeThe following program reads machine vibration information using the ADXL345 sensor and measures equipment temperature using the DS18B20 sensor.
The ESP8266 processes the collected readings, identifies abnormal operating conditions using configurable thresholds and transmits the information to KiwisIoT through Wi-Fi.
Install the Adafruit ADXL345, Adafruit Unified Sensor, OneWire, DallasTemperature and KiwisIoT libraries before uploading the program.
#include <ESP8266WiFi.h>
#include <KiwisIoT.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <math.h>
// WiFi Credentials
const char* ssid = "YOUR_WIFI_NAME";
const char* pass = "YOUR_WIFI_PASSWORD";
// KiwisIoT Topic ID
const char* topic = "YOUR_TOPIC_ID";
// Temperature Sensor
#define TEMP_PIN D4
// DS18B20
OneWire oneWire(TEMP_PIN);
DallasTemperature tempSensor(&oneWire);
// ADXL345
Adafruit_ADXL345_Unified accel =
Adafruit_ADXL345_Unified(12345);
// KiwisIoT
KiwisIoT kiwisiot(ssid, pass, topic);
// Monitoring Interval
unsigned long previousMillis = 0;
// Example Warning Thresholds
const float TEMP_LIMIT = 60.0;
const float VIBRATION_LIMIT = 2.0;
void setup() {
Serial.begin(115200);
Wire.begin(D2, D1);
tempSensor.begin();
if (!accel.begin()) {
Serial.println("ADXL345 Not Found!");
while (true) {
delay(1000);
}
}
accel.setRange(ADXL345_RANGE_16_G);
kiwisiot.begin();
Serial.println("Predictive Equipment Monitoring Started");
}
void loop() {
kiwisiot.run();
if (millis() - previousMillis >= 3000) {
previousMillis = millis();
// Read Temperature
tempSensor.requestTemperatures();
float temperature =
tempSensor.getTempCByIndex(0);
// Read Accelerometer
sensors_event_t event;
accel.getEvent(&event);
float x = event.acceleration.x;
float y = event.acceleration.y;
float z = event.acceleration.z;
// Calculate Acceleration Magnitude
float magnitude =
sqrt(x * x + y * y + z * z);
// Remove Approximate Gravity Component
float vibration =
fabs(magnitude - 9.81);
// Equipment Condition
String equipmentStatus = "NORMAL";
if (vibration > VIBRATION_LIMIT ||
(temperature != DEVICE_DISCONNECTED_C &&
temperature > TEMP_LIMIT)) {
equipmentStatus = "WARNING";
}
Serial.println("\n--- EQUIPMENT HEALTH ---");
if (temperature != DEVICE_DISCONNECTED_C) {
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");
kiwisiot.send("0", String(temperature, 2));
} else {
Serial.println("Temperature Sensor Error");
}
Serial.print("Vibration: ");
Serial.print(vibration);
Serial.println(" m/s2");
Serial.print("Equipment Status: ");
Serial.println(equipmentStatus);
// Send Information to KiwisIoT
kiwisiot.send("1", String(vibration, 2));
kiwisiot.send("2", equipmentStatus);
}
}Note: The temperature limit of 60°C and vibration threshold of 2.0 m/s² are example values, not universal equipment safety limits. Configure them according to the machine specifications and baseline measurements. The vibration calculation is a simple acceleration-magnitude indicator, not a calibrated vibration RMS or frequency analysis. This prototype provides condition-monitoring warnings; genuine predictive maintenance requires historical data, trend analysis and suitable predictive models.
KiwisIoT Platform IntegrationI use the KiwisIoT platform to visualize equipment health information and monitor machine conditions remotely.
First, I create an account on KiwisIoT and create a new dashboard panel. I configure the ESP8266 device using the generated Topic ID and connect it to an internet-enabled Wi-Fi network.
The dashboard uses Channel 0 to display equipment temperature, Channel 1 to display vibration readings and Channel 2 to display equipment operating status.
I add suitable Gauge, Label and Chart widgets to visualize the incoming sensor information and observe changes in machine conditions over time.
After uploading the Arduino program, the ESP8266 starts transmitting equipment monitoring information to the KiwisIoT cloud platform.
Platform SetupFirst, visit https://www.kiwisiot.in/ and create an account. Next, create a dashboard panel and configure the device using its generated Topic ID. Add suitable monitoring widgets for temperature, vibration and equipment status. Upload the Arduino program to the NodeMCU ESP8266 and monitor equipment health through the dashboard.
KiwisIoT Project Examples:https://github.com/Kiwistron/KiwisIoT-Projects/tree/main
Working PrincipleThe ADXL345 accelerometer is mounted on the machine and continuously measures acceleration along three axes. These readings are used to calculate an approximate vibration indicator.
The DS18B20 temperature sensor measures the temperature of the equipment surface. The NodeMCU ESP8266 collects both sensor readings and compares them with predefined monitoring thresholds.
When the vibration or temperature reading exceeds the configured threshold, the system identifies the equipment condition as WARNING. Otherwise, the condition is displayed as NORMAL.
The ESP8266 transmits the collected information through Wi-Fi to the KiwisIoT cloud platform, where users can monitor equipment health and observe changes through dashboard widgets.
By analysing historical sensor readings, the system can be further developed to identify unusual operating patterns and estimate possible maintenance requirements.
ApplicationsThis system can be used for industrial machine monitoring, motor health monitoring and pump condition monitoring. It is also useful for manufacturing equipment, factory automation systems, electrical machinery, rotating equipment, workshop machines and industrial maintenance applications.
TroubleshootingADXL345 Not FoundCheck the I2C connections, sensor power supply and module address. Verify that SDA is connected to D2 and SCL is connected to D1.
Incorrect Vibration ReadingsCheck whether the accelerometer is firmly mounted on the machine. Loose mounting can produce inaccurate readings.
DS18B20 Showing -127°CCheck the DATA connection and verify that the 4.7kΩ pull-up resistor is connected correctly.
Equipment Always Showing WARNINGVerify the configured temperature and vibration thresholds. Compare the readings with the machine's normal operating baseline.
Unstable Sensor ReadingsCheck the power supply, wiring connections and sensor mounting position. Avoid placing the sensor near unrelated sources of vibration.
Wi-Fi Not ConnectingVerify the Wi-Fi name and password and ensure that the network has an active internet connection.
KiwisIoT Dashboard Not UpdatingCheck the Topic ID, channel configuration and internet connectivity. Make sure the ESP8266 is successfully communicating with the platform.
Final OutputThe completed IoT-Based Predictive Equipment Maintenance System monitors machine vibration and temperature using an ADXL345 accelerometer and DS18B20 temperature sensor.
The NodeMCU ESP8266 processes the collected information and transmits it to the KiwisIoT cloud platform.
Users can remotely monitor machine conditions, observe vibration changes and identify unusual temperature variations through an online dashboard.
This project demonstrates how IoT technology can support equipment condition monitoring, early warning systems and smarter maintenance management.
KiwisIoT Platform RecommendationI recommend the KiwisIoT platform for this project because it provides a simple way to connect ESP8266 devices and visualize real-time equipment monitoring information through a cloud dashboard.
With KiwisIoT, users can monitor temperature, vibration and equipment status without developing a separate monitoring interface.
The platform can also be extended with additional sensors, alerts, historical data and automation features.
Project Examples:https://github.com/Kiwistron/KiwisIoT-Projects/tree/main
Future ImprovementsThe next version can include an additional current sensor to monitor motor power consumption and identify unusual electrical behaviour. A higher-performance vibration sensor can provide more accurate vibration measurements, while an industrial temperature sensor can improve equipment temperature monitoring.
The system can also be extended with historical sensor data storage, machine learning-based anomaly detection, automatic maintenance alerts and multiple equipment monitoring stations.
My Recommendation: For the next version, I recommend integrating current monitoring and historical vibration analysis with a machine learning model to identify unusual equipment behaviour and improve maintenance prediction.





_JnuTDtq8iW.jpeg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)



_1x_bGT19vVAby.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)



Comments