1 Introduction

Gastrointestinal bleeding is a common clinical symptom, with 4 to 5 million patients worldwide receiving hemostatic treatment every year, a serious threat to people’s health (Peery et al. 2015; Strate and Gralnek 2016; Kamboj et al. 2019). Its clinical manifestations are dizziness, cold sweat, hematemesis, hematochezia (Chen and Freeman 2011); severe cases can cause shock and even death (Sun et al. 2006; Monteiro et al. 2016). There is no ideal method for the diagnosis and treatment of gastrointestinal bleeding, especially the lesion located in the middle part of the digestive tract with complex structure, away from the mouth and anus, which has become a difficulty in clinical diagnosis and treatment (Hawkey et al. 2001; Ohmiya et al. 2007; Veauthier and Hornecker 2018).

For the diagnosis of intestinal bleeding, conventional detection methods, such as radionuclide scanning (Sheba et al. 2017; Su et al. 2018), digital subtraction angiography (Liu et al. 2016, Obayashi et al. 2017), endoscope (Pandey et al. 2016), etc., bring pains to patients. These methods rely on the judgement of doctors in most cases and have a strong dependence on physicians. As a new detection method for intestinal bleeding, capsule endoscopy reduces the pain of patients (Amornsawadwattana et al. 2016; Qian et al. 2018), but has complicated supporting equipment and high testing cost. It is expected for doctor to read a lot of images (8 h about 60000 images) for the determination of the bleeding lesions (Li and Meng 2009a, b). Visual fatigue caused by long-term work may miss the bleeding site, and the diagnosis result is no bleeding (Pan and Wang 2012). Hong-ying Liu et al. put forward a remote-controlled capsule to detect gastrointestinal bleeding through directly observing intestinal juice on a smear platform (Liu et al. 2010). However, when light bleeding, the color of intestinal fluid will be very light or almost no color, so that direct observation of intestinal fluid may cause missed detection of trace bleeding. Guozheng Yan et al. (Shi et al. 2007) proposed a method for detecting gastrointestinal bleeding using a hemoglobin sensor, which can detect hemoglobin concentration in the gastrointestinal tract and send data to the outside. The electrode of hemoglobin sensor needs to contact with gastrointestinal contents, and is vulnerable to fouling by the gastrointestinal contents, so that the sensor detection results are unstable.

For the treatment of intestinal bleeding, endoscopic hemostatic surgery (Jacques et al. 2014; Yang and Pan 2014) (high-frequency electrocoagulation, laser, freezing, etc.) and laparotomy (Ba et al. 2006) are still the main methods and are relatively traumatic. Local spraying under endoscope (Jao et al. 2004) is suitable for the treatment of bleeding in the superficial lesion area, which cannot go deep into the small intestine and often requires multiple treatments. Repeated insertion of endoscope will damage patient’s intestinal tract and easily cause complications. Remote-controlled drug release capsules have been studied, such as Intestine TM capsule developed by Innovative Devices of the United States and Enterion TM capsule developed by Phaeton Research of the United Kingdom (Scott and Enns 2015). However, the existing remote-controlled drug release capsules are mainly used for human drug absorption and new drug research. We have not found any reports about remote-controlled drug release capsules be used in clinical treatment. Moreover, the positioning technology of these capsules for drug release is not mature enough. Inaccurate positioning, high cost of positioning and high radiation in vitro localization is not good for patient’s health. These capsules cannot release drug completely and actively with low completion rate of drug release.

In view of the existing problems in the diagnosis and treatment of intestinal bleeding, based on the previous study of our group, this paper proposed an intelligent intestinal bleeding diagnosis and treatment capsule (IBDTC) system based on color recognition. The capsule can identify the site of intestinal bleeding without doctor intervention, and when identifying the bleeding site, it will automatically trigger the drug release to the bleeding site and send alarm signal to the outside of the body, which is non-invasive, painless, no cross-infection, independent of doctors, low cost, and no need for in vitro operation and positioning, achieving intelligent drug release in the true sense.

2 Material and method

2.1 Structure of capsule system

