Ultrasonic distance measurement is old hat, it relies on time-of-flight measurements of ultrasonic pulses. This is commonly seen in cars for parking aid or in industrial applications for part detection, etcetera.
While getting the distance to the nearest object is nice for this, why not go a step further? There are projects which create volumetric data by scanning with a single sensor an stepper motors. This works but is slow. It should be possible to create volumetric data of a large room without the need to move the sensor mechanically:
What I'm thinking of is ultrasonic interferometry.
What's needed is not a single sensor but a sensor array.
I had some time since my last log and a lot of thoughts about the current setup.
One thing I thought about is lobes of the sensors. There is a HC-SR04 datasheet here, where this image can be found:
I guess, I will need a much broader directivity, at least for the sender.
Second thought: signal strenght.
Maybe a more powerful sender can enhance signal strenght on the receiver part.
This leads to the topic, I'll cover next: different sensor types.
I found some random sensors on e*ay.
First, I'll take measurements about their directivity and power then I'll make changes to my test rig.
After all I do want to believe that this project will succeed.
Something I call "the cone"; with potetially very broad directivity. I have no idea, what this thing was used for, I could not find any datasheet.
To measure directivity I created a small test-rig.
There is a sender-element at the end of the rail, connected to my red box. The rail has a wheel attached that can be rotated. I guessed that eccentric mount does not affect the measurement a lot, so I mounted the sensors a little bit of centre, because it was easier this way.
I did modify the red box a little bit, so it can be connected to my scope.
So after all was set up, I took measurements of signal strength over several angles.
Blue is directivity of HC-SR04 and red of 'the cone'.
I'm very happy that I somewhat could reproduce the diagram from the HC-SR04 datasheet.
Earlier I did mention another sensor K-14WP10, this sensor will need a preamp which I didn't want to build right now. Therefore I just compared the two.
Just as said before, broad directivity is important for me, so next time I'll use 'the cone' for taking measurements.
In the diagram above each sensor directivity is normalized against its amplitude at zero degrees.
For 'the cone' aplitude at 0° is lower than the amplitude of HC-SR04.
Last month there had been three major drawbacks on this project. Firstly some pipe in my workshop broke, so this had to be taken care for. Secondly water from this pipe killed my computer I used to use in theworkshop and thirdly also my oscilloscope is damaged.
Therefor I will continue to write updates, once I've taken care of these spokes in my wheel.
Some time ago I was lucky to obtain several measurement daq PCI cards. With my card, I'm able to acquire data from 8 channels simultaneously at 200kHz sample rate. Those sold at several hundred € which is quite cheap. If you're curious about the the card, this is the company's homepage with more details. One reason I chose this model is that it's supported by the open source driver comedi and I'm using Linux on my computer.
I've been working with devices like these cards for a long time, but not for my personal projects, especially high-end cards sell for several k€s which is all right when working on a project for a big company but not if it's your personal budget.
In my last project log I mentioned the red box. It will act as an adapter between my sensors and my daq card.
For safety reasons I added ESD protection inside the red box. This is just an 1kΩ resistor followed by two diodes per channel.
To trigger the ultrasonic burst a push button is connected to the HC-SR04s trigger lines.
Finally an external power supply delivers 5V to all four boards.
Right now as I'm writing this, I did not take any photos, but will add them later.
Now the next step is writing software to read out data from my daq card and analyse the waveforms.
Some days ago I got tired of messing around with my circuits and finally ordered some HC-SR04 boards. There is everything I need packed together on one board: Transmitter and receiver and some controller.
Here I found a really good analysis of the HC-SR04. It seems like its receiver circuit is quite simillar to mine, allthough it works ways better.
With this plan on hand, it took me only a few minutes to capture the next two images.
What can be seen is the input of the receiver after the third input stage (analogue, I want to capture this) and the related output of the controller (TTL, won't be useful for me).
With different distances to an object moves the time between sended and received pulse, on the first measurement the distance was ~35cm, the second time it was shorter.
Here is a photo of one transmitter/receiver (top) and three receivers:
Note that I removed the transmitter and added a pull-down on Trigger-In line. For connecting the boards I used USB cable, it's got a shield and hopefully running power and signal lines together is no big deal for this application. If signals are bad, I'll swap the cable or add a second, shielded cable for the analogue signal.
Update 2: more photos!
This is how the boards look like from the back
And this is the box, where all sensors will plug in.
Details on the box will follow with my next project log.
For the second version of scanner-board I did a spice simulation. (I should have done this before building the first prototype.)
The circuit has three parts:
first the input stage with input amplifier because of the small signal from the US sensor,
second a comparator / envelope detector for creating a lower-frequency signal and
third output amplifier.
The signals: input voltage (blue) and output voltage (red)
I've read this document from TI (pdf warning) which gave me some hints for the input stage. Virtual GND for U1 is created by R3 and R4. This is necessary because I use all opamps in single-supply.
The envelope detector acts like a comparator paired with a lowpass filter. Because there is no feedback-loop U2 outputs only 0V or 5V. C4 together with resistors R8 and R9 set rise and fall time. A simple lowpass filter wouldn't do the trick since I'm interested in the peaks of the signal.
Next step will be building this circuit and testing. I'll install potentiometers for R6/R7 R8, R9 and R10/R11 to adjust the values during live-tests. Probably there will be a lot of adjusting before everything is good.
I'm excited since signal acquisition and first tests of 2D images are getting close!
I chose ultrasonic transmitter MA40S4S and receiver MA40S4R. In the German data sheet there are many application notes with many examples of schematics. I did not find these documents in English though.
The following diagrams were created with KiCad/Eeschema based on the data sheet.
My plan is to build sub-modules that transmit and receive. Both use the same interface, which will also be used by a measurement-device. For this device all I have so far is a vague concept which I will refine in a future post:
- maybe a box with several interfaces (minimum of four) for connecting sub-modules, which - output the 'burst* - analogue input from three sensors - ADC for said analogue inputs. maybe a 1 bit ADC (aka schmitt trigger) - inside some kind of digital signal processor. may even be a small 8 bit µC - output of scanned image. maybe a display or connector for a computer which runs 'display software'
For now I will focus on creating some sub-modules and test them with an oscilloscope.
Ideally this will allow me to test my concept (in 2D for I only own a two channel oscilloscope right now).