Skip to content

Commit

Permalink
update readme (#26)
Browse files Browse the repository at this point in the history
- update readme.md
- update GitHub actions
- update license 2023
- minor edits
  • Loading branch information
RobTillaart authored Feb 26, 2023
1 parent 671efd2 commit e03da31
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 46 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.4.3] - 2023-02-26
- update readme.md
- update GitHub actions
- update license 2023
- minor edits


## [0.4.2] - 2022-11-16
- add RP2040 in build-CI
- add changelog.md
- minor edit readme.md
- minor edit unit test


## [0.4.1] - 2021-12-10
- add SWSPI delay + getter/setter

## [0.4.0] - 2021-12-09
## [0.4.0] - 2021-12-09
- fix #21 breaking change for HW SPI
- move constructor code to begin()
- read() removed "premature" return on status.
Expand All @@ -28,6 +34,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- add setGIOpins - ESP32 specific
- add get/setSPIspeed() - all

----

## [0.2.5] - 2021-07-04
- fix #14 CS for STM32.

Expand Down
8 changes: 3 additions & 5 deletions MAX31855.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
//
// FILE: MAX31855.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.4.2
// VERSION: 0.4.3
// PURPOSE: Arduino library for MAX31855 chip for K type thermocouple
// DATE: 2014-01-01
// URL: https://github.com/RobTillaart/MAX31855_RT
//
// HISTORY: see changelog.md


#include "MAX31855.h"
Expand Down Expand Up @@ -178,7 +176,7 @@ uint32_t MAX31855::_read(void)
{
// split _swSPIdelay in equal dLow and dHigh
// dLow should be longer one when _swSPIdelay = odd.
uint16_t dHigh = _swSPIdelay/2;
uint16_t dHigh = _swSPIdelay / 2;
uint16_t dLow = _swSPIdelay - dHigh;
digitalWrite(_select, LOW);
for (int8_t i = 31; i >= 0; i--)
Expand Down Expand Up @@ -216,5 +214,5 @@ float MAX31855::getTemperature()
}


// -- END OF FILE --
// -- END OF FILE --

7 changes: 4 additions & 3 deletions MAX31855.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: MAX31855.h
// AUTHOR: Rob Tillaart
// VERSION: 0.4.2
// VERSION: 0.4.3
// PURPOSE: Arduino library for MAX31855 chip for K type thermocouple
// DATE: 2014-01-01
// URL: https://github.com/RobTillaart/MAX31855_RT
Expand All @@ -25,7 +25,7 @@
#include "SPI.h"


#define MAX31855_VERSION (F("0.4.2"))
#define MAX31855_VERSION (F("0.4.3"))

#define MAX31855_NO_TEMPERATURE -999

Expand Down Expand Up @@ -137,10 +137,11 @@ class MAX31855
uint32_t _SPIspeed;
SPIClass * mySPI;
SPISettings _spi_settings;

#if defined(ESP32)
bool _useHSPI = true;
#endif
};


// -- END OF FILE --
// -- END OF FILE --
70 changes: 36 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For every type of TC there exist an MAX31855 variant, this library is primary
developed for the K-type sensor. However it has experimental support for all
other types of TC's. See details below.

Library tested with breakout board
Library tested with breakout board.

