SparkFun Weather Shield
For use with Johnny-Five.
-
SparkFun Weather Shield
DEV-13956
,13956
(Current)- Humidity/Temperature Sensor - Si7021
- Barometric Pressure - MPL3115A2
- Light Sensor - ALS-PT19
-
SparkFun Weather Shield
DEV-12081
,12081
(Retired)- Humidity/Temperature Sensor - HTU21D
- Barometric Pressure - MPL3115A2
- Light Sensor - ALS-PT19
-
SparkFun Photon Weather Shield
DEV-13674
,13674
(Current)- Humidity/Temperature Sensor - Si7021
- Barometric Pressure - MPL3115A2
-
SparkFun Photon Weather Shield
DEV-13630
,13630
(Retired)- Humidity/Temperature Sensor - HTU21D
- Barometric Pressure - MPL3115A2
API & Documentation
For use with Particle Photon:
npm install johnny-five particle-io j5-sparkfun-weather-shield
For use with Arduino:
npm install johnny-five j5-sparkfun-weather-shield
Weather
The Weather
class constructs objects that represent the built-in components of the shield.
-
Explicit Initialization, defaults "data" to 25ms intervals
const weather =variant: "DEV-13956";...or...const weather =variant: "DEV-13674"; -
Explicit Initialization, specify "data" to 200ms intervals
const weather =variant: "DEV-13956"period: 200;...or...const weather =variant: "DEV-13674"period: 200;
Parameters
Property | Type | Value(s)/Description | Default | Required | Version |
---|---|---|---|---|---|
variant |
string | "ARDUINO" , "PHOTON" |
no | yes | v0.1.0-v1.0.0 |
variant |
string or number | See Variants | no | yes | v2.0.0+ |
elevation |
number | Base elevation in meters (You can use whatismyelevation.com to find out the base elevation for your location) | yes * | yes | |
freq |
number | Use period |
25 (ms) |
no | v0.1.0-v1.0.0 |
period |
number | Milliseconds. The rate in milliseconds to emit the data event | 25 (ms) |
no | v2.0.0+ |
* If elevation
is omitted, the value of the feet
and meters
properties will be null
. When elevation
is included, there is a 3 second calibration window before all values are reported.
Variants
Shield | Product Name | Variant Values | Retired ? |
---|---|---|---|
SparkFun Weather Shield | "DEV-13956" , "DEV13956" , 13956 |
No | |
SparkFun Weather Shield | "DEV-12081" , "DEV12081" , 12081 |
Yes | |
SparkFun Photon Weather Shield | "DEV-13674" , "DEV13674" , 13674 |
No | |
SparkFun Photon Weather Shield | "DEV-13630" , "DEV13630" , 13630 |
Yes |
Using the Arduino shield
(Without a specified elevation
)
const five = ;const Weather = five;const board = ; board;
(With a specified elevation
)
const five = ;const Weather = five;const board = ; board;
Using the Photon shield
(Without a specified elevation
)
const Particle = ;const five = ;const Weather = five;const board = io: token: processenvPARTICLE_TOKEN deviceId: processenvPARTICLE_PHOTON_DEVICE_ID ; board;
(With a specified elevation
)
const Particle = ;const five = ;const Weather = five;const board = io: token: processenvPARTICLE_TOKEN deviceId: processenvPARTICLE_PHOTON_DEVICE_ID ; board;
Convenient serialization for data payloads:
const weather = variant: ...; weather;
Produces:
{
"celsius": 24,
"fahrenheit": 75.2,
"kelvin": 297.15,
"pressure": 125.5,
"feet": 3.28,
"meters": 1,
"relativeHumidity": 48,
"lightLevel": 50
}
Since the Photon shield does not include the
ALS-PT19
light sensor, thelightLevel
property will always benull
for that variant.
NOTE
The examples shown here are provided for illustration and do no specifically indicate variant support. This component class is expected to work with any variant that has I2C support.