The IBDTC system, structure shown in Fig. 1, includes IBDTC and external device. The IBDTC contains bleeding diagnosis module, micro-controller, wireless transmitter, drug release module, power management module and button batteries, and external device contains a receiver and alarm. Bleeding diagnosis module is used to collect bleeding information. Micro-controller determines whether there is bleeding, triggers wireless transmitter to emit bleeding alarm signal to the outside of body and triggers drug release module to release drug. When external receiver receives the alarm signal, the alarm will emit sound and light to notify medical staff. Figure 2 shows the IBDTC we have implemented and characterized in 3D exploded form.

Fig. 1
figure 1

Functional block diagram of IBDTC system

Fig. 2
figure 2

Exploded 3D view of the IBDTC

2.2 IBDTC capsule

2.2.1 Bleeding diagnosis module and micro-controller

Whether the bleeding diagnosis module can effectively and accurately identify color information determines the feasibility of entire IBDTC system. Under normal circumstances, the color of the digestive liquid in the intestine is colorless. If intestine bleeding, there must be outflow of blood in the intestine. There is a certain difference between the colors of intestinal fluid with bleeding and without bleeding, the more blood mixed, the more obvious the red color is. The bleeding diagnosis module collects color information of intestinal fluid, extracts characteristic parameters corresponding to intestinal fluid, detects intestinal bleeding according to the difference between color characteristic parameters of bleeding and non-bleeding intestinal fluid.

Figure 3 shows the schematic diagram of the intestinal bleeding diagnosis module and micro-controller. The intestinal bleeding diagnosis module includes shell, color sensitive film, transparent isolating plate, color sensor, enteric coating, shading ring and two white LEDs. Color sensitive film is a white circular sheet with a diameter of 9 mm and a thickness of 1.5 mm, fixed on the inner wall of the capsule shell by medical adhesive. The outer layer of the film is a white medical non-woven fabric with apertures (tens of µm diameter), which is embedded with 330 anion exchange resin. The hydrophobic interaction between resin and hemoglobin can absorb hemoglobin onto the resin (Dimino and Palmer 2007; Sun and Palmer 2008). When intestinal bleeding occurs, the adsorbent resin will make it easier for blood to enter the capsule holes and dye the color sensitive film. The front end of the capsule is designed with four round holes (diameter 3 mm) in a symmetrical distribution to allow the intestinal fluid to enter the capsule. Enteric coating material is shellac, which cannot be dissolved in gastric acid but can be quickly dissolved in intestine juice (pH > 6.4) (Patel et al. 2011; Yang et al. 2018). Enteric coating is used to prevent gastric juice from entering the capsule to dye color sensitive film. The role of transparent isolating plate is not only to separate intestinal juice and electronic, but also provide access for white LED’s light. Shadow ring is used to prevent the interference of incident light from two white LEDs.

Fig. 3
figure 3

Schematic diagram of bleeding diagnosis module and micro-controller

If there is no intestinal bleeding, the color sensitive film will be white, if there is bleeding, the color sensitive film will be dyed to red.

Our study adopts the color sensor TCS3200 (AMS-TAOS, USA), which can convert the light intensity signals of the three primary color components Red, Green and Blue in the colored light into the corresponding square wave pulse of frequency fR, fG, fB. Micro-controller adopts PIC16F690 (PIC, Peripheral Interface Controller, Microchip Technology Inc, USA) with high integration and low power consumption to measure the frequency of square wave pulses.

2.2.2 Wireless transmitter

In this paper, the transceiver chip nRF24L01 produced by Nordic company is adopted, which works in 2.4 GHz~2.5 GHz ISM (Industrial Scientific Medical) frequency band. The QFN (Quad Flat No-lead) package size is only 4 mm*4 mm, very suitable for capsule micro system with strict space restrictions. The antenna adopts the ceramic patch AN3216 (RainSun, Taiwan), using 2-pin SMD (Surface Mounted Devices) package, size of 3.2 mm*1.6 mm and a characteristic impedance of 50Ω. In the transmitting circuit, the antenna is connected to the antenna interface of the RF (Radio Frequency) chip nRF24L01 via an impedance matching network. The entire wireless transmitter circuit is integrated in a double-sided PCB (Printed Circuit Board) with a diameter of 10.5 mm.

2.2.3 Drug release module

