Difference between revisions of "Component: Barometer (MS5637) (Environmental)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
 
 
(15 intermediate revisions by the same user not shown)
Line 12: Line 12:
  
  
==Barometer component==
+
==Barometer (MS5637) component==
 
A small PCB surface mount barometric pressure sensor with a I2C bus interface. Pressure range 0 to 30 Bar. Temperature range -20 to +85 °C.
 
A small PCB surface mount barometric pressure sensor with a I2C bus interface. Pressure range 0 to 30 Bar. Temperature range -20 to +85 °C.
 +
 +
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Pressure_Sensor_MS5637.fcfx FC_Comp_Source_Pressure_Sensor_MS5637.fcfx]
 +
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Pressure_Sensor_MS5637.fcfx FC_Comp_Source_Pressure_Sensor_MS5637.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 79:
  
  
==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;" | '''ReadPressureFloat'''
 
|-
 
| colspan="2" | Reads the pressure as a floating point value in Bars. Resultion sets the return bit value and conversion time. Calls the ReadPressureRaw function and then converts to a meaningful value. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Resolution
 
|-
 
| colspan="2" | Range 0-5 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
 +
 +
 +
 +
 +
 +
 +
 +
==Macro reference==
 +
 +
===Initialise===
 
{| 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;" | '''Reset'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Resets the device 
+
| colspan="2" | Stes up the I2C bus and initialises the termperature sensor ready for use. 
 
|-
 
|-
 
|-
 
|-
Line 58: Line 105:
  
  
 +
===ReadPROM===
 
{| 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;" | '''ReadTemperatureFloat'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPROM'''
 
|-
 
|-
| colspan="2" | Reads the temperature as a floating point value in °C. Resultion sets the return bit value and conversion time. Calls the ReadTemperatureRaw function and then converts to a meaningful value. 
+
| colspan="2" | Reads a single 16-bit value from the PROM calibration data. 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Resolution
+
| width="90%" | Address
 
|-
 
|-
| colspan="2" | Range 0-5 
+
| colspan="2" | Range 0-6 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ReadPressureFloat===
 
{| 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;" | '''ReadPressureRaw'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPressureFloat'''
 
|-
 
|-
| colspan="2" | Reads the pressure as a digital 32-bit value. Resultion sets the return bit value and conversion time. 0=0.11mBar / 1=0.062mBar / 2=0.039mBar 3=0.028mBar / 4=0.021mBar / 5=0.016mBar 
+
| colspan="2" | Reads the pressure as a floating point value in Bars. Resultion sets the return bit value and conversion time. Calls the ReadPressureRaw function and then converts to a meaningful value. 
 
|-
 
|-
 
|-
 
|-
Line 89: Line 138:
 
| colspan="2" | Range 0-5 
 
| colspan="2" | Range 0-5 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
+
| 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''
 
|}
 
|}
  
  
 +
===ReadPressureRaw===
 
{| 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;" | '''ReadTemperatureRaw'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPressureRaw'''
 
|-
 
|-
| colspan="2" | Reads the temperature as a digital 32-bit value. Resultion sets the return bit value and conversion time. 0=0.012°C / 1=0.009°C / 2=0.006°C 3=0.004°C / 4=0.003°C / 5=0.002°C 
+
| colspan="2" | Reads the pressure as a digital 32-bit value. Resultion sets the return bit value and conversion time. 0=0.11mBar / 1=0.062mBar / 2=0.039mBar 3=0.028mBar / 4=0.021mBar / 5=0.016mBar 
 
|-
 
|-
 
|-
 
|-
Line 107: Line 157:
 
| colspan="2" | Range 0-5 
 
| colspan="2" | Range 0-5 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ReadTemperatureFloat===
 
{| 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;" | '''ReadPROM'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadTemperatureFloat'''
 
|-
 
|-
| colspan="2" | Reads a single 16-bit value from the PROM calibration data. 
+
| colspan="2" | Reads the temperature as a floating point value in °C. Resultion sets the return bit value and conversion time. Calls the ReadTemperatureRaw function and then converts to a meaningful value. 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
+
| width="90%" | Resolution
 
|-
 
|-
| colspan="2" | Range 0-6 
+
| colspan="2" | Range 0-5 
 
|-
 
|-
| 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''
 
|}
 
|}
  
  
 +
===ReadTemperatureRaw===
 
{| 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;" | '''Initialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadTemperatureRaw'''
 
|-
 
|-
| colspan="2" | Stes up the I2C bus and initialises the termperature sensor ready for use. 
+
| colspan="2" | Reads the temperature as a digital 32-bit value. Resultion sets the return bit value and conversion time. 0=0.012°C / 1=0.009°C / 2=0.006°C 3=0.004°C / 4=0.003°C / 5=0.002°C 
|-
 
|-
 
| 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;" | '''ReadRegister'''
 
|-
 
| colspan="2" | Reads a byte from a register 
 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
+
| width="90%" | Resolution
 
|-
 
|-
| colspan="2" |  
+
| colspan="2" | Range 0-5 
 
|-
 
|-
| 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-s32-icon.png]] - LONG
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Reset===
 
