Jump to content

Component: Ultrasonic Ranger (Grove 101020010) (101020010) (Audio): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(20 intermediate revisions by 3 users not shown)
Line 15: Line 15:
The ultrasonic sensor is a non-contact distance measurement module.  It's designed for easy modular project usage with industrial performance. Detecting range: 3cm to 4m, best in 30 degree angle.
The ultrasonic sensor is a non-contact distance measurement module.  It's designed for easy modular project usage with industrial performance. Detecting range: 3cm to 4m, best in 30 degree angle.


==Detailed description==
==Component Source Code==
 
 
 


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


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


==Detailed description==


''No detailed description exists yet for this component''
''No detailed description exists yet for this component''
Line 27: Line 27:
==Examples==
==Examples==


This example performs an ultrasonic range sample using a hardware timer and then converts the sample from a timing into a measurement in millimetres, centimeters and inches.


{{Fcfile|Ultrasound_Test.fcfx|Ultrasound Test}}


==Macro reference==


 
===MeasureDistance===
 
{| class="mtx-class-macrotable wikitable"
 
 
 
This example performs an ultrasonic range sample and then converts the sample from a timing into a measurement in millimetres.
 
{{Fcfile|UltraSound_Test.fcfx|UltraSound Test}}
 
==Downloadable 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="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForEcho'''
| width="90%" class="mtx-class-macrohead" | '''MeasureDistance'''
|-
| colspan="2" | Waits until the echo has been received from the Ping macro allowing you to perform your own timing. 
|-
|-
| 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;" | '''MeasureDistance'''
|-
|-
| colspan="2" | Converts a micro second time from the ultrasonic range sensor and returns the range in mm, cm or inches. 
| colspan="2" | Converts a micro second time from the ultrasonic range sensor and returns the range in mm, cm or inches. 
Line 77: Line 57:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Ping===
{| 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;" | '''Ping'''
| width="90%" class="mtx-class-macrohead" | '''Ping'''
|-
|-
| colspan="2" | Performs a transmit ping allowing you to monitor the incoming signal and perform your own timings maybe using a rising edge interrupt and a timer. 
| colspan="2" | Performs a transmit ping allowing you to monitor the incoming signal and perform your own timings maybe using a rising edge interrupt and a timer. 
Line 90: Line 71:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SampleSensor===
{| 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;" | '''SampleSensor'''
| width="90%" class="mtx-class-macrohead" | '''SampleSensor'''
|-
|-
| colspan="2" | Sends out an ultrasonic ping and times how long it takes to receive the echo. Returns the time in microseconds. Performs the timing using software so depending on the speed of the micro will be an approximation. For better results use the Ping macro. 
| colspan="2" | Sends out an ultrasonic ping and times how long it takes to receive the echo. Returns the time in microseconds. Performs the timing using software so depending on the speed of the micro will be an approximation. For better results use the Ping macro. 
Line 103: Line 85:




===WaitForEcho===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''WaitForEcho'''
|-
| colspan="2" | Waits until the echo has been received from the Ping macro allowing you to perform your own timing. 
|-
|-
| 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" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" class="mtx-class-macrohead" | '''Properties'''
|-
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Control Pin
|-
| colspan="2" | Pin connected to the emitter of the sensor. 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| width="90%" class="mtx-class-propfolder" | Measurement
|-
|-
|-
|-
Line 117: Line 124:
|-
|-
| colspan="2" | Controls how the sensors ultrasonic ping is timed, Either using single microsecond delays or using timer hardware. On slower devices e.g. PIC it is advisable to use the Timer method. 
| colspan="2" | Controls how the sensors ultrasonic ping is timed, Either using single microsecond delays or using timer hardware. On slower devices e.g. PIC it is advisable to use the Timer method. 
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Timer Properties
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Line 123: Line 134:
| colspan="2" | Timer Peripheral to use to monitor the passage of time. 
| colspan="2" | Timer Peripheral to use to monitor the passage of time. 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Control Pin
|-
| colspan="2" | Pin connected to the emitter of the sensor. 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix Ltd
Version 1.0
Category Audio


Ultrasonic Ranger (Grove 101020010) component

The ultrasonic sensor is a non-contact distance measurement module. It's designed for easy modular project usage with industrial performance. Detecting range: 3cm to 4m, best in 30 degree angle.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

This example performs an ultrasonic range sample using a hardware timer and then converts the sample from a timing into a measurement in millimetres, centimeters and inches.

Ultrasound Test

Macro reference

MeasureDistance

MeasureDistance
Converts a micro second time from the ultrasonic range sensor and returns the range in mm, cm or inches. 
- UINT TimeDelay
Microsecond reading from Ultrasound module 
- BYTE Scale
0=MM / 1=CM / 2=Inch 
- UINT Return


Ping

Ping
Performs a transmit ping allowing you to monitor the incoming signal and perform your own timings maybe using a rising edge interrupt and a timer. 
- VOID Return


SampleSensor

SampleSensor
Sends out an ultrasonic ping and times how long it takes to receive the echo. Returns the time in microseconds. Performs the timing using software so depending on the speed of the micro will be an approximation. For better results use the Ping macro. 
- UINT Return


WaitForEcho

WaitForEcho
Waits until the echo has been received from the Ping macro allowing you to perform your own timing. 
- VOID Return


Property reference

Properties
Connections
Control Pin
Pin connected to the emitter of the sensor. 
Measurement
Time Measurement
Controls how the sensors ultrasonic ping is timed, Either using single microsecond delays or using timer hardware. On slower devices e.g. PIC it is advisable to use the Timer method. 
Timer Properties
Timer
Timer Peripheral to use to monitor the passage of time. 
Simulation
Discrete Distance
Simulation range used to determine if the sense pin is active or not.