EBM019 sensor output

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
Roger
Posts: 3
Joined: Thu Jan 26, 2017 1:13 pm
Been thanked: 1 time
Contact:

EBM019 sensor output

Post by Roger »

Dear Sirs,
I have purchased an ultrasonic sensor with a view to measuring a distance which I am testing as a stand alone unit at present
As per the datasheet I have connected 12V to pin 8 and ground to pin 2. S3 is connected to 12V to enable the unit (i.e. disable the reset on the 555 on the board). The voltage required on pin1 (Vcc) was not given on the data sheet but from the circuit it looks like 12V is ok
Operation of the unit gives the following output from S4. There is, as expected, a 40kHz triangular wave however the change in the peak value according to distance is not exactly what I expected. Pointing at the ceiling (1.7m above) the peak voltage is a steady 10V which is probably ok. with an object very close to the sensor the peak voltage is a steady is 6.6V but with an object in between the two measurements the peak voltage jumps wildly between the extremes. I was expecting the peak voltage to increase proportionally to the distance. The 12V supply is from a Maplin N27GG power supply which I have used for many other projects successfully. I have tried various capacitor values across the supply from 100nF decoupling to about 10uF without influencing the stability. Have I set it up correctly? Is my expectation of the output correct? Any suggestions?
PS. I have tried various target materials such as metal sheet, cardboard and plastic sheet
Last edited by Roger on Thu Jan 26, 2017 2:11 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EBM019 sensor output

Post by Benj »

Hello,

Pin 1 VCC should be either 3V3 or 5V, i.e. the voltage of your microcontroller. Pin 8 VPWR is the 9V - 12V input used to power the transducer.

The distance is not measured with the signal peak. It is instead the delay between sending out the ping and getting the ping back that tells you the distance.

Roger
Posts: 3
Joined: Thu Jan 26, 2017 1:13 pm
Been thanked: 1 time
Contact:

Re: EBM019 sensor output

Post by Roger »

Dear Ben,
Thank you. I am very impressed by the speed of your response
I get it now(I think)
Setting Vcc at the microprocessor voltage allows the wave to get through but clips it to prevents too high a voltage getting to the micro (I was using a 'scope so it didn't cause me a problem).
The enable on S3 starts the ping, then the time is measured to when the echo returns. This time is then used to calculate the distance

What sort of material and size is regarded as a suitable target?

Best regards, Roger

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: EBM019 sensor output

Post by LeighM »

Hi,

If you have Flowcode V6/V7 you can use the ultrasonic sensor component, which is a fairly low level interface to the EBM019 Ultrasonic sender and receiver.
The component needs some parameters setting to help detect the echo pulse, depending upon the range being detected.
For example if the object is further away then the SetPulseWidth needs to be larger to give more energy to the pulse,
and the SetDelayTime needs to be larger so that echos from close objects (including resonance of the sensor board) are ignored.
The SetDetectionValue changes the sensitivity of the detector software, the larger the value, the stronger the echo has to be before it is detected.
It needs some trial and error, depending upon the setup and surroundings.
You will get a higher amplitude echo from a larger surface area and a harder object.

There is information and a demo on the wiki here (The demo uses a pot to set the sensitivity/threshold) …
http://www.matrixtsl.com/wikiv7/index.p ... fa0edfdace

Hope that helps

Roger
Posts: 3
Joined: Thu Jan 26, 2017 1:13 pm
Been thanked: 1 time
Contact:

Re: EBM019 sensor output

Post by Roger »

Thank you for the information. I noticed the comment about SetPulseWidth and SetTimeDelay. Does this mean that the optimum values for 5cm, would be different from those for 100cm?
In terms of the target size, no problem, it would be a 60cm square block of metal weighing about 3 tonnes, however this would be moving. If the SetPulseWidth and SetTimeDelay need changing for different distances it could involve more complex programming or would your own microcontroller and program take care of this?

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: EBM019 sensor output

Post by LeighM »

The parameters usually need some adaptation depending upon the environment, but you might find reasonable compromise values for a 5-100cm range.
Given these parameters, the Flowcode component will attempt to determine the distance of the object, but your application will need to make judgements on that data, for example by comparing consecutive readings.
Note that our products are not intended for use in safety-critical applications.

Post Reply