hi, does anybody knows how the HG-M40DAII ultrasonic sensor works? I mean, is there any special configuration for this sensor to start measuring distances? Because I have been trying to make it work, and all I have is like a noisy signal.
Thanks your reply.
Our input signal from a signal generator is a square wave with frequency of 30hz and amplitude of 5 volts. Our pulse width is 2ms.
The output from the sensor is displayed on an oscilloscope. It is also of 30hz frequency with one crosstalk pulse.
The problem is that even with this setup, we are not getting any change in the output from the sensor when we put an obstacle in front of it.
We have also tried tuning the receiver gain and by doing that we get a pulse sometimes, but with a lot of noise.
We have tried this with four different sensors of its kind and ended up with same results.
Has anyone used this sensor before?, if yes what other changes do you think we need to make?.
I’m using the Hagisonic HG-M40DAII in my project to find distance and direction to objects. I use one transmitter and two receivers. Unfortunately I have some problems measuring distance from only one receiver. The signal which I send is a 2ms square wave, but the signal which is received is much more complex. Maybe it includes noise or other interference? Can you provide a simple program in pic basic or pic C? I just want to measure distance (for example, I have a 3m empty space and only one object - how small can this object be for the sensor to “see” it?)
There could indeed be multi-path reflexions in a small room.
What type of noice are you sensing? All signals being manipulated should be TTL so no signal noise should be noticeable. You could only get an error in the readings because of the echo but you should still get measurements.
You might need to make sure that your power supply is not noisy (most of them are). You can filter the supply noise by connecting a capacitor between V+ and GND. Also, make sure all ground signals are the same for your TTL lines.
Providing further information about your setup such as picture and a picture of the scope display would certainly be helpful in solving your problem.
Also keep in mind that the most usefull reading is the one form pin 3 (i.e. the digital signal output terminal) and you should only use the analog test pin (no. 7) when debuggind and to make sure the parameters are set correctly (i.e. operational frequency, etc)
We have invited the manufacturer to participate in this thread in order to sort this ongoing question out. Stay posted…
We have followed up with the manufacturer in order to provide an answer as soon as possible. Thanks to all for your patience.
Sean Kim from Hagisonic has asked for questions to be addressed directly to him so he can take care of them directly and as soon as possible.
The issue was resolved. If you have similar problems, you may contact him directly.
Hi,
i recently bought one of these sensors, because they are said to be very sensitive. Unfortunately i’m having troubles in getting a useful result. I’m using an avr to generate the trigger signal, about 2-3ms each 50ms. I tried to adjust the receiver gain, but there’s only a noisy signal OR no signal … I read the thread here robotshop.com/forum/showthread.php?119-Hagisonic-Ultrasonic-Sensor, seems he had the same problem …
is there already a solution for this? Or did anybody successfully use this sensor yet?
Greetz from Austria.
Thx for the fast answer,
i’m using 12V for supply, 5V for logic (trigger). Perhaps i should try the sensor outside? what about the reflexions in small rooms?
greetz.
i’m using a 220µF capacitor between +12V and GND perhaps an additional 100nF for filtering would be a good idea …
i don’t know if reflexions are really the reason for this. has anyone tried to adjust the frequency? the datasheet says this has already been fine tuned after production …
what would the output signal look like if there are multiple objects detected? according to the data sheet there will be multiple waveforms, right (perhaps there are just so many objects that i cannot see a clean single pulse)?
regards, Rainer.
perhaps i can make a photo of the oscilloscope signal …
I meet the same problems with Casmat, I use Hagisonic HG-M40DAI Ultrasonic sensor. Output signal like noise so difficult to detect obstacle. I capture output pin with oscilocope when obstacle is a flat wooden wall, the output pin have many pulse like noise. How can i solve problems?
If any one know, pls share with me. thanks in advance
Does anyone know if Sean Kim got back on the technical response as to the interfacing of these sensors?
This Hagisonic AniBat UltraSonic Sensor HG-M40DAII communicates via square wave PWM. Can you describe what you are trying to interface the Anibat with?
From the manual:
Input:The input voltage level of a pulse should be ranging from +2V to 10 V.
- The ultrasonic transmission part is driven at its rising edge whenever an input pulse is applied.
-The recommended period of input pulses ranges from 10 Hz to 50 Hz.
Output: Square Wave TTL level(5V) PWM
- The time delay of the received signals is proportional to the distance between a sensor and an obstacle.
- The pulse width tends to be proportional to the size of an obstacle.
We have updated the timing Data sheet with the most recent from Hagisonic:
robotshop.ca/content/PDF/hagisonic-anibat-data-sheet.pdf
Inside they mention:
- Please note that on over-amplification of the receiver gain, interference noise signals might be shown by ultrasonic waves passing over directly from a transmitter to a receiver.
Do you think this might be your problem?
Due to the complexity of interaction of sound waves, it is difficult to know exactly what is happening. You may be receiving echoes to the receivers which could explain the complexity of it. Have you tested it in a more “open” environment?
We are unable to locate the source code you requested.
Hi csar,
Welcome to the RobotShop Forum. Can you provide additional details of your setup? The sensor needs to be powered at between 9 and 15V which the trigger pulse, which accepts as little as 2V, works best at higher voltages up to 10V. The recommended frequency is between 10 and 50Hz (i.e. 10 to 50 per second), so a 50ms delay falls within this range. You may want to test a few ranges, and the user guide suggests a trigger pulse between 1.5 and 2.5ms.