Hi Leute,
in meinem letzten Thread Ladedruckanzeige ins Auto übertragen gab es ja eine rege Beteiligung und ich hatte darin explizit erklärt worum es mir geht und welche Werte ich im Auto auslesen möchte. Bevor jetzt einige wieder CAN Bus auslesen schreien: Nein mein Auto ist gefühlt uralt und hat keinen CAN Bus (steht alles im alten Thread).
Starten will ich mit der Abgastemperaturanzeige.
Folgendes habe ich bereits besorgt:
- Arduino Uno
- MAX31855 als Verstärker
- Thermoelement Typ K
Ich habe mir von Adafruit auch schon einmal die Libary heruntergeladen und installiert. Danach habe ich den MAX31855 angeschlossen und mit den Beispielsketch von Adafruit hochgeladen. Siehe da, der Serielle Port gibt die Werte an. Aktuell Raumtemperatur und den Feuerzeugtest habe ich bereits bis 200°C erfolgreich getestet.
So sieht der Sketch von Adafruit aus.
#include <SPI.h>
#include "Adafruit_MAX31855.h"
// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:
// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO 3
#define MAXCS 4
#define MAXCLK 5
// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
// Example creating a thermocouple instance with hardware SPI (Uno/Mega only)
// on a given CS pin.
//#define MAXCS 10
//Adafruit_MAX31855 thermocouple(MAXCS);
#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
#define Serial SerialUSB
#endif
void setup() {
#ifndef ESP8266
while (!Serial); // will pause Zero, Leonardo, etc until serial console opens
#endif
Serial.begin(9600);
Serial.println("MAX31855 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("Internal Temp = ");
Serial.println(thermocouple.readInternal());
double c = thermocouple.readCelsius();
if (isnan(c)) {
Serial.println("Something wrong with thermocouple!");
} else {
Serial.print("C = ");
Serial.println(c);
}
//Serial.print("F = ");
//Serial.println(thermocouple.readFarenheit());
delay(1000);
}
Jetzt habe ich ein paar Fragen:
- Was ist denn eine Software / Hardware SPI?
- Der Sketch wirft immer abwechselnd “Internal Temp = xx” und eine “C = xx” aus. Die “C = xx” funktioniert tadellos. Aber wozu ist denn die Internal Temp da?
Gruß
Irfan
ps. off topic Frage: Kann ich hier Personen markieren, damit sie aufmerksam auf meinen Thread werden? Möchte die netten User vom vorherigen Post aufmerksam machen.