Use A Current Sensor to Efficiently Acquire Data for Predictive Maintenance with AI

By Clive "Max" Maxfield

Contributed By Digi-Key's North American Editors

The Internet of Things (IoT) has brought about tremendous interest in using artificial intelligence (AI) and machine learning (ML) technologies to monitor the health of machines including motors, generators, and pumps, and to alert maintenance engineers as to any looming problems. One difficulty for the designers of AI/ML systems looking to implement this type of predictive maintenance is selecting the best sensor for the application. Another issue is that relatively few designers have any experience creating AI/ML applications.

To obtain the data for the AI/ML system to act upon, designers often opt for sophisticated sensors like three-axis accelerometers coupled with high-powered microcontroller development platforms. In many cases, however, it’s possible to achieve the desired goal using a simple current sensor in conjunction with a more modest and less costly microcontroller development platform.

This article introduces the idea of using a current sense transformer to obtain the data required to simply and cost-effectively implement AI/ML applications. Using a low-cost Arduino IoT microcontroller development platform and a current sense transformer from CR Magnetics, the article also presents a simple circuit that employs the current sensor to monitor the health of a vacuum pump with an integrated filter, alerting the user when the filter has become clogged. Finally, the article presents an overview of the process of creating the associated AI/ML application.

Simple sensors for AI/ML

In order to acquire the data for an AI/ML application to act upon, designers often opt for sophisticated sensors like three-axis accelerometers; but this type of sensor can generate vast amounts of data that are difficult to manipulate and understand. To avoid this complexity, it’s worth remembering that everything is interrelated. Just as an injury to one part of a person’s body can cause referred pain that is perceived elsewhere in the body, a failing bearing in a motor can modify the current being used to drive that motor. Similarly, in addition to causing overheating, a blocked air intake can also modify the current being used to drive the motor.

Consequently, monitoring one aspect of a machine’s operation may cast light on other facets of its workings. As a result, it’s possible to achieve the desired monitoring and sensing goal by observing a related parameter using a substantially simpler sensor, such as the low-cost, small-size, CR3111-3000 split-core current sense transformer from CR Magnetics (Figure 1).

Image of CR Magnetics CR3111-3000 split-core current sense transformerFigure 1: The CR3111-3000 split-core current sense transformer provides a low-cost, easy-to-use current detector that can be employed as the primary sensor in an AI/ML predictive maintenance application. (Image source: CR Magnetics)

The CR3111-3000 can be used to detect current up to 100 amperes (A) (other members of the CR31xx family can be employed for lessor or greater current values). All members of the family support a frequency range of 20 hertz (Hz) to 1 kilohertz (kHz), covering the majority of industrial applications. Also, all CR31xx devices employ a hinge and locking snap that allows them to be attached without interrupting the current carrying wire.

The Arduino Nano 33 IoT

One example of a low-cost microcontroller development platform suitable for prototyping simple AI/ML applications is the ABX00032 Arduino Nano 33 IoT from Arduino (Figure 2). Featuring an Arm® Cortex®-M0+ 32-bit ATSAMD21G18A processor running at 48 megahertz (MHz) with 256 kilobytes (Kbytes) of flash memory and 32 Kbytes of SRAM, the Arduino Nano 33 IoT also comes equipped with both Wi-Fi and Bluetooth connectivity.

Image of Arduino ABX00032 Nano 33 IoTFigure 2: The Arduino ABX00032 Nano 33 IoT provides a low-cost platform upon which to build AI/ML applications to enhance existing devices (and create new ones) to be part of the IoT. (Image source: Arduino)

Data capture circuit

The circuit used for the purpose of this discussion is shown below in Figure 3. The CR3111-3000 transforms the measured current driving the machine into a much smaller one using a 1000:1 ratio.

Diagram of circuit used to convert the outputFigure 3: The circuit used to convert the output from the CR3111-3000 into a form that can be used by the Arduino Nano 33 IoT with its 3.3 volt inputs. (Image source: Max Maxfield)

Resistor R3, which is connected across the CR3111-3000’s secondary (output) coil, acts as a burden resistor, producing an output voltage proportional to the resistor value, based on the amount of current flowing through it.

Resistors R1 and R2 act as a voltage divider, forming a “virtual ground” with a value of 1.65 volts. This allows the values from the CR111-3000 to swing positive and negative and still not hit a rail, since the microcontroller cannot accept negative voltages. Capacitor C1 forms part of an RC noise filter that reduces noise from the 3.3 volt supply and nearby stray fields from getting into the measurements, thereby helping the voltage divider act as a better ground.

A vacuum pump with an integrated filter was used to provide a demonstration test bench. For the purposes of this prototype, Tripp Lite’s P006-001 1 foot (ft.) extension power cord was inserted between the power supply and the vacuum pump (Figure 4).

Image of 1-foot extension power cordFigure 4: The 1-foot extension power cord that was modified to accept the current sensor. (Image source: Max Maxfield)

The prototype circuit was implemented using components from the author’s treasure chest of spare parts (Figure 5). Readily available equivalents would be as follows:

