The Simulation of Artificial Sensory Nerves System to Sense Intestinal Contents with Reflective IR Sensor

Patients who has fecal incontinence suffer physical and mental painfulness because they can neither actively control any forms of defecation nor detect the state of intestinal contents. It is significantly meaningful to study artificial anus sphincter with “artificial sensory nerves”. In this paper, reflective infrared (IR) sensor, with different responses to the solutes, can simulate the sensory nerves to detect intestinal contents to distinguish different solutes according to the voltage values of the different reflective responses to the IR of the solutes. The study meets the requirements as expected because the outcome shows that the voltage signals of different solution differ dramatically which can detect whether there are any intestinal contents and distinguish the states of them. It turns out to be an effective method that the reflective IR sensor can simulate the sensory nerves to sense intestinal contents.


INTRODUCTION
Fecal incontinence is a pathology which jeopardizes human's health [1][2][3]. There have been numerous studies by scholars both in China and aboard trying to recover the anus function so as to control fecal incontinence, such as biofeedback training, pelvic muscle strengthening therapy, sacral nerves electrical stimulation and sphincter reconstruction with autologous tissues, all of which turns out not as ideal as expected for the recovery of anus function. Artificial prosthesis implantation [4,5] to remedy fecal incontinence is the therapy available for those patients whose anus sphincter and its peripheral nerves are entirely damaged hence fecal incontinence thoroughly occurs. Sphincter device, however, can only mechanically control defecation, but cannot sense when to defecate or distinguish the feces states [6,7]. As the intestinal contents can be solid, liquid or gas, the normal human who can sense feces and precisely distinguish the states of intestinal contents and transmit the signal to central nerve which decides whether and how to defecate; for those who are incapable , it is significantly meaningful to study artificial anus sphincter with "artificial sensory nerves".
IR sensor is the device to transform IR radiation signal into electrical signal [8]. In this paper, the measurement is on the basis of IR spectroscopic absorption, which is, the different medium has different IR absorbance ability; therefore the states of intestinal contents can be sensed due to different voltage values, which is transformed from different IR intensity which is reflected; so is how the intelligent system of sensing intestinal contents works, and is the solution of the fecal sensing deficiency for the fecal incontinence patients.

II. SYSTEM DESIGN
According to the uniqueness of artificial anus sphincter with "artificial sensory nerves", it is required to measure the parameters of different intestinal contents process them and distinguish the target ones. According to the design, firstly a frequency-suitable IR sensor with reflective function is used to detect the contents, after the sensor receives the reflected IR in the form of modules, A/D transfer circuit is used to transform it from modules into data, send and process the data with MCU, and eventually display the voltage value on LCD. The system which requires A/D sampling filter circuit, power circuit, crystal oscillation circuit, LCD display circuit and monolithic processing circuit as shown in Figure 1.

III. HOW REFLECTIVE IR SENSOR WORKS
Every gas with IR activity can absorb particular IR radiation of certain frequency, and can have molecular vibration and rotational energy transition when exposed to IR. The particular IR active gas can be distinguished within its absorption band of the 2-25µm middle-IR band, just PAPER THE SIMULATION OF ARTIFICIAL SENSORY NERVES SYSTEM TO SENSE INTESTINAL CONTENTS WITH REFLECTIVE IR… like "fingerprint". IR light will attenuate when transmitting the material under test. The attenuation will be determined by the absorbing optical distance and concentration of the tested material as well. The relation between the three items (namely the IR attenuation, absorbing optical distance and concentration of the tested material) is according to the Law of Lamber-Beer as the following equation.
In the equation, 0 ( ) I ! refers to the intensity of incident light, ( ) I ! refers to the intensity of transmitted Light, L refers to the thickness of the gas layer which the radiation transmits, C refers to the concentration of the tested gas, ( ) k ! refers to absorbance coefficient which is also the function of wavelength ! . The coefficient differs because each gas has different absorbance coefficient. Thus, ( ) E ! , the absorbance of IR radiation of each gas can be expressed as follows: Based on the equation above, the absorbance of IR radiation is basically directly proportional to the thickness of absorption layer, so is the concentration of the absorption material. This is what the Law of Lamber-Beer all about. The Law of Lamber-Beer is the basis of absorption photometry and quantitative measurement, which is widely applied in the absorption measurement in UV light, visible light and IR light. Not for gas only, even and nonscattered light-absorbing substance such as the solution and solid can be measured in the same manner.
Base on the Law, this system adopts a high emitting power infrared photodiode and high sensitivity photoelectric transistor [9]. The MCU controls infrared emitting unit to constantly emit infrared light which the contents are exposed to. As the intestinal contents are different, the effect of IR reflection, absorbance and transmission will differ, so the intensity of IR which is received by the IR receiving unit is different. Based on such difference, the light intensity received by the receiving unit is being magnified, detected, rectified and transformed into the voltage value which will be processed and analyzed, hence detecting the different intestinal contents.
In this paper, a transparent tube is simulated as intestinal canal. Pour different solutions inside this tube, and measure with this system. As the walls of tube can reflect light, a transparent tube with the least reflection is adopted to reduce the detection error as much as possible. IR light will also scatter in solution, but it can be ignored because the accurate value can be obtained through filtering when compared with the reflected IR light. A slight fraction of the IR light will penetrate the transparent tube, but the system detects the reflected IR intensity to identify the solute, which means the penetrated light will not be calculated. The following Figure 2 shows the principle.

