Skip to content

Commit

Permalink
Merge pull request #4 from Sensirion/sen66_1.3.1_20241203_0956
Browse files Browse the repository at this point in the history
Generate SEN66 driver from SEN66 model version 1.3.1
  • Loading branch information
LeonieFierz authored Dec 3, 2024
2 parents e896141 + 5525eee commit db2ec94
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arduino_quality_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: sensirion/.github/.github/workflows/driver.arduino.check.yml@main
with:
expect-arduino-examples: true
lint-lib-manager-check: submit
lint-lib-manager-check: update

todo-check:
if: github.event_name == 'push' && github.ref != 'refs/head/main'
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.1] - 2024-12-1

### Fixed

- Fix naming from mass concentration to number concentration for read number concentration method (returned values were correct).
## [1.0.0] - 2024-11-25

### Added
Expand All @@ -21,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add interfaces to start, stop and read measurements.
- Add interfaces to read product name, serial number and version

[Unreleased]: https://github.com/Sensirion/arduino-i2c-sen66/compare/1.0.0...HEAD
[Unreleased]: https://github.com/Sensirion/arduino-i2c-sen66/compare/1.0.1...HEAD
[1.0.1]: https://github.com/Sensirion/arduino-i2c-sen66/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/Sensirion/arduino-i2c-sen66/compare/0.1.0...1.0.0
[0.1.0]: https://github.com/Sensirion/arduino-i2c-sen66/releases/tag/0.1.0
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ manager or `Add .ZIP Library`
#### Dependencies
* [Sensirion Core](https://github.com/Sensirion/arduino-core)

## Sensor wiring
## Connect the sensor

Use the following pin description to connect your SEN66 to the standard I²C bus of your Arduino board:

<img src="images/sen6x-pinout.png" width="300px">

| *Pin* | *Cable Color* | *Name* | *Description* | *Comments* |
|-------|---------------|:------:|----------------|------------|
| 1 | red | VDD | Supply Voltage | 3.3V ±10%
| 1 | red | VDD | Supply Voltage | 3.3V ±5%
| 2 | black | GND | Ground |
| 3 | green | SDA | I2C: Serial data input / output | TTL 5V compatible
| 4 | yellow | SCL | I2C: Serial clock input | TTL 5V compatible
| 5 | | NC | Do not connect |
| 6 | | NC | Do not connect |
| 5 | | NC | Do not connect | Ground (Pins 2 and 5 are connected internally)
| 6 | | NC | Do not connect | Supply voltage (Pins 1 and 6 are connected internally)



Expand Down Expand Up @@ -90,7 +90,6 @@ You will find pinout schematics for recommended board models below:
| SCL | 4 | yellow | A5 |



<img src="images/Arduino-Nano-i2c-pinout-3.3V.png" width="600px">
</p>
</details>
Expand Down Expand Up @@ -128,7 +127,6 @@ You will find pinout schematics for recommended board models below:
| SCL | 4 | yellow | D21/SCL |



<img src="images/Arduino-Mega-2560-Rev3-i2c-pinout-3.3V.png" width="600px">
</p>
</details>
Expand Down Expand Up @@ -158,7 +156,7 @@ You will find pinout schematics for recommended board models below:

1. Install the libraries and dependencies according to [Installation of the library](#installation-of-the-library)

2. Connect the SEN66 sensor to your Arduino as explained in [Sensor wiring](#sensor-wiring)
2. Connect the SEN66 sensor to your Arduino as explained in [Connect the sensor](#connect-the-sensor)

3. Open the `exampleUsage` sample project within the Arduino IDE:

Expand Down Expand Up @@ -193,4 +191,4 @@ they are fixed.

## License

See [LICENSE](LICENSE).
See [LICENSE](LICENSE).
2 changes: 1 addition & 1 deletion examples/exampleUsage/exampleUsage.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Generator: sensirion-driver-generator 1.0.1
* Product: sen66
* Model-Version: 1.3.0
* Model-Version: 1.3.1
*/
/*
* Copyright (c) 2024, Sensirion AG
Expand Down
6 changes: 5 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ getSerialNumber KEYWORD2
readDeviceStatus KEYWORD2
readAndClearDeviceStatus KEYWORD2
deviceReset KEYWORD2
signalMassConcentrationPm0p5 KEYWORD2
signalMassConcentrationPm1p0 KEYWORD2
signalMassConcentrationPm2p5 KEYWORD2
signalMassConcentrationPm4p0 KEYWORD2
signalMassConcentrationPm10p0 KEYWORD2
signalNumberConcentrationPm0p5 KEYWORD2
signalNumberConcentrationPm1p0 KEYWORD2
signalNumberConcentrationPm2p5 KEYWORD2
signalNumberConcentrationPm4p0 KEYWORD2
signalNumberConcentrationPm10p0 KEYWORD2
signalTemperature KEYWORD2
signalHumidity KEYWORD2
signalVocIndex KEYWORD2
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Sensirion I2C SEN66
version=1.0.0
version=1.0.1
author=Sensirion
maintainer=Sensirion
sentence=Library for the SEN66 sensor by Sensirion
Expand Down
6 changes: 3 additions & 3 deletions metadata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# driver generation metadata
generator_version: 1.0.1
model_version: 1.3.0
model_version: 1.3.1
dg_status: released
is_manually_modified: true
is_manually_modified: false
first_generated: '2024-10-30 08:14'
last_generated: '2024-11-27 07:57'
last_generated: '2024-12-03 09:56'
97 changes: 65 additions & 32 deletions src/SensirionI2cSen66.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Generator: sensirion-driver-generator 1.0.1
* Product: sen66
* Model-Version: 1.3.0
* Model-Version: 1.3.1
*/
/*
* Copyright (c) 2024, Sensirion AG
Expand Down Expand Up @@ -50,13 +50,6 @@ static uint8_t communication_buffer[48] = {0};
SensirionI2cSen66::SensirionI2cSen66() {
}

float SensirionI2cSen66::signalMassConcentrationPm0p5(
uint16_t massConcentrationPm0p5Raw) {
float massConcentrationPm0p5 = 0.0;
massConcentrationPm0p5 = massConcentrationPm0p5Raw / 10.0;
return massConcentrationPm0p5;
}

float SensirionI2cSen66::signalMassConcentrationPm1p0(
uint16_t massConcentrationPm1p0Raw) {
float massConcentrationPm1p0 = 0.0;
Expand Down Expand Up @@ -85,6 +78,41 @@ float SensirionI2cSen66::signalMassConcentrationPm10p0(
return massConcentrationPm10p0;
}

float SensirionI2cSen66::signalNumberConcentrationPm0p5(
uint16_t numberConcentrationPm0p5Raw) {
float numberConcentrationPm0p5 = 0.0;
numberConcentrationPm0p5 = numberConcentrationPm0p5Raw / 10.0;
return numberConcentrationPm0p5;
}

float SensirionI2cSen66::signalNumberConcentrationPm1p0(
uint16_t numberConcentrationPm1p0Raw) {
float numberConcentrationPm1p0 = 0.0;
numberConcentrationPm1p0 = numberConcentrationPm1p0Raw / 10.0;
return numberConcentrationPm1p0;
}

float SensirionI2cSen66::signalNumberConcentrationPm2p5(
uint16_t numberConcentrationPm2p5Raw) {
float numberConcentrationPm2p5 = 0.0;
numberConcentrationPm2p5 = numberConcentrationPm2p5Raw / 10.0;
return numberConcentrationPm2p5;
}

float SensirionI2cSen66::signalNumberConcentrationPm4p0(
uint16_t numberConcentrationPm4p0Raw) {
float numberConcentrationPm4p0 = 0.0;
numberConcentrationPm4p0 = numberConcentrationPm4p0Raw / 10.0;
return numberConcentrationPm4p0;
}

float SensirionI2cSen66::signalNumberConcentrationPm10p0(
uint16_t numberConcentrationPm10p0Raw) {
float numberConcentrationPm10p0 = 0.0;
numberConcentrationPm10p0 = numberConcentrationPm10p0Raw / 10.0;
return numberConcentrationPm10p0;
}

float SensirionI2cSen66::signalTemperature(int16_t temperatureRaw) {
float temperature = 0.0;
temperature = temperatureRaw / 200.0;
Expand Down Expand Up @@ -154,32 +182,37 @@ int16_t SensirionI2cSen66::readMeasuredValues(
}

int16_t SensirionI2cSen66::readNumberConcentrationValues(
float& massConcentrationPm0p5, float& massConcentrationPm1p0,
float& massConcentrationPm2p5, float& massConcentrationPm4p0,
float& massConcentrationPm10p0) {
uint16_t massConcentrationPm0p5Raw = 0;
uint16_t massConcentrationPm1p0Raw = 0;
uint16_t massConcentrationPm2p5Raw = 0;
uint16_t massConcentrationPm4p0Raw = 0;
uint16_t massConcentrationPm10p0Raw = 0;
float& numberConcentrationPm0p5, float& numberConcentrationPm1p0,
float& numberConcentrationPm2p5, float& numberConcentrationPm4p0,
float& numberConcentrationPm10p0) {
uint16_t numberConcentrationPm0p5Raw = 0;
uint16_t numberConcentrationPm1p0Raw = 0;
uint16_t numberConcentrationPm2p5Raw = 0;
uint16_t numberConcentrationPm4p0Raw = 0;
uint16_t numberConcentrationPm10p0Raw = 0;
int16_t localError = 0;
localError = readNumberConcentrationValuesAsIntegers(
massConcentrationPm0p5Raw, massConcentrationPm1p0Raw,
massConcentrationPm2p5Raw, massConcentrationPm4p0Raw,
massConcentrationPm10p0Raw);
if (localError != NO_ERROR) {
return localError;
}
massConcentrationPm0p5 = SensirionI2cSen66::signalMassConcentrationPm0p5(
massConcentrationPm0p5Raw);
massConcentrationPm1p0 = SensirionI2cSen66::signalMassConcentrationPm1p0(
massConcentrationPm1p0Raw);
massConcentrationPm2p5 = SensirionI2cSen66::signalMassConcentrationPm2p5(
massConcentrationPm2p5Raw);
massConcentrationPm4p0 = SensirionI2cSen66::signalMassConcentrationPm4p0(
massConcentrationPm4p0Raw);
massConcentrationPm10p0 = SensirionI2cSen66::signalMassConcentrationPm10p0(
massConcentrationPm10p0Raw);
numberConcentrationPm0p5Raw, numberConcentrationPm1p0Raw,
numberConcentrationPm2p5Raw, numberConcentrationPm4p0Raw,
numberConcentrationPm10p0Raw);
if (localError != NO_ERROR) {
return localError;
}
numberConcentrationPm0p5 =
SensirionI2cSen66::signalNumberConcentrationPm0p5(
numberConcentrationPm0p5Raw);
numberConcentrationPm1p0 =
SensirionI2cSen66::signalNumberConcentrationPm1p0(
numberConcentrationPm1p0Raw);
numberConcentrationPm2p5 =
SensirionI2cSen66::signalNumberConcentrationPm2p5(
numberConcentrationPm2p5Raw);
numberConcentrationPm4p0 =
SensirionI2cSen66::signalNumberConcentrationPm4p0(
numberConcentrationPm4p0Raw);
numberConcentrationPm10p0 =
SensirionI2cSen66::signalNumberConcentrationPm10p0(
numberConcentrationPm10p0Raw);
return localError;
}

Expand Down
Loading

0 comments on commit db2ec94

Please sign in to comment.