0.1.2 MTP40F

This commit is contained in:
Rob Tillaart 2023-11-14 16:44:34 +01:00
parent 9bff659775
commit 9017ded7ae
7 changed files with 43 additions and 29 deletions

View File

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.2] - 2023-11-14
- update readme.md
## [0.1.1] - 2023-08-02
- fix **getGasConcentration()** status handling
- update readme.md
@ -16,7 +20,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- add default value to **setSelfCalibrationHours(hours = 168)**
- update examples
## [0.1.0] - 2023-07-25
- initial version.

View File

@ -2,7 +2,7 @@
// FILE: MTP40F.cpp
// AUTHOR: Rob Tillaart
// DATE: 2023-07-25
// VERSION: 0.1.1
// VERSION: 0.1.2
// PURPOSE: Arduino library for MTP40F CO2 sensor
// URL: https://github.com/RobTillaart/MTP40F
@ -211,7 +211,7 @@ int MTP40F::lastError()
//////////////////////////////////////////////////////////////////////
//
// PRIVATE
// PROTECTED
//
bool MTP40F::request(uint8_t *data, uint8_t commandLength, uint8_t responseLength)
{

View File

@ -3,7 +3,7 @@
// FILE: MTP40F.h
// AUTHOR: Rob Tillaart
// DATE: 2023-07-25
// VERSION: 0.1.1
// VERSION: 0.1.2
// PURPOSE: Arduino library for MTP40F CO2 sensor
// URL: https://github.com/RobTillaart/MTP40F
@ -11,7 +11,7 @@
#include "Arduino.h"
#define MTP40F_LIB_VERSION (F("0.1.1"))
#define MTP40F_LIB_VERSION (F("0.1.2"))
#define MTP40F_DEFAULT_ADDRESS 0x64
@ -64,8 +64,9 @@ public:
//////////////////////////////////////////////////////
//
// PROTECTED
//
protected:
Stream * _ser;
uint8_t _buffer[16];

View File

@ -1,9 +1,12 @@
[![Arduino CI](https://github.com/RobTillaart/MTP40F/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![JSON check](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml)
[![Arduino-lint](https://github.com/RobTillaart/MTP40F/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/MTP40F/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/MTP40F.svg)](https://github.com/RobTillaart/MTP40F/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/MTP40F/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/MTP40F.svg?maxAge=3600)](https://github.com/RobTillaart/MTP40F/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/MTP40F.svg)](https://registry.platformio.org/libraries/robtillaart/MTP40F)
# MTP40F
@ -45,7 +48,7 @@ commands e.g. **setSelfCalibration()**.
The CRC of the sensor responses are not verified by the library (yet).
###s# Hardware interface MTP40-F
#### Hardware interface MTP40-F
Has TTL level RS232, I2C and PWM IO.
@ -54,25 +57,25 @@ Has TTL level RS232, I2C and PWM IO.
+-------------+
| |
VCC (3v3 out) 5 --| |-- 1 Vin
TX 6 --| |-- 2 GND
RX 7 --| |-- 3 ALARM
R?T 8 --| |-- 4 PWM / I2C
TX / SDA 6 --| |-- 2 GND
RX / SCL 7 --| |-- 3 ALARM
R/T 8 --| |-- 4 PWM / I2C
GND 9 --| |
| |
+-------------+
```
| Pin | Name | Description |
|:-----:|:----------|:-----------------------------|
| 1 | Vin | 4.2V - 5.5V |
| 2 | GND | idem |
| 3 | ALARM | HIGH above 1000 PPM, LOW below 800 PPM (hysteresis) |
| 4 | PWM/I2C | PWM out |
| 5 | VCC_O | 3V3 out for serial |
| 6 | TX | Transmit 9600 baud or SDA |
| 7 | RX | Receive 9600 baud or SCL |
| 8 | R/T | select I2C / Serial |
| 9 | GND | idem |
| Pin | Name | Description |
|:-----:|:-----------|:-----------------------------|
| 1 | Vin | 4.2V - 5.5V |
| 2 | GND | idem |
| 3 | ALARM | HIGH above 1000 PPM, LOW below 800 PPM (hysteresis) |
| 4 | PWM/I2C | PWM out |
| 5 | VCC_O | 3V3 out for serial |
| 6 | TX / SDA | Transmit 9600 baud or SDA |
| 7 | RX / SCL | Receive 9600 baud or SCL |
| 8 | R/T | select Serial or I2C |
| 9 | GND | idem |
#### Links
@ -208,7 +211,6 @@ Note: read datasheet!
datasheet states 0x2000 but that is 8192 which is rather strange.
Assumption 2000 decimal is meant.
#### Could
- serial bus with multiple devices? => diodes
@ -224,8 +226,16 @@ Note: read datasheet!
- some functions returning bool should return int
to handle errors better MTP40F_OK or ERROR flag.
#### Wont
- store SPC point in the class?
## Support
If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.
Thank you,

View File

@ -7,7 +7,7 @@
// This sketch is meant to test the PWM conversion formula.
// Written for an Arduino UNO.
// - it first loops through all possible values.
// - then it generates a random pulselength (within range) on pin 7
// - then it generates a random pulse length (within range) on pin 7
// - connect pin 7 to interrupt pin 3 as test.
//
// Connect the PWM output to the interrupt pin 2 or 3 of the UNO.

View File

@ -15,9 +15,9 @@
"type": "git",
"url": "https://github.com/RobTillaart/MTP40F.git"
},
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",
"frameworks": "arduino",
"frameworks": "*",
"platforms": "*",
"headers": "MTP40F.h"
}

View File

@ -1,5 +1,5 @@
name=MTP40F
version=0.1.1
version=0.1.2
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for MTP40F CO2 sensor