The drug release module (Fig. 4) includes micro-thruster, piston, drug cabin, shell and sealing plug. Micro-thruster is a chemical-based MEMS (Micro Electronic Mechanical System) thruster, using chemical propellant combustion to generate heat, making the gas in a narrow space generates thrust due to thermal expansion, with the advantages of simple structure, good stability and high energy density.

Fig. 4
figure 4

Schematic diagram of drug release module

The piston, which internally has an iron core to support piston without deformation, separates drug cabin from the micro-thruster to avoid drug contamination and serves as a seal covered with paraffin on the surface. Sealing plug is located at the end of the capsule to seal the drug release outlet with a radius less than that of the piston, which is blocked when moving to the outlet to prevent the propellant combustion gas from entering the gastrointestinal tract.

The micro-thruster consists of propulsion cabin, an electronic circuit board and a micro-igniter. The propulsion cabin is machined with pure copper and has a divergent inner wall, with an emission angle of 12°, a height of 4.7 mm, diameters of 6 mm and 4 mm. Solid propellant (74.6% potassium nitrate, 11.9% sulfur, 13.5% charcoal) and detonating agent (dinitrodiazophenol) are guided into the propulsion cabin and solidify on the surface of the micro-igniter.

Flow of micro-igniter fabrication (Fig. 5) is as follows:

  1. 1.

    Deposit Si3N4 (thickness 140 nm) and SiO2 (thickness 150 nm) on a silicon substrate (thickness 525 µm) by Low-pressure chemical vapor deposition (LPCVD) technology.

  2. 2.

    Sputter Ti–W alloy (thickness 150 nm) and Al-Cu alloy (thickness 12000 nm) on the substrate.

  3. 3.

    Use lithography to etch down-lead pattern of the igniter and etch away the unwanted Al-Cu, then etch heating resistor pattern of the igniter and etch away the unwanted Ti–W.

  4. 4.

    Wear 350~420 µm off the back of silicon substrate with a spiral grinding wheel.

  5. 5.

    Cut the igniter off the silicon substrate with a wheel cutter.

Fig. 5
figure 5

Flow of micro-ingiter fabrication

The capsule moves with the peristalsis of the intestinal tract, and the bleeding diagnosis module is at work. Once detecting bleeding, drug release module will be triggered, the micro-igniter will be energized and rapidly heated up to light priming and propellant. The high-temperature gas pushes piston forward quickly, and at the same time, the sealing plug is also pushed, opening the drug release outlet and releasing the drug in the drug cabin. Figure 6 shows the working process of the drug release module.

Fig. 6
figure 6

Working process of drug release module. a IBDTC moves with intestinal peristalsis. b Bleeding diagnosis module detects bleeding. c Drug release module is triggered, the igniter ignites the propellant, piston and sealing plug are pushed to open the release outlet. d Drug is released into the intestinal tract

2.2.4 Power management module

Power management module selects voltage regulator chip MAX1724 (Maxim, USA) for stable output of 3 V, with SOT23-5 (Small Outline Package) package, 2.75*1.95 mm size. The magnetic control switch uses a two-pin normally closed reed switch.

When normally kept, the capsule is placed in a permanent magnetic field box with a specific magnetic field direction. When not in use, the magnetic switch disconnects due to the effect of magnetic field; when in use, taking the capsule out of the box, being far away from the magnetic field, the magnetic switch returns to on state, and the capsule will start to work.

2.2.5 Packaged capsule

Apart from the micro-igniter circuit in the drug release module, the hardware circuit in the capsule includes color detection circuit, micro-control circuit, wireless transmitter circuit and power management circuit, which can be integrated on two double-sided PCB (Printed circuit board) with 10.5 mm diameter. Figure 7a shows the IBDTC prototype, 13.4 mm diameter and 37.1 mm length.

Fig. 7
figure 7

Prototype of IBDTC. a Packaged capsule. b wireless transmitting circuit. c color recognition and power management circuit. d micro-thruster. e micro-igniter

2.3 Workflow of IBDTC system