IV. DESIGN OF THE HARDWARE CIRCUIT
System circuit can be divided into five major parts: the first part is the power supply circuit which connecting the external stable power supply to power the whole system; the second is the infrared detection circuit which is responsible for infrared emitting and receiving; the third is the MCU which is single-chip processor, responsible for module control, data process and storage; the fourth is the A/D sampling circuit which is to collect the signal samples received by infrared receiving unit and then transfer to the main controller; The last one is the display circuit which display the system the outcome in front of the users

A. Power supply circuit
The USB socket is the external point of power supply, which connects the external USB power to power the circuit. The power supply circuit Diagram is shown in Figure 3.
J2 is the USB port, which connects the USB power; LEDR is the power indicator of light-emitting diodes, followed by 560! current-limiting resistance which is to prevent excessive current to breakdown light-emitting diode; the two capacitors C7 and C8 are filter capacitor for power supply circuit. The two capacitors are connected in parallel at the power output end and make the output voltage smooth when charging and discharging; in the end, the circuit VCC connects to the MCU's Pin 40 to power the entire system through the Pin40.

B. Reflective photoelectric sensor
In this paper, ST188 reflective photoelectric sensor is used as detecting device, which is widely applied in IR detection. The physical structure and circuit diagram are as shown in Figure 4, including a reflection module (lightemitting diode) and a receiving module (phototriode). A and K are the positive and negative electrodes of the IR emitting unit accordingly, C and E are the positive and negative electrodes of the receiving unit accordingly. IR emitting unit can give the signal when A connects the high level, K connects the low level.

C. Main controller circuit
The main controller circuit is composed of clock circuit, reset circuit and MCU. Reset circuit is to recover the circuit back to the initial state. The clock circuit generates timing pulse for MCU, and all operation and control process through MCU is driven by the unified timing pulse. The main controller circuit diagram is as shown in Figure  5.
P1.1-P1.7 ports of MCU are used to control LCD, P0.0-P0.7, P2.7, P3.6, P3.3 and P3.7 ports of MCU are used to control ADC0809, RST terminal is connected to the reset circuit, the clock circuit uses 12MHz crystal oscillation, and other blank ports are reserved for the future expansion of the system.

D. A/D sampling circuit
The A/D converter adopted in this paper is ADC0809 of 8-bit successive approximation CMOS material, which is manufactured by National Company. It has the function of 8-bit simulation input access and joint addressing logic. Eight single-ended simulation signals can be input and converted on the time-sharing basis. It has been widely used in multi-point detection and control. The IN0 of ADC0809 connects the simulation voltage signal output end (C electrode) of ST188, which is shown in the following diagram in Figure 6.