{| 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;" | '''WriteRegister'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reset'''
 
|-
 
|-
| colspan="2" | Writes a byte to a register 
+
| colspan="2" | Resets the device 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| 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''
 
| 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" | Starts up the I2C ready to communicate with the sensor. Sets the selected rates and operational mode. Returns 1 if the sensor has been found and initialised. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
  
  
Line 205: Line 220:
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
 
| 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;" | I2C Properties
 
|-
 
|-
 
|-
 
|-
Line 237: Line 256:
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Scope Traces
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
 
| colspan="2" | Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Console Data
 
|-
 
| colspan="2" | Selects if the console data is automatically generated or not 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Injector
 
|-
 
| colspan="2" | Specifies the injector component on the panel to interact with to provide comms simulation. 
 
|-
 
| 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" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
 
|-
 
|-
 
|-
 
|-

Latest revision as of 13:12, 7 February 2023

Author Matrix TSL
Version 1.0
Category Environmental


Barometer (MS5637) component

A small PCB surface mount barometric pressure sensor with a I2C bus interface. Pressure range 0 to 30 Bar. Temperature range -20 to +85 °C.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

Initialise

Fc9-comp-macro.png Initialise
Stes up the I2C bus and initialises the termperature sensor ready for use. 
Fc9-void-icon.png - VOID Return


ReadPROM

Fc9-comp-macro.png ReadPROM
Reads a single 16-bit value from the PROM calibration data. 
Fc9-u8-icon.png - BYTE Address
Range 0-6 
Fc9-u16-icon.png - UINT Return


ReadPressureFloat

Fc9-comp-macro.png ReadPressureFloat
Reads the pressure as a floating point value in Bars. Resultion sets the return bit value and conversion time. Calls the ReadPressureRaw function and then converts to a meaningful value. 
Fc9-u8-icon.png - BYTE Resolution
Range 0-5 
Fc9-f32-icon.png - FLOAT Return


ReadPressureRaw

Fc9-comp-macro.png ReadPressureRaw
Reads the pressure as a digital 32-bit value. Resultion sets the return bit value and conversion time. 0=0.11mBar / 1=0.062mBar / 2=0.039mBar 3=0.028mBar / 4=0.021mBar / 5=0.016mBar 
Fc9-u8-icon.png - BYTE Resolution
Range 0-5 
Fc9-u32-icon.png - ULONG Return


ReadTemperatureFloat

Fc9-comp-macro.png ReadTemperatureFloat
Reads the temperature as a floating point value in °C. Resultion sets the return bit value and conversion time. Calls the ReadTemperatureRaw function and then converts to a meaningful value. 
Fc9-u8-icon.png - BYTE Resolution
Range 0-5 
Fc9-f32-icon.png - FLOAT Return


ReadTemperatureRaw

Fc9-comp-macro.png ReadTemperatureRaw
Reads the temperature as a digital 32-bit value. Resultion sets the return bit value and conversion time. 0=0.012°C / 1=0.009°C / 2=0.006°C 3=0.004°C / 4=0.003°C / 5=0.002°C 
Fc9-u8-icon.png - BYTE Resolution
Range 0-5 
Fc9-s32-icon.png - LONG Return


Reset

Fc9-comp-macro.png Reset
Resets the device 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png I2C Properties
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms
Allows the simulation data to come from the panel GUI or relayed via an injector component.