Among various technologies of the smart manufacturing, Internet of Things (IoT) becomes important to collect and exchange data enabling cyber physical system (CPS) and cloud manufacturing [1] . Combined with the smart manufacturing technologies, predictive maintenance (PdM) is growing further and the case studies [2, 3] have shown how industries maintain and improve their production yield. Smart connectivity of IoT devices provides fast and wireless network connection to a huge number of sensors. Therefore, sensors with low power consumption, minimized in size, and affordable costs are frequently used as IoT solutions. However, vibration and acoustic emission sensors for monitoring machines with rotary components such as bearing, gears, and shafts are not suitable for the needs of IoT applications.
Previous research on machine monitoring has utilized various types of sensors such as accelerometers [4] , acoustic emission (AE) sensors [5] , and microphones [6] in order to measure sound and vibration from machines. To construct a feasible monitoring algorithm, these sensors should be selected carefully depending on the applications. Fig. 1 shows various kinds of sensors, the retail price, and the frequency range. Accelerometers measure vibrations at frequencies lower than microphones, and they are robust to external noise by attaching the sensors to the surface of sources. However, the sensors can measure one-directional vibration, and additional conditioning hardware such as preamplifiers and data acquisition software are required. AE sensors have a high frequency range around 100kHz. The sensors are suitable for monitoring machines for cutting processes [7] and bearing degradations inside the machines [8] . However, the target frequency is too high for sound pressures generated from rotary parts in general
Among various technologies of the smart manufacturing, Internet of Things (IoT) becomes important to collect and exchange data enabling cyber physical system (CPS) and cloud manufacturing [1] . Combined with the smart manufacturing technologies, predictive maintenance (PdM) is growing further and the case studies [2, 3] have shown how industries maintain and improve their production yield. Smart connectivity of IoT devices provides fast and wireless network connection to a huge number of sensors. Therefore, sensors with low power consumption, minimized in size, and affordable costs are frequently used as IoT solutions. However, vibration and acoustic emission sensors for monitoring machines with rotary components such as bearing, gears, and shafts are not suitable for the needs of IoT applications.
Previous research on machine monitoring has utilized various types of sensors such as accelerometers [4] , acoustic emission (AE) sensors [5] , and microphones [6] in order to measure sound and vibration from machines. To construct a feasible monitoring algorithm, these sensors should be selected carefully depending on the applications. Fig. 1 shows various kinds of sensors, the retail price, and the frequency range. Accelerometers measure vibrations at frequencies lower than microphones, and they are robust to external noise by attaching the sensors to the surface of sources. However, the sensors can measure one-directional vibration, and additional conditioning hardware such as preamplifiers and data acquisition software are required. AE sensors have a high frequency range around 100kHz. The sensors are suitable for monitoring machines for cutting processes [7] and bearing degradations inside the machines [8] . However, the target frequency is too high for sound pressures generated from rotary parts in general 
Among various technologies of the smart manufacturing, Internet of Things (IoT) becomes important to collect and exchange data enabling cyber physical system (CPS) and cloud manufacturing [1] . Combined with the smart manufacturing technologies, predictive maintenance (PdM) is growing further and the case studies [2, 3] have shown how industries maintain and improve their production yield. Smart connectivity of IoT devices provides fast and wireless network connection to a huge number of sensors. Therefore, sensors with low power consumption, minimized in size, and affordable costs are frequently used as IoT solutions. However, vibration and acoustic emission sensors for monitoring machines with rotary components such as bearing, gears, and shafts are not suitable for the needs of IoT applications.
Previous research on machine monitoring has utilized various types of sensors such as accelerometers [4] , acoustic emission (AE) sensors [5] , and microphones [6] in order to measure sound and vibration from machines. To construct a feasible monitoring algorithm, these sensors should be selected carefully depending on the applications. Fig. 1 shows various kinds of sensors, the retail price, and the frequency range. Accelerometers measure vibrations at frequencies lower than microphones, and they are robust to external noise by attaching the sensors to the surface of sources. However, the sensors can measure one-directional vibration, and additional conditioning hardware such as preamplifiers and data acquisition software are required. AE sensors have a high frequency range around 100kHz. The sensors are suitable for monitoring machines for cutting processes [7] and bearing degradations inside the machines [8] . However, the target frequency is too high for sound pressures generated from rotary parts in general 48th SME North American Manufacturing Research Conference, NAMRC 48 (Cancelled due to COVID-19) machines, and it also requires expensive signal conditioning units.
Microphones mostly cover the audio frequency from 20Hz to 20kHz, which is used to record sounds that humans can hear. Although the price is affordable and no additional conditioning hardware are required for microphones, they receive signals from multiple directions and can be therefore affected by external noise. Several studies using sound pressure as machine health monitoring have been introduced so far. A condensertype microphone is used for monitoring conditions of rolling elements in a bearing [9] . Statistical parameters are evaluated according to different bearing faults from rolling elements and races both in inner and outer sides. However, dealing with external noise is not mentioned in the research. To solve the issue, localization of sounds with multiple microphones have been studied. A spherical array of directional microphones is built to specify a machine from multiple machines [10] . From previous studies, sound signals can be used to estimate machine health, but rejecting external noise is the barrier for collecting sound of target areas.
To overcome the difficulties, a stethoscope is tested as a sensor to hear the internal sound of machines, inspired from doctors diagnosing patients using a stethoscope to hear heart and lung sound from their inner body. It is reported that stethoscopes amplify sound at lower frequency (37.5Hz-112.5Hz) as much as 5dB [11] . They also prevent dispersion of sound intensity through a rubber hose, and earphones at the end of hose blocks external noise [12] . Such characteristics are also beneficial to monitor the internal sound of machines, thereby determining prognosis of machine status are possible.
This paper introduces a stethoscope considering the needs for IoT and its characteristics for monitoring machines discussed earlier. In this paper, a microphone with USB connectivity was attached to a stethoscope to record sound as the WAV format for PC. Sinusoidal chirp method was used to select frequency ranges for measurement. In the experiments, two stethoscopes were attached on the surface of an industrial robot arm, and sound signals were captured during its operation. The signals were converted into time-frequency features by Short-Time Fourier Transform (STFT) to verify noise reduction capability and collision detection. In addition, the spectrograms were used to train Convolutional Neural Network (CNN) model for estimating rotating joint axis.
In this study, an internal sound sensor using a stethoscope is developed. Fig. 2 illustrates the sensor assembly. A USB microphone is inserted into a rubber hose attached to the stethoscope, and it collects sound using recording programs in PC. The sensor is attached to the target surface using tapes around it to reduce intrusion of external noise. The total cost ranges around $100, which is affordable for sound sensors. Since the target measurement frequency ranges are different between the stethoscope (500Hz) and the microphone (48kHz), a transfer function of the system ( ) h t was derived using the swept-sine technique to provide a wide-band, deterministic, and periodic input signal [13] assuming that the stethoscope 
where ( ) y t is the output response of a varying-frequency sinusoidal sweep function ( ) f t . It is described as
where T is the recording time. 1  and 2  were selected as 20Hz and 1900Hz, respectively. Fig. 3 shows the function ( ) f t and its STFT spectrogram. It was played by Bluetooth speaker while the stethoscope unit was attached, and the response ( ) y t was recorded for 15 seconds. y t . From the responses, 250Hz was the frequency where the magnitude crosses at -50dB. Therefore, the maximum frequency of interest was selected as 255Hz of the STFT spectrograms. The number was also designed for two consecutive half divisions of an input feature which is a column of the spectrograms with the length of 256 (0~255Hz with 1Hz interval). Therefore, two hidden layers of the CNN can divide the features twice by half with no remainders. 
where ( ) est h t is the calculated ( ) h t from Eq. 1. As shown in Fig. 5 , error values around 15 seconds (1900Hz) are higher than the error for the rest of the time. However, the errors in those periods are negligible since the frequency range was narrowed down to 255Hz which accounts from 0 to 3 seconds. Mean reconstruction errors at the interval are 0.0003 and 0.0009, respectively. Therefore, the selection of the frequency range is reliable, and STFT spectrogram in the range is selected for experiments in the study. 
Extracting meaningful features from sound is important to estimate machine status, which leads to Prognostics and Health Management (PHM) of machinery systems. Commonly used algorithms of feature extractions are time domain analysis, frequency domain analysis (Fourier transform, wavelet transform, Hilbert-Huang transform), Principal Component Analysis, to name a few [14] .
Time domain statistical parameters such as mean, RMS, and Kurtosis quantize differences of the signal and detect anomaly status, while the vibration frequency of rotating components is clearly seen by frequency domain methods. Therefore, multiresolution approaches such as STFT and Wavelet analysis enable to observe signals both in time and frequency domain. The feature extraction methods have their own advantages and disadvantages [14] . Therefore, a method should be chosen for the needs of each application.
In addition, handling the sensor data for monitoring problem has been incorporated with Artificial Intelligence (AI) techniques, and it has become popular recently for estimating machine conditions autonomously. Neural Network (NN) is one of the AI-based data processing methods, which can be utilized for classification of bearing defects [15] and prediction of machine status [16] .
In the paper, the sound signals were analyzed in time domain to observe the impact when the robot was stopped. Next, in order to detect collisions when the robot moves, the part of the STFT spectrogram were extracted and analyzed because the moment of impact is not clearly seen with time domain analysis. For training and testing a CNN model, the STFT spectrograms were used as 2D input features.
The experimental setup is illustrated in Fig. 6 . Two stethoscope units (Littmann-Classic II, 3M) were attached both on the base area near the axis #2 and wrist area at the top of the link #4 of a 6-axis industrial robot (KR6 R700, KUKA). Sound signals were recorded as WAV file format by Windows application coded with C#. Each sound signal was recorded as a 48kHz 24bit stereo format. The program also collected angles and torques of six joints in the robot using the MTConnect framework, which enables integrated collection of sound files with the machine data. The raw sound data was then analyzed, and features were extracted as STFT spectrograms using Matlab software. The STFT result has 0~24kHz frequency range, and it is cropped to 0 ~ 255 Hz. In the STFT procedure, 48000-length Hann window in 50% overlap was applied. Another experiment was performed to estimate a rotating joint axis using the CNN model. Sounds from two stethoscopes were recorded while each joint axis was rotated by a teaching pendant. 40 sound files were recorded for each axis, and 600 STFT components were used for training and testing the CNN model. The lengths of the sound files range from 40 to 150 seconds depending on the range of angles that each axis can rotate.
To verify noise reduction capability of the sensor, a noise sound recorded from the factory was played using a Bluetooth speaker while the stethoscope records the sounds when the robot was rotated. The machine sound was generated by concatenation of randomly chosen sound among hammering, machining, riveting, and steel milling. The starting point of the part was also randomly selected. The volume was set around 80dB similar to a vacuum cleaner or average factory environment. Fig. 7 depicts a waveform of the noise sound signal and its STFT spectrogram indicating that the noise has amplitude between 0 and 255Hz range. When each axis of the robot was moving with or without the external noise, two recorded sound files are compared as in Fig.  8 . It illustrates that the patterns at the both cases are similar, and there is no significant difference when the noise is intervened, validating that the stethoscope sensor is robust to noise.
To verify the capability of the sensors, impacts were applied to the robot when it was stationary. The locations of the sensors and impacts using a rubber hammer are illustrated in Fig. 9(a) . Five impacts were consecutively applied for each location. Fig.  10 shows the recorded sounds of two stethoscopes at the axis #3, which depicts that impacts are clearly indicated. The amount of impacts are irregular, however the impact response at the wrist shows higher amplitude than one at the base. Impacts on various locations are compared in Fig. 11 . The sound signals at the impact were cropped, and its root mean square (RMS) values were calculated. The RMS of the stethoscope at the base is lower than the one at the wrist for all the cases, because the sensor on the base was firmly linked to an optical table while the one at the wrist is prone to vibrations because it connects three links (link #1,2,3) at the bottom and three other links (link #4,5,6) at the top. For the similar reason, variation of impacts at the wrist is higher than the one at the base. Furthermore, sounds at the impact of the axis #2 and the end effector shows higher level of RMS and variation than the other cases. The impact at the axis #2 is explained that it is the closest location from the sensor at the wrist. Another impact on the end-effector also causes more vibration than other locations which are close to the center of the robot base. 
From the result of the impact in the previous section, the capability to catch collisions during robot operation was verified. Fig. 9 (b) illustrates the moment of the collision. The robot repeated moving between two points while the author touched the robot by hand. During the operation, the robot used all the six joints, therefore sound signals have the mixed sounds of the simultaneous rotation of the joints. Fig. 12 shows the spectrograms of sounds from the two stethoscopes. The collision happened at 4.4, 8.6, 13.9, and 18.7 seconds. Distinctive vertical lines at the collision moments were shown, and it ranges from -80dB to -50dB. Fig. 13(a) shows the recorded sound signals from the stethoscopes. The instants of collisions are indicated but not clearly distinctive with the sounds generated at the robot movement. To extract collision features from the sound recordings, STFT results between 35.16Hz and 70.31Hz were selected, and the frequency component at the time was added together. Fig. 13(b) indicates the calculated results, showing peaks at the collision moments. It is anticipated to monitor collisions during operation, however delays for signal processing and calculation may induce delays to detect the collisions. 
In the study, a Neural Network (NN) model is introduced to estimate which joint axis is moving. Among various neural network models, CNN is selected to train the neural network model from STFT spectrograms, which is similar to the image classification applications using CNNs [17] . Fig. 14 shows a procedure of preparing input data for training and testing the CNN. For each sound data with certain time length, STFT was performed to generate a spectrogram. The length of the input data is 256. Fig. 15 illustrates a structure of the CNN. Based on the feature extraction process in Fig. 14, the CNN model accepts an input size of 256. Two hidden layers were designed in CNN, and their structural attributes are described in table 1. Two hidden layers compress the input feature by half for each step. The numbers of filters are chosen as 32 and 64, respectively. Therefore, the 2 nd hidden layer has a square output (64×64). Values of the weight arrays started with uniformly distributed random values, then are converged at the end of the training stage. The decision layer is designed to find a single moving axis among the six joints axis of the robot. In the training session of the CNN, the Adam optimizer [18] was employed with a learning rate 0.0005, and a ReLU function was utilized as activation. After training the CNN with 3000 (500 signal data from each axis) training data set, the prediction accuracy was measured with 600 (100 signal data from each axis) testing data set. As a result, the signals from the stethoscope #1 and #2 were matched to the joint number with 90.67% and 90.83% accuracies, respectively. Detailed prediction results are summarized in Fig. 16 .
As shown in Fig. 16 , the accuracy increases when the sensor is close to the target source. The stethoscope #1 (base) shows better performance than the stethoscope #2 (wrist) when predicting the axis #1 and #2. On the other hand, the stethoscope #2 (wrist) has the higher accuracy in predicting the axis #3 and #4. However, both stethoscopes have the lowest prediction accuracy for the axis #5 and #6 because of their distance from the sensors. Furthermore, the model shows the prediction accuracy of 90% with the limited number of datasets. Although the difference between spectrogram patterns are distinctive as in Fig. 8 , more datasets are required to validate the CNN model. Another limitation of this result is that further tuning of the CNN model is required such as increasing the number of hidden layers and adjusting filter parameters. 
In this paper, an internal sound sensor using a stethoscope and a microphone is developed, providing an alternative as an IoT solution of rotary machine monitoring. The detailed conclusions are described in below.
 System identification of the sensor using the swept-sine technique was performed to select the measurement frequency range of the sensor, and the range from 0Hz to 255Hz of the STFT spectrograms was used for the experiments.  STFT spectrograms shows noise reduction capability of the sensor, expecting the use of the sensor in noisy factory environments.  Impact tests shows that location of the sensor is related to the sensitivity of vibration measurement. Furthermore, collisions between robot and human hand were identified from the STFT spectrogram analysis.  A single rotating joint axis was predicted using the CNN model, showing 91% accuracy. The result also shows that the distance of the sensor from a target source is the factor of the prediction accuracy.
Stethoscopes may provide a solution as machine monitoring sensors which is robust from external noise. It is anticipated that more applications about predicting the life of rotary machines using the sensors would be introduced. Further study will focus on studying the effect of the robot structure on the internal sound sensor and improving the accuracy of the CNN models.