Jump to content

Component: Sound Sensor (Grove 101020023) (101020023) (Audio): Difference between revisions

From Flowcode Help
Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray..."
 
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 14: Line 14:
==Sound Sensor (Grove 101020023) component==
==Sound Sensor (Grove 101020023) component==
The Sound sensor module is a simple microphone.  Based on the power amplifier LM386 and the electret microphone, it can be used to detect the sound strength of the environment.  
The Sound sensor module is a simple microphone.  Based on the power amplifier LM386 and the electret microphone, it can be used to detect the sound strength of the environment.  
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Sound_Sensor_Grove.fcfx FC_Comp_Source_Sound_Sensor_Grove.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Sound_Sensor_Grove.fcfx FC_Comp_Source_Sound_Sensor_Grove.fcfx]


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


''No detailed description exists yet for this component''
''No detailed description exists yet for this component''


==Examples==
==Examples==




Line 25: Line 75:




==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="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetString'''
|-
| colspan="2" | Reads the ADC as a direct voltage and returns as as tring 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Macro reference==
===GetAverageByte===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 63: Line 113:




===GetAverageInt===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 86: Line 137:




===GetByte===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetVoltage'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetByte'''
|-
|-
| colspan="2" | Reads the ADC as a direct voltage 
| colspan="2" | Blocking call to read the ADC as a byte  
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===GetInt===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 112: Line 165:




===GetString===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetByte'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetString'''
|-
|-
| colspan="2" | Blocking call to read the ADC as a byte  
| colspan="2" | Reads the ADC as a direct voltage and returns as as tring 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===GetVoltage===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetInt'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetVoltage'''
|-
|-
| colspan="2" | Blocking call to read the ADC at full bit depth  
| colspan="2" | Reads the ADC as a direct voltage 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}


==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetByte'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Tang Color
|-
| colspan="2" | Colour of the moving part of the slider. 
|-
|-
| colspan="2" | Blocking call to read the ADC as a byte  
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Marker Color
|-
|-
| colspan="2" | Colour of the marker line across the slider tang. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" | Scope Traces
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| colspan="2" | Selects if the scope traces are automatically generated or not 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
|-
| colspan="2" | Initialise the sensor configuration as set by the component properties. Sets the default intigration time and gain as well as enable the sensor. 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" | Channel
|}
|-
 
| colspan="2" | Analogue input channel - which pin is the analogue input conected to? 
 
 
 
==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" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Settings
|-
|-
|-
|-
Line 198: Line 257:
|-
|-
| colspan="2" | Maximum number of digital bits the ADC can sample. 8 bit = ADC range 0 - 255 10 bit = ADC range 0 - 1023 12 bit = ADC range 0 - 4095  
| colspan="2" | Maximum number of digital bits the ADC can sample. 8 bit = ADC range 0 - 255 10 bit = ADC range 0 - 1023 12 bit = ADC range 0 - 4095  
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| width="90%" | Channel
|-
| colspan="2" | Analogue input channel - which pin is the analogue input conected to? 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Tang Color
|-
| colspan="2" | Colour of the moving part of the slider. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Marker Color
|-
| colspan="2" | Colour of the marker line across the slider tang. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Scope Traces
|-
| colspan="2" | Selects if the scope traces are automatically generated or not 
|}
|}

Latest revision as of 10:26, 20 October 2023

Author Matrix Ltd
Version 1.0
Category Audio


Sound Sensor (Grove 101020023) component

The Sound sensor module is a simple microphone. Based on the power amplifier LM386 and the electret microphone, it can be used to detect the sound strength of the environment.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples








Macro reference

GetAverageByte

GetAverageByte
Function call to read the ADC as a byte average sample over time  
- BYTE NumSamples
 
- BYTE DelayUs
Number of micro seconds in between taking each sample 
- BYTE Return


GetAverageInt

GetAverageInt
Function call to read the ADC as a full width average sample over time  
- BYTE NumSamples
 
- BYTE DelayUs
Number of micro seconds in between taking each sample 
- UINT Return


GetByte

GetByte
Blocking call to read the ADC as a byte  
- BYTE Return


GetInt

GetInt
Blocking call to read the ADC at full bit depth  
- UINT Return


GetString

GetString
Reads the ADC as a direct voltage and returns as as tring 
- STRING Return


GetVoltage

GetVoltage
Reads the ADC as a direct voltage 
- FLOAT Return


Property reference

Properties
Simulation
Tang Color
Colour of the moving part of the slider. 
Marker Color
Colour of the marker line across the slider tang. 
Scope Traces
Selects if the scope traces are automatically generated or not 
Connections
Channel
Analogue input channel - which pin is the analogue input conected to? 
Settings
VRef voltage
Used by the GetVoltage or GetString component macros to take an ADC reading and convert it into a Voltage. +VRef voltage x 10mV Default 500 = 5.0V  
VRef option
Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage. VDD - Defines the microcontrollers power supply pin as the max reference, VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage.  
Conversion speed
Clock setting to select how fast the ADC peripheral will perform an ADC conversion. The FRC setting is based on a RC time base and so will vary with temperature and pressure. Other settings are generally based on divisions of the master clock.  
Aquisition cycles
Number of micro seconds to wait for the ACD input to charge before starting the analogue sample. 
Bit Depth
Maximum number of digital bits the ADC can sample. 8 bit = ADC range 0 - 255 10 bit = ADC range 0 - 1023 12 bit = ADC range 0 - 4095