Image of prototype circuit was implemented using a small breadboardFigure 5: The prototype circuit was implemented using a small breadboard and components from the author’s treasure chest of spare parts. (Image source: Max Maxfield)

With regard to the leads from the current sensor, 1931 22-28 AWG crimp pins from Pololu Corp. were crimped on the ends. These pins were subsequently inserted into a 1904 5 x 1 black rectangular housing with a 0.1 inch (in.) (2.54 millimeter (mm)) pitch, also from Pololu.

Creating the AI/ML application

In order to create the AI/ML application, a free trial version of NanoEdge AI Studio was accessed from Cartesium’s website (see also, “Easily Bring Artificial Intelligence to Any Industrial System”).

When NanoEdge AI Studio is launched, the user is invited to create and name a new project. The user is then queried as to the processor being used (an Arm Cortex-M0+ in the case of the Arduino Nano 33 IoT development board), the type(s) of sensor being used (a current sensor in this case), and the maximum amount of memory that is to be devoted to this AI/ML model (6 Kbytes was selected for this demonstration).

In order to create the AI/ML model, it is first necessary to capture representative samples of good and bad data (Figure 6). A simple Arduino sketch (program) was created to read values from the current sensor. This data can be directly loaded into NanoEdge AI Studio “on-the-fly” from the microcontroller’s USB port. Alternatively, the data can be captured into a text file, edited (to remove spurious samples at the beginning and end of the run), and then loaded into NanoEdge AI Studio.

Diagram of comparison of good/normal data (top) and bad/abnormal data (bottom)Figure 6: Comparison of good/normal data (top) and bad/abnormal data (bottom). Apart from the differences in color, these don’t seem terribly different to the human eye, but an appropriate AI/ML model can distinguish between them. (Image source: Max Maxfield)

The good data was collected with the vacuum pump running in its normal mode. In order to gather the bad data, the pump’s air filter was obstructed with a disk of paper.

Using the good and bad data, NanoEdge AI Studio generates the best AI/ML library solution out of 500 million possible combinations. Its ongoing progress is displayed in a variety of different ways, including a scatter chart showing how well the normal signals (blue) are being distinguished from the abnormal signals (red) with regard to a threshold value, which was set to 90% in this example (Figure 7).

Graph of NanoEdge AI Studio evaluates up to 500 million different AI/ML models (click to enlarge)Figure 7: NanoEdge AI Studio evaluates up to 500 million different AI/ML models to determine the optimal configuration for the normal and abnormal data. The initial models are rarely successful (top), but the tool automatically iterates on better and better solutions until the developer decides to call a halt (bottom). (Image source: Max Maxfield)

The early models typically find it difficult to distinguish between the normal and abnormal data, but the system evaluates different combinations of algorithmic elements, iterating on increasingly accurate solutions. In this case, the process was halted after 58,252 libraries had been evaluated. The resulting library (model) was only 2 Kbytes in size.

It’s important to note that, at this stage, the model is in its untrained form. Many different factors may affect the ways in which the machines run. For example, two seemingly identical vacuum pumps could be mounted in different locations—for example, one on a concrete slab and the other on a suspended floor. Or one of the machines could be located in a hot, humid environment, while the other may be in a cold, dry setting. Furthermore, one could be connected to long lengths of metal pipe, while the other could be attached to short lengths of plastic pipe.

Thus, the next step is to incorporate the library into the applications running on the microcontrollers and sensors that are attached to machines that are deployed in the real world. The AI/ML models on the different machines will then train themselves using good data from these real-world installations. Following this self-training period, the AI/ML models can be left to monitor the health of the machines, looking for anomalies and trends, and reporting their findings and predictions to human supervisors.

Conclusion

Predictive maintenance using AI/ML allows engineers to address problems before failures actually occur. However, the hardware used to implement the predictive maintenance system needs to be as simple and cost-effective as possible; also, designers need ready access to the required software to perform the analysis.

As shown, instead of opting for a complex multi-axis accelerometer and associated hardware, a simple, low-cost, small-size, CR3111-3000 split-core current transformer connected to a low-cost microcontroller platform can perform the required sensing and data gathering. Coupled with advances in AI/ML tools and algorithms, it’s now possible for non-AI/ML experts to create sophisticated AI/ML models that can be deployed in a wide range of simple and complex sensing applications.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this author

Clive "Max" Maxfield

Clive "Max" Maxfield received his BSc in Control Engineering in 1980 from Sheffield Hallam University, England and began his career as a designer of central processing units (CPUs) for mainframe computers. Over the years, Max has designed everything from silicon chips to circuit boards and from brainwave amplifiers to steampunk Prognostication Engines (don't ask). He has also been at the forefront of Electronic Design Automation (EDA) for more than 30 years.

Max is the author and/or co-author of a number of books, including Designus Maximus Unleashed (banned in Alabama), Bebop to the Boolean Boogie (An Unconventional Guide to Electronics), EDA: Where Electronics Begins, FPGAs: Instant Access, and How Computers Do Math. Check out his “Max’s Cool Beans” blog.

About this publisher

Digi-Key's North American Editors