Coder Social home page Coder Social logo

lebuni / zacwire-library Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 4.0 252 KB

Arduino Library to read the ZACwire protocol of TSIC temperature sensors

License: MIT License

C++ 100.00%
temperature-sensor arduino library sensor tsic tsic306 tsic206 zacwire tsic-temperature-sensors temperature

zacwire-library's People

Contributors

lebuni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zacwire-library's Issues

Library not compiling

Hello,
I can't compile your library.

In file included from src/main.cpp:69:0:
lib/ZACwire/ZACwire.h:72:16: error: variable or field 'ICACHE_RAM_ATTR' declared void
    static void ICACHE_RAM_ATTR read() {   //gets called with every rising edge
                ^
lib/ZACwire/ZACwire.h:72:16: error: expected ';' at end of member declaration
lib/ZACwire/ZACwire.h:72:37: warning: ISO C++ forbids declaration of 'read' with no type [-fpermissive]
    static void ICACHE_RAM_ATTR read() {   //gets called with every rising edge
                                     ^
lib/ZACwire/ZACwire.h: In member function 'int ZACwire<pin>::read()':
lib/ZACwire/ZACwire.h:89:4: warning: no return statement in function returning non-void [-Wreturn-type]
    }
    ^
In file included from src/main.cpp:69:0:
lib/ZACwire/ZACwire.h: In instantiation of 'bool ZACwire<pin>::begin() [with unsigned char pin = 15u]':
src/main.cpp:145:21:   required from here
lib/ZACwire/ZACwire.h:27:19: error: invalid use of non-static member function
    attachInterrupt(isrPin, read, RISING);
                   ^
In file included from src/main.cpp:69:0:
lib/ZACwire/ZACwire.h: In instantiation of 'int ZACwire<pin>::read() [with unsigned char pin = 15u]':
lib/ZACwire/ZACwire.h:27:19:   required from 'bool ZACwire<pin>::begin() [with unsigned char pin = 15u]'
src/main.cpp:145:21:   required from here
lib/ZACwire/ZACwire.h:79:26: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      BitCounter = ByteNr = rawTemp[0][backUP] = rawTemp[1][backUP] = 0;
                          ^
lib/ZACwire/ZACwire.h:87:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   else if (deltaTime < bitWindow - 40 || rawTemp[ByteNr][backUP] & 2) rawTemp[ByteNr][backUP] |= 1; //Logic 1
                      ^


main program is just including the lib, declaring the object and calling begin()

#include <ZACwire.h>
ZACwire<A1> Sensor(306);

void setup()
{
  if( Sensor.begin () )
    Serial.print("TSic 306 found! \r\n");
}

Compiling with gcc 10.2 on debian with latest Visual Studio & platform IO (same result with arduino IDE)
Cheers,
Joachim

Parity Problem in 1.3.1?

Hi Adrian,

kann es sein, dass die parity nicht mehr funktioniert? Ich erhalte nun ca alle 1500sec 2 falsche Werte (aber nie 222).

�[0m(D p:^3997ms) 479 temperature sensor reading: consec_errors=1, temp_current=5.80, temp_prev=21.90
�[0m(D p:^1997ms) 1932 temperature sensor reading: consec_errors=1, temp_current=9.30, temp_prev=21.90
�[0m(D p:^4997ms) 1960 temperature sensor reading: consec_errors=1, temp_current=121.90, temp_prev=21.80
�[0m(D p:^1997ms) 2022 temperature sensor reading: consec_errors=1, temp_current=46.80, temp_prev=22.00
�[0m(D p:^0997ms) 3091 temperature sensor reading: consec_errors=1, temp_current=10.90, temp_prev=21.80
�[0m(D p:^0997ms) 3141 temperature sensor reading: consec_errors=1, temp_current=46.90, temp_prev=21.80
�[0m(D p:^4997ms) 3760 temperature sensor reading: consec_errors=1, temp_current=5.30, temp_prev=21.80

Ich hol mir jede Sekunde den Temp Wert.

Danke.

VG

Compatibility to 14bit precision

Hallo @Big-Brummer,

das mit den 14 Bit wird wohl ein TSic 716 sein, oder? Ich hab selber keinen und kann daher schlecht einen neuen Code testen. Haben Sie schon die Library tripplefox/TsicSensor ausprobiert? Die soll das angeblich können.

Falls es nicht funktioniert, könnte auch ich einen neuen Branch meiner Library schreiben und wir schauen "auf gut Glück", ob's mit dem TSic 716 sauber läuft. Das wäre aber eher eine Notlösung...

lib working on esp32

Hey Adrian, @lebuni

hoffe dir gehts gut und Corona hat die den Espresso Geschmack nicht verdorben. :-)

Ich schreib dir da ich den Rancilio Bleeding Edge (https://github.com/medlor/bleeding-edge-ranciliopid) gerade auf ESP32 portiere und gerne deine Lib weiter verwenden würde.
Erste Tests zeigen, dass die Temperatur ausgelesen werden kann, aber sie scheint relativ stark zu schwanken (siehe log). Stutzig macht mich zudem deine Einschränkung auf esp8266 in library.properties.

Supportet deine Lib den esp32. Gerne kann ich dich auch unterstützen und debug output beisteuern.

Log Auszug aus dem BE ("input" ist die gemessene Temperatur):

�[0m(D p:^4999ms) 174 Input= 24.16 | error=68.84 delta= 0.05 | Output=100.00 = b: 7.91 + p:110.14 + i: 0.00( 0.00) + d:-0.51
�[0m(D p:^4999ms) 179 Input= 24.20 | error=68.80 delta= 0.05 | Output=100.00 = b: 7.89 + p:110.08 + i: 0.00( 0.00) + d:-0.51
�[0m(D p:^4999ms) 184 Input= 24.24 | error=68.76 delta= 0.00 | Output=100.00 = b: 7.87 + p:110.02 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 189 Input= 24.26 | error=68.74 delta= 0.05 | Output=100.00 = b: 7.86 + p:109.98 + i: 0.00( 0.00) + d:-0.51
�[0m(D p:^4999ms) 194 Input= 24.26 | error=68.74 delta= 0.05 | Output=100.00 = b: 7.84 + p:109.98 + i: 0.00( 0.00) + d:-0.51
�[0m(D p:^4999ms) 199 Input= 24.22 | error=68.78 delta=-0.05 | Output=100.00 = b: 7.82 + p:110.05 + i: 0.00( 0.00) + d: 0.51
�[0m(D p:^4999ms) 204 Input= 24.20 | error=68.80 delta=-0.05 | Output=100.00 = b: 7.80 + p:110.08 + i: 0.00( 0.00) + d: 0.51
�[0m(D p:^4999ms) 209 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.79 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 214 Input= 24.14 | error=68.86 delta=-0.05 | Output=100.00 = b: 7.77 + p:110.18 + i: 0.00( 0.00) + d: 0.51
�[0m(D p:^4999ms) 219 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.75 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 224 Input= 24.20 | error=68.80 delta= 0.05 | Output=100.00 = b: 7.73 + p:110.08 + i: 0.00( 0.00) + d:-0.51
�[0m(D p:^4999ms) 229 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.72 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 234 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.70 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 239 Input= 24.26 | error=68.74 delta= 0.05 | Output=100.00 = b: 7.68 + p:109.98 + i: 0.00( 0.00) + d:-0.51
�[0m(D p:^4999ms) 244 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.66 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 249 Input= 24.20 | error=68.80 delta=-0.05 | Output=100.00 = b: 7.65 + p:110.08 + i: 0.00( 0.00) + d: 0.51
�[0m(D p:^4999ms) 254 Input= 24.22 | error=68.78 delta= 0.00 | Output=100.00 = b: 7.63 + p:110.05 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 259 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.61 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 264 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.59 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 269 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.57 + p:110.08 + i: 0.00( 0.00) + d:-0.00
�[0m(D p:^4999ms) 274 Input= 24.20 | error=68.80 delta= 0.00 | Output=100.00 = b: 7.56 + p:110.08 + i: 0.00( 0.00) + d:-0.00

TSIC206 - temperature sensor reading: consec_errors = 1, temp_current = 222.00

A user with us gets the following message in the Arduino monitor:

Monitor temperature sensor reading: consec_errors = 1, temp_current = 222.00

And asks if it is because he is using a TSIC206 instead of 306.

My question:
Must be: ZACwire<2> Sensor(306) to.
ZACwire<2> Sensor(206) be changed

Greetings
Markus from the CleverCoffee team (Rancilio PID)

Temperature readings inaccurate and flapping after release 1.3.2

Hi Adrian,

hope you have a nice time in your study. A couple of days ago I found out that the temperature readings of your great library is flapping a couple of 1/10 of degrees every now and then. My pid control handles this after a couple of seconds but still this is rather ugly.
I took me some time to find our that there must be a bug in the lib after including v1.3.2.
Latest working version is 1.3.1.

I have added a simple sketch.
Running on ESP32 (have not tested esp8266)

Symptoms:

  1. very rough readings.. eg. jumps from 26.50 directly to 28.10 (when pressing my finger on the sensor) -> see log below

Test still running on version 1.3.1 to determine random flapping also occur in this version (couple of 1/10 of degrees every now and then).

Sample output:

1.3.2
12 Temp: 26.50
12 Temp: 26.50
13 Temp: 28.10 *** 1.60
13 Temp: 28.10
13 Temp: 28.10
13 Temp: 28.10
.....
18 Temp: 28.10
18 Temp: 28.10
18 Temp: 26.50 *** 1.60
18 Temp: 28.10 *** 1.60
18 Temp: 26.50 *** 1.60  ERR!!!!
18 Temp: 28.10 *** 1.60
18 Temp: 26.50 *** 1.60
18 Temp: 26.50
18 Temp: 26.50
1.3.1
5 Temp: 26.10
5 Temp: 26.10
5 Temp: 26.10
5 Temp: 26.10
5 Temp: 26.30   OK (all lines)
5 Temp: 26.40
6 Temp: 26.50
6 Temp: 26.60
6 Temp: 26.80
6 Temp: 26.80
6 Temp: 26.90
6 Temp: 27.00
6 Temp: 27.00
6 Temp: 27.20 *** 0.20
6 Temp: 27.20
6 Temp: 27.30
7 Temp: 27.40
7 Temp: 27.40
7 Temp: 27.60 *** 0.20
7 Temp: 27.60
7 Temp: 27.60
7 Temp: 27.50
7 Temp: 27.50
7 Temp: 27.40
7 Temp: 27.40
7 Temp: 27.40
8 Temp: 27.30
8 Temp: 27.30
8 Temp: 27.20
8 Temp: 27.20
8 Temp: 27.20
8 Temp: 27.10

best regards
Tobias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.