DIY Sonar Scanner Ep. 2 (STEM, RMT tricks)
HTML-код
- Опубликовано: 1 июл 2024
- In this part I reversed the working principle of my DIY sonar scanner the phased arrays are now receivers. I show how that works and what electronics I designed to tackle the challenge. You liked STEM and here is another bit of that for you. Please enjoy and share with a friend!
Give my sponsor Aisler a try: aisler.de
They manufacture locally and are still competitive!
Scanner code: github.com/bitluni/SonarScann...
Browser based simulator: www.shadertoy.com/view/NttyW8 (janky and only UHD but ship it!)
Links to parts and tools (affiliate links):
Miniware Hot Plate: aliexpress.bitluni.net/hotPlate
Flux: aliexpress.bitluni.net/flux
Syringe Pusher: aliexpress.bitluni.net/pusher
My camera and lens (4k 60fps): amazon.bitluni.net/gh5
Merch: merch.bitluni.net/
Github Sponsors: github.com/sponsors/bitluni
Patreon: / bitluni
Channel membership: / @bitluni
Paypal: paypal.me/bitluni
Twitter: @bitluni
Discord: / discord
0:00 Intro
0:12 Recap & motivation
0:51 Sound simulation
2:34 ADC Design
3:11 Aisler PCB assembly
4:09 BGA montage
4:42 ADC serial interface
5:07 Coding challenge
5:59 RMT tricks
7:03 Final tests
#electronics #maker
re-upload because I misspelled Hertz🤦🏻♂...in an educational video about physics. I deserved it if you un-bell me
Haha, but I congratulate your focus on quality !!🔥
You asked for Fiber, but you deserve 64k ISDN speed for reupping the video 😇
not gonna lie, I didn't even noticed it hahaha
Didn't bother me at all... one might even say it was zero hurts for me.
never, infact youtube should double the view count, i blame them
Is part 3 coming anytime soon? I can’t wait to see how this project developed!
???
Always amazed at how far you can push some of these microcontrollers!
This is even a cheap version :-D
I bet the RP2040 could do all the stuff in PIO
@@bitluni Could you use this in maybe a multi level set of arrays to make one of those fish finders?
Geeeeeeezzzz. This is a mind-bogglingly advanced maker project. I can't believe all this is possible without a PhD in ultrasonic and signal theory, and a big lab. Let along possible with an ESP and off-the-shelf hardware! Great work! I can't wait to see how you amplify the output signal without introducing "noise" into the rest of your system.
I also can't wait to see that :-D
IKR, though the math/physics principles have been pretty known for quite a while as well as some actual existing HW/SW implementations that aren't totally proprietary anyway. But yea its amazing just how far we've come over the decades & how readily available everything required for such a project is, even to a DIY engineer.
Using a lock-in amplifier perhaps?
dude the math is pretty basic bachelor in engineering-level... Programming the microcontroller to work at those speeds is where the complexity of this project comes
@@bitluniДальше увеличим количество приёмников и получим ультразвуковой 3D сканер для дополненной реальности?) Будем без включённого света видеть окружение😏😏😏
As a former USN sonarman in the early days of towed arrays, this brings back fond memories. I had learned theory in cylindrical active arrays, but tight passive beamforming and frequency resolution well to the right of the decimal point - even for ridiculously low freqs - was a whole new ballgame.
The math still makes my head hurt though. 😏
You can use the DMA in the STM's as well. It is very capable at reading data from GPIO pins triggered by a lot of alternative sources.
I was working on the same kind of plan 14 years ago. one thing I noticed is that it's better to space the receiver array with prime fractions in between each detector. so the detectors are not spaced evenly. This prevents a picket fence type sensing issue. Also there are wider bandwidth ultrasonic detectors, but they operate at higher frequencies and thus increase the difficulty of the electronics.
What's Prime Fractions? I googled, but only found prime factorisation
Placing at primes is a good idea. It make a significant difference in performance?
@@LydellAaron so you have a spacing distance between sensors. Then you say do a 7/5 of that distance and a 14/11 of the distance. The waves that line up with the consistent distance now are not lined up with these odd spacing. it helps separate out things.
@@LaserFur I haven't checked your math, but I do see what you mean in spacing the sensors. Question: Could you tune each ultrasonic, to emit a pure prime frequency, keeping the distances the same?
@@LydellAaron no. it's not about the frequencies. it's about geometry. Any random spacing that is not even will help. think about how the phase of the wave from two different objects can line up the same on the sensors. The sensors have a bandwidth that controls the resolution it can separate objects, but the phase on each sensor can target a object with more accuracy.
The US military had the 5 omni-directional microphone version, installed on some humvees that pinpointed the afghan snipers, when they fired. Machine-gun galore after that.
Mountain echos and all. Now there's a small version called the "Sniper Detecting Microphone", a part of their TCAPS (Tactical Communications and Protective Systems).
Smaller than a pack of cigarettes, the solider sticks to the back of his helmet.
I like yours better because it's based on an ESP32.
So basically the rl version of the little arrow you see in video games showing you were the shots were fired from, pretty cool
@@xxportalxx. dam, i never thought that such a device could exist. But it makes sense now, to have a phased array microphone system would work very similar.
I did a university project where I determined the angle of a body respective of a sound source by using digital cross-correlation techniques. Made an A! Now, we can see this kind of math being used in sniper shot detection and ranging.
@@DrumToTheBassWoop You get more bang for the buck with beamforming phase-shift arrays. This beamforming technology could augment LiDAR for 3D mapping.
Great physics, presentation is clear and concise, but also very appealing. Sound background in simulation part of the video is extraordinary 🤗 for the electronics side of the project: 🤯
Fantastic! WOW! And you managed to get a PCB with BGA's on them... impressive! Thanks for sharing this... I can't wait to see how you process the data and interpret it.
its only 8 pins which are adjacent to the IC corner. The of all the BGA boards the last ADC didn't work. I used a different type for the tests shown here (code still works the same). I never really found the issue. The solder mask is a bit wide open on one of the pads. The pin pitch also exceeds the specks of the manufacturers fast shipped PCBs. I tried the BGAs because they were the cheapest and support 12bit at 3MSa max. Still would use sot for product because of the reliability.
@@bitluni Well, even attempting it was brave! Glad you got a work-around for that last ADC and was able to move the project forward... much respect for you!
THIS IS SO AMAZING! Thank you for documenting all of these cool projects for us.
The animations in this are excellent. Well done!
Absolutely loving this project!
This series is awesome!
Braver man than I with those BGAs! This is a really cool series. Great to see a phased array application I could actually build one day. Wonderful exercise of the theory too. 👍
I love this. Especially the multiple channels at once sampling.
Wow, this is awesome work. Coincidentally I came across this while planning to do my own project to attempt the same thing. This is great motivation!
So much yes! Great project and amaze editing and presentation! Love it
I will wait for the next part and I love the ESP32 but my surrounding makers hate it, now I can share this video and point out one more time how awesome this controller is.
Great project laid out in great yet simple detail
Loving this series, man!
Fascinating project! I am very curious about the next video ☺
(And, I also think MEMS microphones would be an interesting idea 😁)
Thank you for such precious documentation.
Excellent video from any point of view.
Great idea and great video! Looking forward to see the next videos.
The STM series also features DMA, which can really improve your GPIO speed dramatically. My mind goes straight for an FPGA with this use case, and I give you massive credit for how much you've been able to get a lowly ESP32 to do!!! Impressive!🤘🤓
Nice echo visualizations, it helps wrap one’s head around the relativity.
TNice tutorials was an amazing tutorial. You are a great teacher
Hi, I was wondering if you are going to continue this series on the phased array sonar?
Just when I thought this project couldn't get more genius, it got more genius.
Amazing work. Loved it
caught you there
I love the thumbnail "... this is what AI thinks...."
... and the ambient music + sonar sound effects soundtrack.... nice!
I recently used four analog MUXs with the select lines driven by shift registers to read 64 analog hall effect sensors in "real(ish)" time.
So cool :O Cant wait for the next one
I would highly recommend programming the ESP-32 using the PlatformIO extension in VScode. Not only is VScode just a generally better IDE, but the default ESP-32 framework (which virtually perfectly mimics the default Arduino framework) is actually built on FreeRTOS, which can leverage both cores of the ESP-32 and allow true concurrent multitasking. This is achieved simply by making calls to the FreeRTOS API with no modifications or extra library imports needed, which is freaking sweet for a 6$ microcontroller.
That's why submarine radars use a non-repeating melody to scan the environment. That way you can distinguish between the different echos.
a different world. It's the sa laws, but different application. Without your videos, I'm not sure I would be at the level I'm at. I'm not a pro
Very cool project sir impressive.
Incredibly informative. As soone with no background in soft other than so Nice tutorialgh school band, I completely understand everytNice tutorialng
If you add additional transmitters offset by the size of the 8 receiver array, then you will have a MIMO-array with twice the angular resolution. You would simply record one frame with one transmitter active, then another with the other transmitter active.
Absolutely awesome.
what a BEAUTIFUL video!!
Nice video! Waiting for more!
Everything works at its best!!
Nice Project!!consider looking at phase modulated pulses to get higher resolution without sacrificing power out on you pulse!
Ok....the next video bitluni does a ultrasound image of a baby using esp32
Wow! So cool!
Love these videos!
You could just bandpass the transducers in the rx array and measure the time delay at baseband. No need to actually measure the waveform directly. Great video, look forward to seeing more on the subject.
holy crap, this is amazing!
amazing to see people like you
like your videos sir... waiting for part 3... love from pakistan
I used aisler tooo ! There awesome !!!
Thanks for this video
This is awesome!
Awesome project!!! Best regards from Ukraine, Odesa!:)
Nooooo. Where is ep. 3!???? This is really fun to watch!
This project is SO COOL! I can't wait until you create a fully functional Alien motion detector. 😅
Dear Bitluni; The sport of soaring cross country involves the glider flying to areas of convective lift to gain or maintain altitude to fly distances. This means it would be nice for the pilot to have some kind of thermal scanner to observe areas of lift in the vicinity of the aircraft. Now the pilot has to guess where these areas are by visual clues and then flying ahead to confirm the lift by instruments of vertical speed. The concept of a "lift scanner" has been a dream of soaring pilots for generations. I am wondering if phased array transmitters and detectors might be a possible solution. I have read that microwave radiation might be used here. You do great stuff!
One more epic, do more uploads plz 👍🤟
Nice job !!!
Nice content. I think, everyone who works with prototypes hates jumper wires except probably newbies.
Nifty AF !
Those PCBs look like they could be very useful in some DIY scientific endeavours.
Nice video, thanks :)
This is awesome
I wonder if you could use a 4D lidar camera and a speaker and microphone to train a neural network to map the received audio signal to the scan. You could also use something like the Google cars scanner (idk if they use synthetic aperture lidar but that may make things cheaper) to also regress the audio signal. One upside is it can learn ambient echo patterns too!
BRILLIANT!!!!
Really cool project. I was wondering if it's possible to realize this with Ultrasonic signals instead of microwaves. eagerly waiting for the next video.
super impressive! Your PCBs look like they have a lot of cross talk between the different digital signals which is probably limiting your sampling rate, whats your board stack up and how are the board interconnects carrying ground is what id look at first.
Stm32f3 series internal ADCs have more than enough speed for you :) f303 has 4 ADCs at 5MSPS each, for example. Straight to memory with DMA.
super cool
Nice one !...cheers.
I wonder if the rpi nano's programmable io peripheral would help or hinder here. Seems like itd be an interesting test at any rate.
I just discovered this channel, is the part 3 coming ? That's really interesting even if I don't understand everything :)
I think that RPi Pico, with its programmable and full system clock speed PIO state machines, is far better choice for high-speed ADCs than ESP32. Also take into consideration its great overclockability. I think it will be possible to build even multi-megahertz ADC circuits with it.
I would still like to get your help on designing my "flashlight for the blind" based on a laser range finder. But if you were able to map surfaces with your sonar, maybe that would work too. I found sonar to be too slow for distance measurements. But the tactile feedback for a flashlight for the blind would most likely use tiny electrical pulses on the forearm. Or possibly on the hand and fingers if it were implemented in a glove. Imagine feeling your way down the street with 30 foot long fingers. i'm quite certain that something small and functional could be designed to work on a rechargeable 9 V battery. Or maybe more batteries. Something that would fit in one's pocket certainly. This would be a tremendous benefit to many people. The cane is a very reliable mechanism, but it could certainly expand one's horizon to be able to feel doorways and windows and street signs coming up. To be able to sense people 20 feet away walking toward you. Perhaps
Great work and I was following up with your project. My question is how do I calculate the required power to make this scanner works in different media than air such as air?
Amazing! Would it be plausible to use lower frequencies of sound that can go through various objects and “see” through walls?
Great video...Thank you... I was wondering what the app you used for the sound simulation was?
You could try to transmit from the same elements and then switch to reception, as radars do, instead of one transmitting element centralized (which can add a phase shift along the array)
This is possible but the drawback is called a blocking distance. The transmitter rings for a period of time after excitation had ceased. This time is distance the transmitter won't be able to see. It would be blind close up for the transmitter element.
Great guy! Is it really amazing to see your experiment. Is it possible to make a medical grade ultrasound scanner?
very cool
Well you got the tech for my project that I'd like to do, a phased array microphone. Start with an audio frequency microphone 2D phased array to resolve a 3D volume. Each cell in the volume would be the sum of phased inputs from each microphone processed to show a live FFT to give a colour for spectral content and transparency for amplitude. This would be way better than the sound camera I saw over at @SteveMould with the acoustic camera as it ought to show all sound all the time.
This is a next level project :)
I wonder why don't you used the native ESP-IDF it is more powerful than ARDUINO IDE
I had a look at Aisler... not as cheap as the PRC people, but, having actually run a business doing electronic design and development, their pricing structure makes sense, seems quite transparent.
It might be a plan, if you feel ok with it, to give the price for a board that you are building? For me, I guess it would be interesting for a bare board price, on a board that's reasonable to assemble in a hobbyist lab, and a price for a fully built board, including their sourcing and mounting of components. The setup fees stack up a bit, but compared to damage to boards or components, trying to do it "at home" 😁
Check out FMCW (frequency modulated continuous wave) instead of single pulses.
Wow, amazing project! I'm looking forward to trying it myself. Is there any link to order the pcb?
It just occurred to me (but I didn't calculate the feasibility, so maybe it is a flop) that the sample rate requirement could be loosened by using analog band-pass filter(s) in front end and undersampling/ ADC multiplexing. Since the signal is basically just 40kHz sine, that would work, provided that both the modulated pulse, and distance between receivers is long enough for phase difference to be noticeable with sampling rate you have available.
Or, since nothing prevents you from using multiple acquisition periods, you can induce small variable time (phase) shift between emission start and receiver start, so that multiple undersampled readings can be interleaved to construct synthetic high sample "image" with better resolution.
It's a baby 👶 congratulations 🎊
Those animations are amazing! How did you do them ?
Excellent idea and implementation. S2 has “8-bit Octal SPI mode” Spi port with dma. Would that simplify the code and timing a little?
This is fascinating! Just after I watched both of these videos, I stumbled across a 2003 paper that says the following without including a citation for it's claim. "Since the wavelength of 40 kHz ultrasound is only 8.6 mm, a receiver with dimension larger than the wavelength is not recommended for wavelength measurements." DOI 10.1088/0031-9120/38/5/310
In the first video, I think you showed us that the smaller transducer has a 9.6 mm diameter.
If the paper is correct, then would smaller receivers give you more precision?
That's the diameter of the case. The transducer is inside and smaller.
Probably you could use the DMA module to read the high-speed samples and dump them to the USB bus, if C can't keep up. With the SPI module, you can create a clock frequency up to 80MHz, and the general purpose Timers should be able to generate high speed clock signals as well.
For best result, it would be better to not space the receivers the same distance, but e.g. double the distance between them for each one as they get further from the center.
But damn, I want to make my own, 3D, scanner now, by making a cross with the receivers, not all on a line.
This series is absolutely amazing. How much do you think it will cost you to make these in the end?
Cost in parts, very little. Cost in time and knowledge, lots and lots... Not everything can be boiled down to the $ easilly
Nyquist says you must sample at GREATER THAN twice the frequency. Sampling at exactly twice takes an infinite number of samples and produces an alternating output. Sample at 4 or 18 timeds the frequnecy or as much as possible. If you know the amplitude you can find phase at 2f, but you don't know amplitude.
good point... might hit exactly the 0 transition and get nothing
2:55 sounds like ElectroBoom 😊
For maximum performance results and best transmission, the frequency will not be exactly 40 khz, try 39800 or 39900 hz or what fits your tx and rx Transducer
Excellent. I'm a little creeped out because I just started work on this same basic idea this morning and out of the blue RUclips suggested this video in the early afternoon. That wouldn't be remarkable except that I haven't googled yet aside from looking for a schematic for the HC-SR04 board to see if there is anything worth salvaging.
I considering trying to figure out if I could use Knowles digital ultrasonic microphones. IIRC the ESP32 maxes out at 2 PDM inputs and that is with interleaving left and right channels that probably doesn't help much. But I do have an old FPGA laying around which is grunty enough to handle converting several PDM streams to PCM. But I wonder if there might be a good algorithm for getting phase and echo times out of the PDM signal? In other words, each microphone has a 1-bit SAR ADC built in. Would it be possible to use the 1-bit stream from each microphone directly instead of first converting to PCM. Each mic's bit stream flows at around 3-5 MHz in ultrasonic mode and it takes somewhat serious number crunching to get that to 16-bit PCM so it might be nice to skip that and go directly to finding echo delay and phase. That might allow the final version to use an inexpensive FPGA dev board. Anyway just an incomplete thought which maybe you know something about.
You could emit a chirp from 0 to 10 kHz and capture this with a slow Adc (20kHz sample rate) of a microcontroller. Then you could emit a chirp from 10kHz until 20kHz. In this way you can cover the full spectrum where your transmitter and receiver are sensitive. One requirement is that you should have no aliasing filter in your receiver path Also the sample and hold circuitry should sample in a sufficiently short time window and the sampling times between transmitter and receiver shall be triggered with low jitter.
based fellow communist electronics enthusiast
Looks like I had a bad idea if the goal is direction finding.
MICROPHONE ARRAY PROCESSING OF PULSE-DENSITY MODULATED
BITSTREAMS
Conference Paper · January 2018
Ipenza, Sammy Carbajal ; Masiero, Bruno S
It still feels to me like there should be a way to avoid the FFT(s) and do some sort of fuzzy statistical comparison of the streams to get time of flight and phase. I need to re-watch this video to see how bitluni did it. I don't remember FFTs here. Interestingly PDM seems to be good input for spiking neural networks--maybe a completely different AI based approach would work.
PDM to PCM conversion is basically done using low pass CIC filter (with decimation), which reduces data rate by some factor (/64). This is followed by a cross-correlation of signals from different microphones. The low pass filter doesn't do much but reduces the data rate and size of the array in memory. So, it should be possible to skip that step, but at the expense of bigger RAM.
Personally, i would use 8 of ESP32 boards, one per the PDM microphone, and process acquired data using RPi.
Subbed!