After swallowing the IBDTC capsule, the capsule moves forward with peristalsis of the gastrointestinal tract. When the capsule passes through the stomach and enters into the small intestine, the enteric coating is dissolved by alkaline intestinal juice, then intestinal fluid flows into the capsule and dyes the color sensitive film. The bleeding diagnosis module acquires the color information of the dyed film and the micro-controller recognizes bleeding features. Once the color features meet bleeding conditions, the drug release module is triggered to release drug, meanwhile, the wireless transmitter is activated to transmit an alarm signal to the outside. External device receives the alarm signal and emits sound and light alarm. Workflow diagram of IBDTC system is shown in Fig. 8.

Fig. 8
figure 8

Workflow diagram of IBDTC system

3 Experiments and results

3.1 Determine bleeding discrimination parameters

In this experiment, normal human blood was diluted into different multiples by 2 ratio dilution method to simulate different amounts of intestinal bleeding. The lower the dilution ratio is, the more obvious the red color is, simulating large amount of intestinal bleeding; the higher the dilution ratio is, the lighter the red color is, simulating light intestinal bleeding. The blood sample was taken from a normal adult man with a hemoglobin concentration of 148 g/L, adding appropriate amount of heparin sodium for anticoagulation, shaking evenly, PBS (Phosphate buffered solution) buffer as diluent. Protocols of this study was approved by Ethics Committee of Chongqing University Cancer Hospital and the volunteer signed the informed consent after the procedure of the study was explained in detail. A total of 12 groups of test solutions were prepared, in which test solution 12 simulating normal human intestinal juice (colorless) without bleeding, and with the increase of dilution ratio, the color of the solutions changed from deep red to red to light red to colorless (shown in Fig. 9).

Fig. 9
figure 9

Photograph of some test solutions

The pulse frequencies fR, fG, fB corresponding to the color of each solution were measured in turn, and repeated for ten times, then frequency mean values of fRi, fGi, fBi were calculated, as shown in Table 1. Due to different purposes of color research, different color models are used. The color information detected by the color sensor TCS3200 is RGB color space. In our study, HSL color model conversion algorithm (Pan et al. 2009) is used to convert RGB color space to HSL color space for processing. The H (hue) and S (situation) values corresponding to the color of solutions with different blood dilution multiples are shown in Table 1. Hue indicates the various colors of the image, such as red, yellow, and green (H ∈ [0°, 360°]), and the closer H to 0° or 360°, the more red the color is (Erenas et al. 2012). The situation indicates that the depth of image color (S ∈ [0, 1]) gradually decreases in the direction of the center of the hue circle (Fig. 10a).

Table 1 Corresponding pulse frequency of solutions and H, S values
Fig. 10
figure 10

a Hue circle and red area; b HS distribution corresponding to different solutions

It can be seen from Fig. 10b that H values corresponding to the blood samples with different dilution ratios are significantly different. According to the difference of H values, the color sensor can clearly distinguish blood samples with dilution ratios less than 64 times (1~7 solutions), hemoglobin concentration C ≥ 148/65 g/L = 2.279 g/L and H ∈ [3, 20], from 8~12 solutions. Compared with the normal human body blood hemoglobin concentration (110~160 g/L) (Short and Domagalski 2013), 2.279 g/L is as very low concentration, and the actual hemoglobin concentration in the bleeding area of intestinal bleeding patients is much higher than 2.279 g/L (Kapsoritakis et al. 2001). Therefore, H value of intestinal juice and blood mixture will be certainly in interval H ∈ [3, 20]. Considering the situation of very small and large amount of intestinal bleeding, in order to avoid missed detection, we used H ∈ [0, 25] as the determination conditions for bleeding recognition.

3.2 Verification of bleeding diagnosis module

This experiment is ordered to verify the reliability of the bleeding diagnosis module and whether it can give an effective drug release trigger signal when bleeding is detected. For the sake of observation, LED was used to replace drug release module, and the LED lighting indicated that the drug release module was successfully triggered. The micro-controller’s output pin RC2 is responsible for giving the trigger signal. When H meets the bleeding determination condition H ∈ [0, 25], the output of RC2 pin changes from low voltage to high voltage, lighting up the LED.

