Jump to content

Component: Ultrasonic (EBM019) (EBM Modules): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(9 intermediate revisions by 2 users not shown)
Line 17: Line 17:
==Component Source Code==
==Component Source Code==


Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_EBM019v1.fcfx FC_Comp_Source_EBM019v1.fcfx]
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBM019v1.fcfx FC_Comp_Source_EBM019v1.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBM019v1.fcfx FC_Comp_Source_EBM019v1.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBM019v1.fcfx FC_Comp_Source_EBM019v1.fcfx]


==Detailed description==
==Detailed description==




Line 49: Line 53:




Sample program using the EBM019 - Ultrasonic sensor.


Sends out a pulse and determines distance from time taken to receive reflection.


{{Fcfile|EBM019 - Test Program.fcfx|EBM019 Example}}




==Macro reference==
Sample program using the EBM019 - Ultrasonic sensor.


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Sends out a pulse and determines distance from time taken to receive reflection.
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistance'''
|-
| colspan="2" | Sends a pulse and processes the echo. Returns a object distance in cm 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


{{Fcfile|EBM019 - Test Program.fcfx|EBM019 Example}}


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDelayTime'''
|-
| colspan="2" | Set the delay time before sampling for the echo, in microseconds 
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | delay
|-
| colspan="2" | delay time in microseconds 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDetectionValue'''
|-
| colspan="2" | Set the delta value for echo detection 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | value
|-
| colspan="2" | trigger point for echo detection 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPulseWidth'''
|-
| colspan="2" | Set the output pulse width, in microsecond (0-255uS) 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | pulse
|-
| colspan="2" | width of pulse in microseconds 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Setup the device. This sets the control output to logic 0 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}








==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
==Macro reference==
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Output Pulse Pin
|-
| colspan="2" | Pin used for controlling the output pulse 
|-
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| width="90%" | Echo ADC channel
|-
| colspan="2" | ADC channel used to monitor the echo 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Pulse Width (uS)
|-
| colspan="2" | Output ultrasonic pulse width in microseconds 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Read Delay (uS)
|-
| colspan="2" | Time delay in microseconds before sampling for echo 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Pulse Detection Value
|-
| colspan="2" | Detection ADC delta trigger value A lower value is more sensitive 
|}==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetDistance===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistance'''
| width="90%" class="mtx-class-macrohead" | '''GetDistance'''
|-
|-
| colspan="2" | Sends a pulse and processes the echo. Returns a object distance in cm 
| colspan="2" | Sends a pulse and processes the echo. Returns a object distance in cm 
Line 187: Line 90:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Initialise===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDelayTime'''
|-
| colspan="2" | Set the delay time before sampling for the echo, in microseconds 
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | delay
|-
| colspan="2" | delay time in microseconds 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDetectionValue'''
|-
| colspan="2" | Set the delta value for echo detection 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | value
|-
| colspan="2" | trigger point for echo detection 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPulseWidth'''
|-
| colspan="2" | Set the output pulse width, in microsecond (0-255uS) 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | pulse
|-
| colspan="2" | width of pulse in microseconds 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Setup the device. This sets the control output to logic 0 
| colspan="2" | Setup the device. This sets the control output to logic 0 
Line 254: Line 104:




 
===SetDelayTime===
 
{| class="mtx-class-macrotable wikitable"
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| width="90%" class="mtx-class-macrohead" | '''SetDelayTime'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Output Pulse Pin
|-
| colspan="2" | Pin used for controlling the output pulse 
|-
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| width="90%" | Echo ADC channel
|-
| colspan="2" | ADC channel used to monitor the echo 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Pulse Width (uS)
|-
| colspan="2" | Output ultrasonic pulse width in microseconds 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Read Delay (uS)
|-
| colspan="2" | Time delay in microseconds before sampling for echo 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Pulse Detection Value
|-
| colspan="2" | Detection ADC delta trigger value A lower value is more sensitive 
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistance'''
|-
| colspan="2" | Sends a pulse and processes the echo. Returns a object distance in cm 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDelayTime'''
|-
|-
| colspan="2" | Set the delay time before sampling for the echo, in microseconds 
| colspan="2" | Set the delay time before sampling for the echo, in microseconds 
Line 321: Line 123:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetDetectionValue===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDetectionValue'''
| width="90%" class="mtx-class-macrohead" | '''SetDetectionValue'''
|-
|-
| colspan="2" | Set the delta value for echo detection 
| colspan="2" | Set the delta value for echo detection 
Line 339: Line 142:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetPulseWidth===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPulseWidth'''
| width="90%" class="mtx-class-macrohead" | '''SetPulseWidth'''
|-
|-
| colspan="2" | Set the output pulse width, in microsecond (0-255uS) 
| colspan="2" | Set the output pulse width, in microsecond (0-255uS) 
Line 355: Line 159:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Setup the device. This sets the control output to logic 0 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Latest revision as of 14:23, 13 July 2026

Author Matrix TSL
Version 1.0
Category EBM Modules


Ultrasonic component

This board has both an ultrasonic transmitter and receiver. The transmitter is driven by an on-board 40KHz oscillator which is enabled by the host microprocessor. The receiving sensor signal is amplified and provided as an analogue signal to be processed by a single channel ADC of the microprocessor. By measuring the time delay between enabling a transmit pulse and receiving an echo the distance of objects in a range of around 3cm to 3m can be determined.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_EBM019v1.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_EBM019v1.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Sample program using the EBM019 - Ultrasonic sensor.

Sends out a pulse and determines distance from time taken to receive reflection.

EBM019 Example







Macro reference

GetDistance

GetDistance
Sends a pulse and processes the echo. Returns a object distance in cm 
- UINT Return


Initialise

Initialise
Setup the device. This sets the control output to logic 0 
- VOID Return


SetDelayTime

SetDelayTime
Set the delay time before sampling for the echo, in microseconds 
- UINT delay
delay time in microseconds 
- VOID Return


SetDetectionValue

SetDetectionValue
Set the delta value for echo detection 
- BYTE value
trigger point for echo detection 
- VOID Return


SetPulseWidth

SetPulseWidth
Set the output pulse width, in microsecond (0-255uS) 
- BYTE pulse
width of pulse in microseconds 
- VOID Return


Property reference

Properties
Output Pulse Pin
Pin used for controlling the output pulse 
Echo ADC channel
ADC channel used to monitor the echo 
Pulse Width (uS)
Output ultrasonic pulse width in microseconds 
Read Delay (uS)
Time delay in microseconds before sampling for echo 
Pulse Detection Value
Detection ADC delta trigger value A lower value is more sensitive