Hawk - I²C SFA30 Formaldehyde Sensor Integration
Table of Contents
Below are instructions for the I2C SFA30 Formaldehyde Sensor
Wiring
The sensor should have 4 wires.
VCC - Power line
SCL - Clock Line
SDA - Data Line
GND - Ground
Wire the appropriate wires into the appropriate IOs on the specific board of interest.
|
Agtech1 |
Bluetooth+ |
3v3 |
Hawk IO 5 |
Hawk IO 7 |
SCL |
Hawk IO 6 |
Hawk IO 5 |
SDA |
Hawk IO 4 |
Hawk IO 6 |
GND |
Hawk GND |
Hawk GND |
Device Manager
This formaldehyde sensor takes 10s to warm up and for the readings to stabilize.
The sensor takes measurements every 0.5s.
When the device requests a reading, the sensor will return an average since the last reading request.
If the last request was more than a minute ago, the sensor returns a reading of approximately the last minute.
I2C Action params

Sensor Parameter 1 - Warmup time (s).
The device waits this long after powering the sensor, then does a reading to clear measurements during the power-up time (e.g. 10s).
Sensor Parameter 2 - Sampling time (s)
After doing reading 1, the device waits this amount of time. Then does another reading. The results of this second reading are logged.
E.g. Param1 = 10s, param2 = 5s. Warmup for 10s (required for formaldehyde reading) then sample for 5s and log the result (average of the 5s of sampling).
Alternate configuration
If Param1 is set to 0 and '3v3 always on' parameter is set to true, the device will skip the warmup and sampling times and just immediately do reading 2. The result will be the average from the last 60s or the average since the last time this action was run.