```
+---------+
Expand All @@ -42,37 +42,40 @@ Library tested with breakout board

Default pin connections. ESP32 can overrule with **setGPIOpins()**.

| HW SPI | UNO | ESP32 VSPI | ESP32 HSPI | Notes
|:---------|:-----:|:-----------:|:-----------:|:----------|
| CLOCKPIN | 13 | 18 | 14 |
| MISO | 12 | 19 | 12 |
| MOSI | 11 | 23 | 13 | *not used...*
| SELECT | eg. 4 | 5 | 15 | *can be others too.*
| HW SPI | UNO | ESP32 VSPI | ESP32 HSPI | Notes
|:-----------|:-----:|:------------:|:------------:|:----------|
| CLOCKPIN | 13 | 18 | 14 |
| MISO | 12 | 19 | 12 |
| MOSI | 11 | 23 | 13 | *not used...*
| SELECT | 4 | 5 | 15 | *can be others too.*


Performance read() function, timing in us. (ESP32 @240MHz)

| mode | clock | timing UNO | timing ESP32 | Notes
|:-------|---------:|-----------:|-------------:|:----------|
| HW SPI | 32000000 | ni | ~15 | *less reliable*
| HW SPI | 16000000 | ~68 | ~16 |
| HW SPI | 4000000 | ~72 | ~23 |
| HW SPI | 1000000 | ~100 | ~51 |
| HW SPI | 500000 | ~128 | ~89 |
| SW SPI | bit bang | ~500 | ~17 (!) |
| mode | clock | timing UNO | timing ESP32 | Notes
|:---------|-----------:|-------------:|---------------:|:----------|
| HW SPI | 32000000 | ni | ~15 | *less reliable*
| HW SPI | 16000000 | ~68 | ~16 |
| HW SPI | 4000000 | ~72 | ~23 |
| HW SPI | 1000000 | ~100 | ~51 |
| HW SPI | 500000 | ~128 | ~89 |
| SW SPI | bit bang | ~500 | ~17 (!) |


## Interface

```cpp
#include "MAX31855.h"
```

### Constructor
#### Constructor

- **MAX31855()** create object.
- **void begin(const uint8_t select)** set select pin => hardware SPI
- **void begin(const uint8_t sclk, const uint8_t select, const uint8_t miso)** set clock, select and miso pin => software SPI


### Hardware SPI
#### Hardware SPI

To be used only if one needs a specific speed.

Expand All @@ -82,7 +85,7 @@ To be used only if one needs a specific speed.
- **uint16_t getSWSPIdelay()** get set value in micros.


### ESP32 specific
#### ESP32 specific

- **void selectHSPI()** must be called before **begin()**
- **void selectVSPI()** must be called before **begin()**
Expand All @@ -91,7 +94,7 @@ To be used only if one needs a specific speed.
- **void setGPIOpins(uint8_t clk, uint8_t miso, uint8_t mosi, uint8_t select)** to overrule ESP32 default hardware pins


### Reading
#### Reading

To make a temperature reading call **read()**.
It returns the status of the read which is a value between 0..7
Expand Down Expand Up @@ -129,7 +132,7 @@ the value of **getTemperature()** can become incorrect. So it is important to ch
the return value of **read()**.


### Offset
#### Offset

The library supports a fixed offset to calibrate the thermocouple.
For this the functions **float getOffset()** and **void setOffset(float offset)** are available.
Expand All @@ -138,7 +141,7 @@ This offset is "added" in the **getTemperature()** function.
Note the offset used is a float, so decimals can be used.


### Delta analysis
#### Delta analysis

As the **tc** object holds its last known temperature it is easy to determine the delta
with the last known temperature, e.g. for trend analysis.
Expand All @@ -155,7 +158,7 @@ with the last known temperature, e.g. for trend analysis.
```
### Last time read
#### Last time read
The **tc** object keeps track of the last time **read()** is called in the function **uint32_t lastRead()**.
The time is tracked in **millis()**. This makes it easy to read the sensor at certain intervals.
Expand All @@ -177,7 +180,7 @@ if (millis() - tc.lastRead() >= interval)
```


### GetRawData
#### GetRawData

The function **uint32_t getRawData()** allows you to get all the 32 bits raw data from the board,
after the standard **uint8_t tc.read()** call.
Expand All @@ -195,10 +198,10 @@ This allows one to compact the measurement e.g. for storage or sending over a ne
## Pull Up Resistor

To have proper working of the MAX31855 board, you need to add a pull-up resistor
(e.g. 4K7 - 1K depending on wirelength) between the MISO pin (from constructor call) and the
VCC (5Volt). This improves the signal quality and will allow you to detect if there is
proper communication with the board. WIthout pull-up one might get random noise that could
look like real data.
(e.g. 4K7 - 1K depending on length of the wires) between the MISO pin (from constructor call)
and the VCC (5Volt).
This improves the signal quality and will allow you to detect if there is proper communication
with the board. Without pull-up one might get random noise that could look like real data.

**Note:** the MISO pin can be different from each board, please refer to your board datasheet.

Expand Down Expand Up @@ -234,13 +237,11 @@ See examples
#### breaking change 0.4.0

In issue #21 it became clear that the code in the constructor is not always executed correctly.
Therefore this code + parameters is moved to the **Begin()** function.
Therefore this code + parameters is moved to the **begin()** function.


## Experimental part (to be tested)

(to be tested)

**NOTE:**
The support for other thermocouples is experimental **use at your own risk**.

Expand Down Expand Up @@ -285,13 +286,14 @@ as one does not set the Seebeck Coefficient it will use the K_TC as default.

## Future

#### must
#### Must

#### Should

#### should
- investigate other TC's
-

#### Could

#### could
- move code to .cpp

#### Wont
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/MAX31855_RT"
},
"version": "0.4.2",
"version": "0.4.3",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",
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=MAX31855_RT
version=0.4.2
version=0.4.3
author=Rob Tillaart <[email protected]>
maintainer=Rob Tillaart <[email protected]>
sentence=Arduino library for MAX31855 chip for K type thermocouple.
Expand Down

0 comments on commit e03da31

Please sign in to comment.