Why This Project Matters
Most people only see their electricity consumption as a single number on a monthly bill. That makes it difficult to understand:
- Which devices consume the most power
- When current spikes occur
- How voltage fluctuates throughout the day
- Whether motors or power supplies are operating efficiently
By collecting and visualising real-time measurements, this project makes electrical systems easier to understand and troubleshoot.
Potential applications include:
- Home energy monitoring
- Solar system analysis
- Lab instrumentation
- Industrial load tracking
- Preventive maintenance
- Smart building automation

Hardware Requirements
| Components | Purpose |
| Arduino UNO R4 WiFi | Main controller with built-in Wi-Fi |
| PZEM-004T v3.0 | AC energy meter with Modbus interface |
| Current Transformer (CT) | Non-invasive current measurement |
| SSD1306 OLED Display | Local readout |
| Push Button | Display mode selection |
| ThingSpeak | Cloud dashboard |
| 3D Printed Enclosure | Safe and clean packaging |

The project follows a simple edge-to-cloud architecture.
- The PZEM-004T measures electrical parameters directly from the mains.
- The Arduino UNO R4 WiFi reads those values over Modbus RTU.
- Data is displayed on the OLED.
- The same values are uploaded to ThingSpeak using Wi-Fi.
- Historical graphs are generated automatically.
This provides both instant local feedback and long-term cloud logging.

System Architecture
AC Mains
│
▼
PZEM-004T + CT Clamp
│ (Modbus UART)
▼
Arduino UNO R4 WiFi
├── OLED Display
└── ThingSpeak Cloud
Key Features
- Real-time energy monitoring
- Wi-Fi cloud connectivity
- OLED dashboard
- Non-blocking firmware architecture
- Automatic graph generation in ThingSpeak
- Expandable to multiple circuits
- Custom 3D printed enclosure
Measured Parameters
| Parameter | Description |
| Voltage | Supply health and stability |
| Current | Instantaneous load demand |
| Power | Real power consumed |
| Energy | Accumulated usage over time |
| Frequency | Grid frequency |
| Power Factor | Electrical efficiency |
Why Arduino UNO R4 WiFi?
The UNO R4 WiFi is ideal for this project because it combines:
- Built-in Wi-Fi
- More memory than classic UNO boards
- 32-bit processing power
- Native hardware UART for reliable Modbus communication
That means the firmware can read the meter, refresh the display, and upload to the cloud simultaneously without timing issues.

Firmware Design
The code uses a non-blocking timing structure based on millis().
Independent tasks run at different intervals:
- Read PZEM data every second
- Update OLED display every 500 ms
- Upload to ThingSpeak every 16 seconds
- Handle button input continuously
This approach keeps the system responsive and easy to extend.

Local OLED Display
The OLED provides immediate access to the latest readings.
The push button cycles through:
- All parameters summary
- Voltage screen
- Current screen
- Power screen
- Energy screen
- Frequency screen
- Power factor screen
This makes the monitor useful even without an internet connection.
Cloud Dashboard
ThingSpeak stores the uploaded data and plots it automatically.
This enables:
- Daily and weekly energy trends
- Voltage fluctuation analysis
- Startup current spike observation
- Efficiency monitoring
Viewing the graphs over time reveals patterns that are impossible to spot from a single utility bill.
Real-World Observations
Testing the project on household loads produced some interesting results:
- Refrigerators showed sharp inrush current spikes
- Power supplies caused noticeable power factor changes
- Voltage dipped slightly during heavy load switching
- Energy usage increased exactly as expected over time
These observations make the project both educational and practical.
Safety Notes
This project interfaces with mains voltage.
Important precautions:
- Use insulated enclosures
- Never touch exposed AC terminals
- Verify wiring before powering up
- Use properly rated components
- Test with caution
If you are not experienced with AC systems, seek assistance from someone qualified.
Enclosure Design
To make the project deployment-ready, all electronics were installed inside a custom 3D printed enclosure with cutouts for:
- OLED display
- Push button
- Power input
- CT cable
- USB access
The enclosure improves safety and gives the build a polished appearance.
Possible Upgrades
This platform can be expanded in several directions:
- Multiple PZEM modules for branch monitoring
- SD card logging
- Telegram or email alerts
- Relay-based load control
- MQTT integration
- Home Assistant support
- Solar inverter analytics
Build Challenges
A few practical issues surfaced during development:
- Modbus communication timing
- Wi-Fi reconnect handling
- Display refresh optimization
- Debouncing the push button
Solving these challenges resulted in a reliable and responsive system.
What I Learned
This project provided hands-on experience with:
- Electrical measurement fundamentals
- Modbus RTU communication
- Non-blocking embedded programming
- Cloud data logging
- Data visualization
- Safe enclosure design
It sits in a sweet spot between beginner and intermediate embedded projects.
Performance Summary
The completed system successfully:
- Measures six electrical parameters
- Updates the OLED in real time
- Uploads data to ThingSpeak
- Stores historical readings
- Runs continuously with stable performance
The result is a compact and practical smart-grid monitoring node.
Project Logs to Include on Hackaday.io
To maximize visibility and engagement, consider creating project logs for:
- Hardware assembly
- Wiring and safety tips
- Modbus communication setup
- OLED interface design
- ThingSpeak integration
- 3D printed enclosure
- Testing with real appliances
- Future improvements
Regular logs help attract followers and keep the project active in the Hackaday community.
Files to Share
Upload these assets to your Hackaday.io project page:
- Source code (.ino)
- Circuit diagram
- Wiring table
- OLED screenshots
- ThingSpeak dashboard images
- STL enclosure files
- BOM
- Demonstration video
Conclusion
WattWise transforms a standard Arduino and energy meter into a powerful IoT instrument.
By combining real-time sensing, local visualization, and cloud analytics, the project provides meaningful insight into how electricity is actually used.
It is useful as a learning platform, a practical monitoring tool, and a foundation for larger Smart Grid in IoT and home automation projects.
If you enjoy projects that connect embedded systems, electrical engineering, and data visualization, this one is worth building.
Explore hands-on tutorials, circuit diagrams, and source code for hundreds of innovative Arduino Projects collection.
ElectroScope Archive