Ultrasonic Receiver Circuit Not Working (SOLVED)

Thread Starter

didifi

Joined May 8, 2023
31
Hi
Do you mean in Volts or Arduino serial plotter?

Both would be best

E


I wanted to post a video but here it's two pictures with multimeter, when the white LED is ON it's when there is an object and when it's OFF when there is no object. I'm measuring it in Vo and GND.



1683715789977.png1683716412712.png1683716431974.png
 

ericgibbs

Joined Jan 29, 2010
21,460
hi,
If I read that correctly, when no object vo =0 and when object present it is vo =2.24V.
So set your ADC sketch to read and average say 10 readings and if average greater than 1V an object is detected.
E
 

Thread Starter

didifi

Joined May 8, 2023
31
hi,
If I read that correctly, when no object vo =0 and when object present it is vo =2.24V.
So set your ADC sketch to read and average say 10 readings and if average greater than 1V an object is detected.
E
Hi! I'm not sure if that would work as whenever I received a wave it wouldn't oscillate with the wave, it would only oscillate as it was before. The difference was that the serial plotter wave would look more distorted, like the picture I'll put down below. I put the analog pin as input_pullup and now I can get a variation below 1018 (very quick before it goes back to 1023), so I can know when a wave is being received, I think I can work with this for now, thank you

(I forgot the picture sorry)
1683720399348.png
 

Thread Starter

didifi

Joined May 8, 2023
31
Not everyone on this forum can interpret an ino file, so the rest of us (with the exception of @ericgibbs ) missed the fact that your sampling rate was far too low.
Either:
sample more than twice the signal frequency 80,000 samples per second
Or:
rectify the output signal and sample that.
or:
trigger a monostable with the first output from the comparator, and read that as a gpio input.
Hi, I tried the first two ones but apparently arduino can only do around 10k samples per second.. I saw some people do more only with external ADC's. The rectifier also gave me the same results with oscillation. But I put the analog pin I'm measuring the voltage at with pull_up so now whenever there is a wave the voltage goes down to below 1018 for a split second, which allows me to know when I receive a wave by arduino too. Thank you and everyone for your help :) this is working for me now so I hope it keeps working even when I try a better opamp
 

Thread Starter

didifi

Joined May 8, 2023
31
Nevermind it now spikes below 1018 even with the pullup :/ and it doesn't change again with the Vo changing state.. I'll try to mess with it a bit to see if it works again
 

ericgibbs

Joined Jan 29, 2010
21,460
hi,
I don't see any power rail decoupling capacitors on your project boards.?
This will most likely cause electrical noise problems.
E
 

ericgibbs

Joined Jan 29, 2010
21,460
hi,
Try a 100uF.
The caps are across the +5V and 0V rails on the amplifier bread board.
You could use two 100uF's to give 200uF.

E
 

Audioguru again

Joined Oct 21, 2019
6,826
The tangled mess of wires on your breadboards are antennas for picking up interference.

What are the numbers for on the photo of a squarish waveform? The vertical should show the voltage and the horizontal should show the time in micro-seconds.
If the half a squarish waveform is the 40kHz ultrasonic then the small triangles are a local AM radio station interference at 20 times higher (800kHz).
 

ericgibbs

Joined Jan 29, 2010
21,460
hi agu,
Post #64.
His plots how the Arduino Sketch output of the ADC.
The vertical scale is the ADC count value 0 to 1023] == [ 0v to +5v] and the horizontal scale the sample number.
This gives rise to the triangular profile.
E
 

Audioguru again

Joined Oct 21, 2019
6,826
hi agu,
Post #64.
His plots how the Arduino Sketch output of the ADC.
The vertical scale is the ADC count value 0 to 1023] == [ 0v to +5v] and the horizontal scale the sample number.
This gives rise to the triangular profile.
E
I think an oscilloscope display should be used to see problems with the analog fairly high frequency waveform.
 

Thread Starter

didifi

Joined May 8, 2023
31
Hi everyone, I got it to work when I connected the arduino Vin to the VCC used. I also replaced the 1k resistor in series with 100k to a 3.3k since it worked a bit better. Now it's at a stable 400/1023 and when it receives an ultrasound it goes up to 500. I have another problem but now it's with measuring distance, so I'll post it on arduino forum I believe. Thank you very much for your help!!
 
Top