Ten groups of solutions were prepared with small beakers, numbered 1–10, in which solutions 1 and 2 were PBS buffer without blood, and blood sample solutions 3 to 10 were diluted 16 times. Ten bleeding diagnosis modules were randomly selected and immersed into solutions 1 to 10 respectively. The light-off status of the corresponding LEDs in each solution was recorded, shown in Table 2. In 1 and 2 solutions, the LEDs were all off, and in solutions 3 to 10, except for solution 5, LEDs were all on. The solutions 1 and 2 were colorless, H = 60 ∉ [0, 25], not meeting the bleeding judgment condition. Therefore, RC2 pin kept low level and the LEDs were in the off state, which was consistent with the theory. Solutions 3~10 met the bleeding judgment condition, H = 9 ∈ [0, 25], and RC2 pin should jump from low level to high level to light up LEDs, but LED in solution 5 was not lit. We checked the No.5 bleeding diagnosis module, found that the sealing of transparent isolating plate was not good. The entered liquid led to short circuit and made color sensor not work properly. We conducted the experiment on solution 5 again with normal circuit. The LED was lit after that. This experiment proves that the bleeding diagnosis module can effectively detect bleeding and give an effective drug release trigger signal under the condition of reliable circuit.

Table 2 Status of LEDs in different solutions

3.3 Micro-thruster ignition experiment

The experiment is conducted to verify whether the micro-igniter in the drug release module can successfully ignite the propellant when the micro-controller gives an effective trigger signal.

The micro-thruster was fixed, and two wires were led out from the solder joints at both ends of the micro-igniter and connected to a DC (Direct current) power supply. With the aid of guiding tool, the detonating agent and propellant are sequentially stacked on the micro-igniter, then a high-speed camera (Olympus BX51M, Japan) was placed directly above the micro-igniter (the lens was covered with a transparent glass cover to avoid the combustion material sputtering onto the lens during the experiment). We set the initial voltage to 1 V, turned on the power, then gradually increased the voltage, recorded the whole process with the high-speed camera, recorded the voltage and power value when ignition was successful (Table 3). We repeated 10 groups of experiments. The ignition voltage is 3.01 ± 0.13 V and the ignition power is 166.42 ± 9.04 mW. Figure 11 shows the ignition process. When the ignition voltage was reached, the propellant was ignited, and the ignition process was completed instantaneously. This experiment proved that the micro-igniter designed in the study is applicable in the micro encapsulated system with low power consumption.

Table 3 Ignition voltage and power of 8 groups experiments
Fig. 11
figure 11

Photo of micro-igniter before, during and after combustion

3.4 Capsule power consumption

The wireless transmitter and drug release module are triggered only when the bleeding feature is recognized, and they are disconnected when not triggered with current consumption approximately zero. When triggered, the wireless data transmission and drug release are completed in an instant with little energy consumption (drug release module, 166mW). At 3 V operating voltage (two button batteries), the working current of the color sensor TCS3200, the lighting circuit and the micro-controller are about 2.1 mA, 5.2 mA, 0.6 mA, respectively. Therefore, during the working period, the total working current of the intelligent intestinal bleeding diagnosis and treatment capsule is about 7.9 mA. During dormancy, all modules in the capsule are closed, except for the watchdog timer, whose working current is less than 1uA, approximately zero. The capsule works intermittently, working for 0.5 s and sleeping for 5 s. The average working current I = (7.9 mA*0.5 s + 1uA*5 s) / (0.5 s + 5 s) ≈0.72 mA, average power consumption P = U*I≈3 V*0.72 mA = 2.16mW.

4 Discussion

In this paper, data in the RGB space is transformed into HSL space for bleeding detection, because RGB color space is a basic hardware-oriented color model, and the color difference that can be distinguished is non-linear and not intuitive, generally not be adopted. HSL color space represents hue, saturation and light separately, which is more intuitive and consistent with human visual characteristics, mainly applied in the field of color recognition (Lin et al. 2015).

The bleeding diagnosis module designed in this study can only diagnosis whether there is bleeding or not, without grading the amount of bleeding. In the future design, the amount of bleeding can be divided into micro, small, and large amount according to H value, and the external alarm will also give different alarm information according to the bleeding grades.