E. LCD circuit
The display circuit designed in this paper is LCD1602, which is used to display the detected voltage data. LCD1602 is an industrial character LCD which can display 16 columns and 2 lines, namely 32 characters, and it is the particular LCD that can display dot matrix such as letters, numbers and symbols. The display circuit is as shown in Figure 7.  Figure 7. Display circuit.
back-light; PIN4-PIN6 of LCD1602 are connected to the PIN1.1-PIN1.3 of MCU accordingly to control the reading and writing of LCD; PIN3 of LCD1602 has a sliding resistance which is used to adjust the display contrast.
F. Schematic diagram of the system Schematic diagram of the system is as shown in Figure  8.  Figure 8. Schematic diagram of the system V. SOFTWARE DESIGN The system program can be divided into IR sampling program module, display module, serial program module, and data processing program module.

A. Infrared sampling module program design
IR sampling program module is to control ADC0809 to collect the output voltage signals from the ST188 infrared sensor. Once the infrared sensor ST188 is connected to the power supply, it can function normally and automatically emit infrared light and receive the reflected infrared one. The code is as follows:

B. Display module program design
The main function of this module is how LCD works and what LCD displays. It is required to display voltage value on LCD as per the design. A field "Value:" is set to display the data measured. There is a dynamic displayed field to show the data measured real-time so as to let the user observe the information of tested objects. First define an unsigned character data variable "Num" and an array "LCD_Num[]". The content of "Num" is sampling data of infrared detection through A/D, "Num/100+48" to get hundreds' digit in ASCII, "Num/10%10+48" gets its ten's digit in ASCII, and "Num%10+48" gets unit's digit in ASCII, then each value in the array of "LCD_Num[]" is on the display in turn, thus completing the display of dynamic data. The number of lines is defined as "Row", the number of columns as "Col", the displayed content as "Text", "Txt_Add" as the address of text. Display flow chart is as shown in Figure 10 where # in string means a pause in this line of output, similar to display line after line; if there is no #, it means display page after page.

C. Data processing program design
In order to improve the anti-interference of the system, the digital filter is adopted in processing the sampling data. Commonly used digital filtering methods are limiting filtering, mean filtering, median filtering, first-order lag filtering, moving average filtering, and anti-impulse interference average filtering. Here the moving average filtering [10] and median filtering [11] are adopted in this system, that is, view the N sample data as a sequence, when sampling, the latest measurement data will be placed at the tail and the head one will be removed at the same time, so the sequence always keeps N sampling data. When calculating, the maximum and minimum values in these N data will be removed, and the average of the remaining ones will be the final outcome. Thus, after digital filtering, SNR out , namely signal-noise-ratio, is expressed as follows: Where N is how many times of measurements, the signal-noise-ratio is obviously improved through the digital filter. Digital filter subroutine code is shown in Figure 11.

VI. TEST AND ANALYSIS OF THE SYSTEM
In order to verify the accuracy of the system, five substances (namely tap water, cough syrup, eyedrops, washing powder solution and air) are test respectively, different data are observed. Tap water and eyedrops are colorless transparent liquid, difficult as it is to test, the test is stable and the outcome values are different with each other; Cough syrup is black liquid with most and varied ingredients, which obtains the least value; the air, due to its purity, obtains the most value. Therefore, the more solutes are in solution, the less the displayed value will be. Based on this, the contents can be distinguished to some extent. The data obtained in the experiment are shown in Table 1.

VII. CONCLUSIONS
Fecal incontinence, with a high incidence rate among the pregnant, the senior people and children, severely impairs the health of human beings. The artificial anus sphincter has brought benefit to the fecal incontinence patients. However, the current artificial anus sphincter lack the function of sensing feces, which imposes physical and mental inconvenience when patients' defecating. Therefore, it is of great significance to study artificial anus sphincter to sense different intestinal contents. Reflective IR sensor is applied to measure the solutes of different states in the container to simulate the function of "artificial sensory nerves" to distinguish the different intestinal contents. The experiment shows that the reflected IR signals of intestinal contents of different states have no "overlapping area", which is to distinguish the contents more precisely. In conclusion, the reflective IR sensor adopted in this paper has the function of "artificial sensory nerves" to distinguish the intestinal contents, which can be one of the effective methods to study "artificial sensory nerves". However, feces differs with different intestines, diet ingredient, and defecation habits, which requires particular reflective IR sensor with particular frequency, power and circuits to obtain meaningful outcome. Further study shall be done on large animals such as human beings on their intestinal contents.