I want to make (as the title suggests) an air bubble detector using ultrasonic transducers. The purpose is to detect air bubbles in an extracorporeal (external) blood tubing.
I was able to produce a 40kHz square wave using the Arduino's timer. Using this as the input for one transducer, it acts as a transmitter. When the other transducer is in the transmitter's line of sight, it generates a 900 mV 40kHz AC sine wave when there is only air in the tube. The amplitude of the received signal varies according to the fluid (medium) in the tube.
How can I use the receiver's signal as an input for my Arduino to detect change in fluid (bubble in blood).
PS: I am new to electronics and Arduino, please try to provide as much detail as possible.
I've been advised to use some form of rectification in order to get a DC amplitude only signal. This way I could measure the amplitude (or so I've been told) and identify when it varies indicating the presence of air bubbles.
The wavelength of 40kHz ultrasound in water is about 4cm. I would have thought 500kHz to 1MHz was
a more normal frequency for liquid ultrasonic sensors like this where the wavelength is measured in mm.
Your transducers only work in air. Water requires completely different transducers as the acoustic impedance
is different by nearly 4 orders of magnitude.
You need to understand some basic physics first, you clearly don't understand what 4 orders of
magnitude impedance mismatch entails... Suggest you read up on systems that already exist to do
defect detection in solids and liquids, and you'll see that they don't use 40kHz, and they don't use a
piezo speaker.
I think you need to explain a little more about what you are trying to do here and why.
How big does a bubble have to be before it is detected?
Is the liquid just plain water (drinking water)?
Why do you need to detect them in the first place?
What will you do when you do detect the bubbles?
Is the water colour clear?
hope this helps you think about it and refine the specification of what you want to do.
I'm trying to make an air bubble sensor for blood tubing.
How big does a bubble have to be before it is detected? - I don't know yet, but the tube is 3mm in diameter Is the liquid just plain water (drinking water)? - blood Why do you need to detect them in the first place? - so that the air bubble doesn't enter blood stream What will you do when you do detect the bubbles? - when a bubble is detected I want to turn on a buzzer Is the water colour clear? - ahh, it's blood
I'm just looking for a way to use the receiver's sine wave as an input for the Arduino. When a bubble will be inside the line of sight of the two transducers, the amplitude of the received signal will change and I just want to be able to identify that a change in amplitude has occured.
Because ultrasound is more reliable, I guess. Also it can detect air bubbles that are covered by blood, i.e. bubbles smaller than the tube diameter. These can block light, not sending a signal of their presence. But ultrasound can detect these small bubbles as well. Usually medical grade ultrasonic bubble detectors have a tolerance adjustment based on bubble size.
If this is for fun then OK, but to get medical quality sensors and to build equipment that meets medical safety standards, then I think you are out of luck. What is wrong with commercial products used to do this?
Thanks for pointing out that video Riva, but this is not for fun. Also I don't need very high accuracy, which medical grade sensors can provide.
I just want to be able to use the transducer's output as a meaningful input for the Arduino. Is rectification the way to go? If yes, then how do I do it? If no, what can I do?
So you are saying that if I use 40kHz transducers, using their output it is not possible to differentiate between blood and air?
The ultrasound will detect the outside of the tube only, it cannot penetrate solids or liquids due to the
4 orders-of-magnitude acoustic impedance change.
Assuming the speed of sound in blood is 1550m/s and with a 40kHz frequency, the wavelength would be around 38.75mm. That, as MarkT has explained before, will not be able to detect anything inside a 3mm tube.
Clearly, I need to use higher frequency transducers. Also, MarkT has talked about impedance mismatch. I have no idea what frequency transducers I would need to make this work, or even if piezo is the way to go.
You still did not answer the most important question: WHY are you trying to do this? You say extracorporeal blood tubing. It is extremly dangerous and may lead to fatal complications even with medical grade devices and experienced staff. Are you aware of all other possible problems such as clot forming, blood cells destruction etc?
Yes, I understand the risks involved in all of this. I am doing this as a part of a bigger project, where there are highly experienced scientists. I have to develop the air bubble detector and a method for occlusion detection (if clotting occurs). Need help on both, so I started with the bubble detector.
And why does those "highly experienced scientists" rely on someone "new to electronics and Arduino" to help them with this project? You should have lot of knowledge to do this - where those bubbles can come from, how large they may be, how many are dangerous etc. You should try to study how others handle this task. If I were to suggest a method I would try optical method first - you can light through the blood and have detector on the other side. Sudden increase in light intensity means less blood in the tubing absorbing the light - either air bubble or some other solution is in the tubing. Maybe you could use capacitive sensing - water have relative permeability over 80 but air only 1. If you measure capacitance between two plates and the tubing is between them air in tubing should lead to drop of capacitance. But both ways are only a wild guess - I have no idea how "real systems" are sensing air bubbles.
AFAIK blood clots are not measured directly in systems like dialysis or ECMO. Clots form mostly on the membrane and their forming is sensed as decreased function of the membrane and increase of pressure needed for blood flow.
This is a part of my academic project. If I don't do it, someone else will, but I won't get a better grade. There was some mechanical designing work that I've already completed and why should I not try my hands at something that's new for me? Especially given how supportive the whole Arduino community is.
There are both optical and ultrasonic methods currently in use in existing solutions. Though the capacitive method you've suggested might work, I haven't yet seen its implementation anywhere. From what I've read so far, the ultrasonic method is probably the best at detection and reliability.
I'm also not too sure how clot sensing works in dialysis or ECMO. Some infusion pumps use force sensors on soft tubing.