At present, there are many widely used propellants, which need good flame sensitivity and require high packaging and transportation authority, therefore, black power (a mixture of potassium nitrate, sulfur and charcoal) (Bottegal et al. 2010) is used as the propellant, with high chemical stability, no chemical reaction among its components, and convenient for transportation, storage and purchase. Because the propellant has a high flame sensitivity, it is not sensitive to general electric energy heating and it is difficult to ignite the propellant if an electrified micro-igniter directly acts on it. However, the detonating agent is easily electrically ignited, and the generated spark can smoothly ignite the propellant. Dinitrodiazophenol has a donation point of 170℃, strong initiating ability, good thermal and chemical stability, low static and friction sensitivity, safe in storage and operation, rich raw material sources, simple manufacturing methods and technological process, and not containing heavy metal elements (Matyas et al. 2012). Therefore, dinitrodiazophenol is chosen as the detonating agent of micro-thruster.

As for the drug release module, this paper has not yet calculated required drug amount and propellant dose in detail, so the experiment of drug release process has not been carried out. It is the content that we will delve into in the next step.

The capsule shell is made of high-purity polycarbonate material with excellent mechanical properties. The inner edge of the shell is designed as an arc structure, which can buffer the piston movement during the drug release process to prevent excessive elastic force generated by the drive mechanism from damaging the shell. The capsule is composed of three shells, which are bonded by high viscosity A/B glue, and the sealing plug and the shell are sealed by Vaseline. That way, even if a chemical reaction occurs inside the capsule, there will still be no leakage. Due to the violent chemical reaction in propulsion cabin, detonation will be generated to release drugs, and propulsion cabin will be subjected to great lateral impact during the whole drug release process. Therefore, propulsion cabin is made of high-purity brass. The diameter of piston is larger than that of sealing plug, and the internal has an iron core, which are to prevent piston from deforming and moving out of the capsule, causing propellant leakage.

In the experimental part of this article, only the experiments of the respective modules are performed, mainly for the convenience of repetition. In future research, we will integrate more capsules and conduct drug release experiment in vitro. If test well, experiments in simulated gastrointestinal tract environment, even in animals, are considered to be performed.

Limitations of the intelligent IBDTC system: (1) Only one bleeding point can be detected and treated with drug, because the capsule has only one-color sensitive film in the bleeding diagnosis module and one drug release module. Once the hemoglobin has been deposited on the color sensitive film, it will remain red and won’t return to its original colorless state, detecting the next bleeding point. The micro-igniter in the drug release module can only ignite once, not twice, and the drug is completely released with also no drug residue. The design of micro chemical thruster array may be able to achieve multiple drug release. (2) The capsule is only suitable for patients diagnosed with no bleeding in the stomach. If there is bleeding in the stomach, the gastric juice mixed with blood will flow into the small intestine along the digestive tract. When the capsule reaches the small intestine, enteric coating dissolves, intestinal juice mixed with blood flow into the bleeding diagnosis module to dye the color sensitive film, color sensor detects bleeding and triggers drug release, leading to misdiagnosis and wrong drug release of the capsule. (3) Due to the limitations of bleeding diagnosis method, the IBDTC is designed to detect and treat visible bleeding, not occult blood. Gastric occult blood detection capsule and fecal occult blood (FOB) test strip are both methods for detecting occult blood in the gastrointestinal tract.

5 Conclusion

In this study an intelligent intestinal bleeding diagnosis and treatment capsule system was proposed and developed for the first time to diagnose and treat intestinal bleeding. Once bleeding is detected, drug will be released. The drug release process is completely automatic, eliminating the need for in vitro positioning and manual triggering, greatly reducing the workload of doctors, avoiding the disadvantages of inaccurate in vitro positioning and no radiation, is a truly smart system. This is a new concept and method, which has not been reported at home and abroad. We have successfully demonstrated that the bleeding diagnosis module of the IBDTC can effectively detect bleeding and give an effective drug release trigger signal, and that the micro-igniter in the drug release module can successfully ignite the propellant. And we have also identified directions for future research: accurate propellant and drug dose and external bleeding level alarm. The new device creates the possibility of targeted therapy in small intestine, especially the segment of intestine that cannot be reached by endoscopy, not oral medication, with no injury, no pain, no complicated supporting equipment, no need for in vitro operation and positioning. With the deepening of follow-up research and development of technology, it is expected to be applied in clinical practice, with important academic research significance and good clinical application prospect.