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

From Flowcode Help
Jump to navigationJump to search
(XML import - Pre 8.0 release)
 
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| EBM Modules
 
| 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.
  
==[[File:Component Icon feb064a2_e087_45e1_a7f9_c9fa0edfdace.png|Image]] Ultrasonic (EBM019) component==
+
==Component Source Code==
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.
 
  
==Examples==
+
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]
''<span style="color:red;">No additional examples</span>''
 
  
 +
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]
  
==Downloadable macro reference==
+
==Detailed description==
  
===<span style="font-weight: normal;"><u><tt>GetDistance</tt></u></span>===
 
Sends a pulse and processes the echo.
 
  
Returns a object distance in cm
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|UINT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>SetDelayTime</tt></u></span>===
 
Set the delay time before sampling for the echo, in microseconds
 
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''delay''
 
::delay time in microseconds
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
 +
''No detailed description exists yet for this component''
  
===<span style="font-weight: normal;"><u><tt>SetDetectionValue</tt></u></span>===
+
==Examples==
Set the delta value for echo detection
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''value''
 
::trigger point for echo detection
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>SetPulseWidth</tt></u></span>===
 
Set the output pulse width, in microsecond (0-255uS)
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''pulse''
 
::width of pulse in microseconds
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Setup the device.
 
  
This sets the control output to logic 0
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
Sample program using the EBM019 - Ultrasonic sensor.
  
 +
Sends out a pulse and determines distance from time taken to receive reflection.
  
'''Return value'''
+
{{Fcfile|EBM019 - Test Program.fcfx|EBM019 Example}}
  
:''This call does not return a value''
 
  
  
  
==Simulation macro reference==
 
  
''This component does not contain any simulation macros''
 
  
  
==Property reference==
 
<span style="font-weight: normal;"><u>Output Pulse Pin</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''OPP''.
 
  
Pin used for controlling the output pulse
 
  
<span style="font-weight: normal;"><u>Echo ADC channel</u></span>
 
  
This property is of type ''Single analog pin'' and can be referenced with the variable name ''ECHO''.
 
  
ADC channel used to monitor the echo
+
==Macro reference==
  
<span style="font-weight: normal;"><u>Pulse Width (uS)</u></span>
+
===GetDistance===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 
 +
 
 +
===Initialise===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''PULSE''.
 
  
Output ultrasonic pulse width in microseconds
+
===SetDelayTime===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | delay
 +
|-
 +
| colspan="2" | delay time in microseconds&nbsp;
 +
|-
 +
| 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''
 +
|}
  
<span style="font-weight: normal;"><u>Read Delay (uS)</u></span>
 
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''DELAY''.
+
===SetDetectionValue===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | value
 +
|-
 +
| colspan="2" | trigger point for echo detection&nbsp;
 +
|-
 +
| 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''
 +
|}
  
Time delay in microseconds before sampling for echo
 
  
<span style="font-weight: normal;"><u>Pulse Detection Value</u></span>
+
===SetPulseWidth===
 +
{| 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)&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | pulse
 +
|-
 +
| colspan="2" | width of pulse in microseconds&nbsp;
 +
|-
 +
| 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''
 +
|}
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''THRESHOLD''.
 
  
Detection ADC delta trigger value
+
==Property reference==
  
A lower value is more sensitive
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
 +
| width="90%" | Echo ADC channel
 +
|-
 +
| colspan="2" | ADC channel used to monitor the echo&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Pulse Width (uS)
 +
|-
 +
| colspan="2" | Output ultrasonic pulse width in microseconds&nbsp;
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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&nbsp;
 +
|}

Latest revision as of 13:09, 7 February 2023

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.

FC6 Icon.png EBM019 Example







Macro reference

GetDistance

Fc9-comp-macro.png GetDistance
Sends a pulse and processes the echo. Returns a object distance in cm 
Fc9-u16-icon.png - UINT Return


Initialise

Fc9-comp-macro.png Initialise
Setup the device. This sets the control output to logic 0 
Fc9-void-icon.png - VOID Return


SetDelayTime

Fc9-comp-macro.png SetDelayTime
Set the delay time before sampling for the echo, in microseconds 
Fc9-u16-icon.png - UINT delay
delay time in microseconds 
Fc9-void-icon.png - VOID Return


SetDetectionValue

Fc9-comp-macro.png SetDetectionValue
Set the delta value for echo detection 
Fc9-u8-icon.png - BYTE value
trigger point for echo detection 
Fc9-void-icon.png - VOID Return


SetPulseWidth

Fc9-comp-macro.png SetPulseWidth
Set the output pulse width, in microsecond (0-255uS) 
Fc9-u8-icon.png - BYTE pulse
width of pulse in microseconds 
Fc9-void-icon.png - VOID Return


Property reference

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