Added a GPIO to power on/off for external I2C sensor(s) (with LEDs)
Dependencies: UniGraphic mbed vt100
PSE530 Class Reference
PSE530 Pressure Sensor. More...
#include <PSE530.h>
Public Member Functions | |
| PSE530 (AnalogIn *ain) | |
| Constructor. | |
| ~PSE530 (void) | |
| destructor | |
| float | getPressure (void) |
| getPressure | |
Detailed Description
PSE530 Pressure Sensor.
Definition at line 9 of file PSE530.h.
Constructor & Destructor Documentation
| PSE530 | ( | AnalogIn * | ain ) |
Constructor.
SMC PSE530 pressure sensor analog output 1.0V - 5.0V 1.0V : 0 5.0V : 1MPa (at 0.6V : -0.1MPa) Our sensor I/F converts 0-5V to 0-3V So we suppose V = Analog Float Value : Pressure 0.6V = 0.2 : 0 3.0V = 1.0 : 1MPa.
conversion from Pa to kgf/cm2 98,066.5 Pa = 1 kgf/cm2 1 Pa = 1 / 98066.6 kgf/cm2
Definition at line 22 of file PSE530.cpp.
| ~PSE530 | ( | void | ) |
destructor
Definition at line 27 of file PSE530.cpp.
Member Function Documentation
| float getPressure | ( | void | ) |
getPressure
On FRDM-KL25Z ADC's AREF is about 3.28V Where the converted pressure output is 0 to 3.21V So we must map ADC output 0 to 3.21/3.28 as full scale.
- Returns:
- float pressure in kgf/cm2
Then according to the datasheet of PSE530 when full range is 0V to 5V 1V is 0 and 5V is 1MPa which is converted to 0.642/3.28 to 3.21/3.28 ~ 0.195731 to 0.9786585. The linear equation of y = a x + b 0 = a * 0.195731 + b 1 = a * 0.978658 + b results a = 1.277, b = -0.250
Definition at line 49 of file PSE530.cpp.
Generated on Wed Jul 13 2022 12:25:10 by
1.7.2
La Suno