DIYables Web Apps Web Plotter
WebPlotter Example - Setup Instructions
Overview
The WebPlotter example creates a real-time data visualization interface accessible through any web browser. Designed for Arduino Uno R4 WiFi and DIYables STEM V4 IoT educational platform with enhanced data processing capabilities, real-time plotting features, and seamless integration with sensor monitoring systems. Perfect for visualizing sensor data, debugging algorithms, or monitoring system performance in real-time.

Features
- Real-time Data Plotting: Visualize sensor data as it streams from Arduino
- Multiple Data Series: Plot up to 8 different data streams simultaneously
- Auto-scaling: Automatic Y-axis scaling based on data range
- Interactive Interface: Zoom, pan, and analyze data trends
- WebSocket Communication: Instant updates with minimal latency
- Responsive Design: Works on desktop, tablet, and mobile devices
- Customizable Configuration: Adjustable plot titles, axis labels, and ranges
- Platform Extensible: Currently implemented for Arduino Uno R4 WiFi, but can be extended for other hardware platforms. See DIYables_WebApps_ESP32
Hardware Preparation
Or you can buy the following kits:
1 | × | DIYables STEM V4 IoT Starter Kit (Arduino included) | |
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Setup Instructions
Detailed Instructions
Follow these instructions step by step:
- If this is your first time using the Arduino Uno R4 WiFi/DIYables STEM V4 IoT, refer to the tutorial on setting up the environment for Arduino Uno R4 WiFi/DIYables STEM V4 IoT in the Arduino IDE.
- Connect the Arduino Uno R4/DIYables STEM V4 IoT board to your computer using a USB cable.
- Launch the Arduino IDE on your computer.
- Select the appropriate Arduino Uno R4 board (e.g., Arduino Uno R4 WiFi) and COM port.
- Navigate to the Libraries icon on the left bar of the Arduino IDE.
- Search "DIYables WebApps", then find the DIYables WebApps library by DIYables
- Click Install button to install the library.

- You will be asked for installing some other library dependencies
- Click Install All button to install all library dependencies.

- On Arduino IDE, Go to File Examples DIYables WebApps WebPlotter example, or copy the above code and paste it to the editor of Arduino IDE
- Configure WiFi credentials in the code by updating these lines:
- Click Upload button on Arduino IDE to upload code to Arduino UNO R4/DIYables STEM V4 IoT
- Open the Serial Monitor
- Check out the result on Serial Monitor. It looks like the below
- If you do not see anything, reboot Arduino board.
- Take note of the IP address displayed, and enter this address into the address bar of a web browser on your smartphone or PC.
- Example: http://192.168.0.2
- You will see the home page like below image:

- Click to the Web Plotter link, you will see the Web Plotter app's UI like the below:

- Or you can also access the page directly by IP address followed by /web-plotter. For example: http://192.168.0.2/web-plotter
- Watch as the Arduino generates simulated sensor data and plots it in real-time. You'll see multiple colored lines representing different data streams.
Creative Customization - Visualize Your Data Creatively
Transform the plotting interface to match your unique project requirements and create stunning data visualizations:
Data Source Configuration
Replace simulated data with real sensor readings:
Method 1: Single Sensor Reading
Method 2: Multiple Sensors
Method 3: Array of Values
Plot Customization
Custom Plot Appearance
Dynamic Configuration
Advanced Data Processing
Moving Average Filter
Data Logging with Timestamps
Integration Examples
Environmental Monitoring
Motor Control Feedback
PID Controller Visualization
Performance Optimization
Efficient Data Transmission
Conditional Data Sending
Project Ideas
Scientific Applications
- Data Logger: Record temperature, humidity, pressure over time
- Vibration Analysis: Monitor accelerometer data for mechanical systems
- pH Monitoring: Track water quality in aquaponics systems
- Solar Panel Efficiency: Monitor voltage/current output vs. sunlight
Educational Projects
- Physics Experiments: Visualize pendulum motion, spring oscillations
- Chemistry Lab: Monitor reaction rates and temperature changes
- Biology Studies: Track plant growth sensors, environmental factors
- Mathematics: Plot mathematical functions and algorithmic outputs
Home Automation
- Energy Monitoring: Track power consumption patterns
- Garden Automation: Monitor soil moisture, light levels
- HVAC Control: Visualize temperature and humidity trends
- Security System: Plot motion sensor activities
Robotics and Control
- Robot Navigation: Plot position and orientation data
- Motor Control: Monitor speed, torque, and efficiency
- Sensor Fusion: Combine multiple sensor readings
- Path Planning: Visualize robot movement algorithms
Troubleshooting
Common Issues
1. No data appearing on plot
- Check WiFi connection status
- Verify WebSocket connection in browser console
- Ensure sendPlotData() is being called regularly
- Check Serial Monitor for error messages
2. Plot appears jumpy or erratic
- Implement data filtering (moving average)
- Reduce data sending frequency
- Check for sensor noise or connection issues
- Verify power supply stability
3. Browser performance issues
- Reduce maximum samples (setMaxSamples())
- Lower data transmission rate
- Close other browser tabs
- Use hardware acceleration in browser
4. WebSocket connection drops
- Check WiFi signal strength
- Verify router settings (firewall, port blocking)
- Implement reconnection logic in custom code
- Monitor Arduino memory usage
Debug Tips
Enable Detailed Logging
Test Data Generation
Advanced Features
Custom Data Formatting
Integration with Other WebApps
Real-time Control with Plotting
Next Steps
After mastering the WebPlotter example, explore:
- MultipleWebApps - Combine plotting with control interfaces
- WebMonitor - Add debugging capabilities alongside plotting
- Custom Applications - Build your own specialized plotting tools
- Data Analysis - Implement statistical analysis of plotted data
Support
For additional help:
- Check the API Reference documentation
- Visit DIYables tutorials: https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-diyables-webapps
- Arduino community forums
- WebSocket debugging tools in browser developer console