Leading manufacturers are quietly saving thousands, sometimes millions, of dollars annually with a quality control method that's been proven since the 1920s. The difference today? Modern tools make it simple to implement.
Consider this real example: A manufacturer shared on Practical Machinist forum that they process 400,000 parts per year with a 4% scrap rate. That's 16,000 parts discarded annually. At even a conservative $10 per part, this represents $160,000 in direct losses from a single production line. They accepted this as normal because industry reports confirm 4-5% scrap rates are standard.
What separates industry leaders from the rest? They refuse to accept "normal" waste. Using Statistical Process Control (SPC), they detect problems as they occur, not after producing defective parts. When a process begins drifting, they receive immediate alerts and correct it before generating scrap.
This guide shows you exactly how to build a real-time SPC system using FlowFuse. You'll create a live dashboard that tracks measurements and alerts operators the moment something goes wrong. No statistics degree needed, just practical steps you can implement today.
Why Traditional Quality Control Falls Short
Most manufacturers still rely on end-of-line inspection. Make parts, check parts, scrap the bad ones. This reactive approach creates three expensive problems:
Problem 1: You're always too late
When inspection finds a defect, you've already invested in material, machine time, labor, and energy. That investment is now scrap. Worse, how many parts did you make between when the problem started and when you caught it?
Problem 2: The borderline parts you miss
Not all defects are obvious. Parts that barely pass inspection today might fail in the field tomorrow. These marginal parts slip through because traditional inspection only catches clear failures, not process degradation.
Problem 3: No insight into root causes
Finding bad parts tells you nothing about why they're bad. Was it temperature drift? Tool wear? Material variation? Without process data, you're guessing at solutions.
The Proactive Alternative: Statistical Process Control
SPC flips the entire approach. Instead of checking parts after production, it monitors your process during production. The NIST Engineering Statistics Handbook explains it simply:
"The underlying concept of statistical process control is based on a comparison of what is happening today with what happened previously."
When your process starts to drift from its normal behavior, SPC alerts you immediately. You fix the issue before making defective parts, not after.
Walter Shewhart developed this method at Bell Labs in the 1920s, proving its effectiveness across industries. Today, FlowFuse makes it accessible to any manufacturer, regardless of size or technical expertise.
Building Your First SPC System with FlowFuse
Let's build a real example. This guide shows you how to create a SPC control chart for individual measurements - perfect for monitoring critical dimensions in real-time.
First, open your FlowFuse Node-RED instance. If you don't have one yet, you can sign up for a free account and have an instance running in minutes.
What We're Building
A real-time SPC control chart that monitors individual measurements and automatically calculates control limits. Perfect for scenarios where you measure one part at a time - like bearing dimensions on a CNC line. When measurements drift outside the calculated limits, you'll know instantly.
Step 1: Get Your Tools Ready
First, we need two nodes for SPC monitoring.
Open FlowFuse's palette manager (hamburger menu → Manage palette)
Go to the Install tab
Search for and install these nodes:
node-red-contrib-simple-spc - This is your statistics engine
@flowfuse/node-red-dashboard - For that slick real-time chart
Click Install for each node and wait for completion
Step 2: Simulate Your Machine Data
In production, you'd connect to your PLC. For now, let's simulate a bearing measurement around 10mm nominal.
Drag an inject node onto your canvas. This is your "sensor."
Double-click it and set:
Repeat: interval → 2 seconds (mimics real sensor timing)
Payload: switch to JSONata mode and enter: $random() * 0.2 + 10
This generates readings like 10.05, 9.98, 10.11 - realistic variation around 10mm.
Step 3: Add the Statistical Brain
Find the spc node in your palette (it'll be under "function" category after install).
Drag it over and wire your inject node to it.
Double-click to configure:
Control Limit Multiplier: 3 (for 3-sigma limits)
Timer: 10 (seconds before alerting out-of-control)
Once configured, the node outputs an object like this:
{ value:10.020214950604476,// Current measurement avg:10.089877376434453,// Running average ucl:10.344067494423967,// Upper control limit lcl:9.835687258444938,// Lower control limit outOfControl:false// Alert status }
Step 4: Make the Data Chart-Ready
Charts need data in a specific format. Add a change node between SPC and your chart.
Drag a change node onto the canvas
Wire it between the SPC node and where your chart will go
Double-click to configure and set one rule: Set msg.payload to this JSONata expression:
Control limits catch obvious problems. But subtle issues need pattern recognition. Here are the four rules that catch 95% of real problems:
Rule 1: Any point outside limits
This one is fairly obvious: If a measurement point falls outside of the established upper or lower limits, something is wrong.
Rule 2: Seven points on one side
Seven consecutive points above or below the center line means your process has shifted. Maybe a new material lot, maybe tool wear.
Rule 3: Seven points trending
Seven points in a row going up or down. Classic sign of tool wear or temperature drift.
Rule 4: Repeating and Cyclical Patterns
This rule is for recurring behaviors that the other rules miss. Cycles that repeat over time, like a regular pattern that appears at the start of every shift change or every Monday. Speak with your operators, they will likely know what these mean.
Here's how to implement these rules in FlowFuse:
Drag a Function node onto the workspace and add the following JavaScript code to it.
Replace switch node with this Function node.
Deploy the flow.
const buffer = context.get('measurements')||[]; const current = msg.payload;
// Rule 1: Out-of-control point (handled by SPC node) if(msg.payload.outOfControl){ msg.payload ="⚠️ PROCESS OUT OF CONTROL – CHECK MACHINE!"; return msg; }
// Store the current measurement buffer.push({ value: current.value, avg: current.avg, timestamp:newDate() });
// Keep only the last 20 measurements if(buffer.length >20){ buffer.shift(); } context.set('measurements', buffer);
// Initialize alert message let alertMessage ="✓ Process Stable";
// Check rules if we have enough data if(buffer.length >=7){ const recent = buffer.slice(-7); const values = recent.map(r=> r.value);
// Rule 2: Seven points on one side of the center line const allAbove = values.every(v=> v > current.avg); const allBelow = values.every(v=> v < current.avg); if(allAbove || allBelow){ alertMessage ="⚠️ Process shift detected – 7 points on one side of center"; }
// Rule 3: Seven points trending up or down let trending =true; const increasing = values[1]> values[0]; for(let i =2; i < values.length; i++){ if((increasing && values[i]<= values[i -1])|| (!increasing && values[i]>= values[i -1])){ trending =false; break; } } if(trending){ alertMessage = increasing ?"⚠️ Increasing trend – check for tool wear" :"⚠️ Decreasing trend – check material quality"; } }
msg.payload = alertMessage; return msg;
The following image demonstrates the advanced alerting system in action, detecting specific patterns beyond simple control limit violations:
Real-time SPC monitoring detecting process drift and triggering appropriate alerts based on trend analysis
Connecting to Real Equipment
Time to connect your actual machines. The approach depends on what equipment you have.
For modern PLCs - anything from the last decade like Siemens S7-1200/1500, Allen-Bradley ControlLogix, or Omron NX - you'll use OPC UA. It's already built into these PLCs. Enable it in the configuration, install node-red-contrib-opcua from the FlowFuse palette, and point it at your PLC. The endpoint looks like opc.tcp://192.168.1.100:4840. Browse for your measurement tags and connect them to your SPC flow. Full OPC UA guide here.
Older equipment speaks Modbus TCP. Check your manual's appendix for the register map. Install node-red-contrib-modbus, configure it with your device's IP address and the register holding your measurement (like 40001 for holding registers). Almost every industrial device from the last 30 years supports this. Modbus tutorial here.
For everything else, get creative. Old gauges with RS-232 ports work fine with a USB adapter and the serial node - see our serial port guide. Machines that dump CSV files can be monitored with the watch node. Manual measurements need just a simple dashboard form, one input field, one submit button. Don't overcomplicate it.
Before connecting to SPC, always test with inject → protocol node → debug to make sure data flows. Once you see measurements in the debug panel, wire it to your SPC node and you're monitoring real processes.
The Money You're Leaving on the Table
Remember that manufacturer from the forum processing 400,000 parts annually with a 4% scrap rate? That's 16,000 parts straight to the trash. At just $10 per part, that's $160,000 in annual waste. Cut that rate to 2% with SPC and you save $80,000 yearly.
But here's what most people miss - the $10 part cost is just the beginning. Consider what every defective part also burned through:
Machine time: Say 3 minutes at $200/hour = another $10 gone
Labor: About 15 minutes handling the defect at $30/hour = $7.50 more
Materials: The raw stock you'll never get back
That "$10 part" actually cost you around $27.50 to scrap. Those 16,000 defects? Try $440,000 in real losses.
SPC attacks all of this simultaneously. When your process stays in control, you're not just saving parts - you're saving machine capacity, labor hours, and materials. Plus stable processes need less inspection, letting you redeploy quality staff to improvement projects instead of firefighting.
Quick ROI calculation: Take your annual defect count, multiply by your true cost per defect (part + machine + labor), then multiply by 0.5 for a conservative estimate. That's your yearly savings potential with SPC. Most manufacturers see payback in under 3 months.
SPC works. It's not magic, it's not complicated, and it doesn't have to be expensive. It's just math applied to manufacturing data in real-time.
The tools exist. Node-RED gets you started, but FlowFuse keeps you running in production. With built-in high availability, your SPC charts stay live even if a server fails. Multiple engineers can work on the same flows without conflicts. Deploy updates to 50 production lines with one click. When downtime costs thousands per hour, you need a platform built for manufacturing.
Start Preventing Defects Today
Every day without SPC is money left on the table. Those 16,000 scrapped parts per year? The warranty claims from undetected drift? All preventable.
Follow this tutorial - Build your first SPC chart today
Connect one machine - Start with your most critical measurement
Expand gradually - Add more parameters as you prove value
Don't wait for the perfect plan. Don't form another committee. Pick one measurement that matters and start monitoring it today. Need help getting started? Book a demo to discuss your specific requirements or contact our team for enterprise deployment guidance.
Because somewhere right now, one of your machines is drifting out of spec. The only question is whether you'll catch it in time.
How long does it take to implement SPC with FlowFuse?
Using FlowFuse you can have a basic SPC system monitoring within an hour
Do I need statistical knowledge to use FlowFuse for SPC?
No. In FlowFuse, the SPC nodes handle the statistics. You just need to know what measurements matter for your process.
How much can I save with SPC?
Depends on your scrap rate and volume. Our example shows $160,000 annual savings from reducing scrap from 4% to 2%.
Can I deploy to multiple production lines?
Yes. FlowFuse's DevOps tools let you deploy to multiple lines with one click and manage them centrally.
Which control chart should I use in FlowFuse?
Start with control charts for individual measurements using node-red-contrib-simple-spc. For grouped samples or pass/fail data, additional nodes may be required.
About the Author
Sumit Shinde
Technical Writer
Sumit is a Technical Writer at FlowFuse who helps engineers adopt Node-RED for industrial automation projects. He has authored over 100 articles covering industrial protocols (OPC UA, MQTT, Modbus), Unified Namespace architectures, and practical manufacturing solutions. Through his writing, he makes complex industrial concepts accessible, helping teams connect legacy equipment, build real-time dashboards, and implement Industry 4.0 strategies.
About the Author
Steve McLaughlin
Senior Software Developer
Steve is a Senior Software Engineer at FlowFuse. Prior to joining FlowFuse, he worked as an Engineer in the Automotive Industry and has extensive production environment experience. Steve is also a Node-RED core contributor and has written several popular contribution nodes for Node-RED including drivers for communicating with PLC Hardware