|
|
@@ -47,9 +47,8 @@ FsFile file; |
|
|
|
// |
|
|
|
const char software_name[] = "Software: Teensy_datalog V.2"; |
|
|
|
const int min_voltage_batterie = 13; |
|
|
|
const int fixed_resistor_temperatur = 500; |
|
|
|
|
|
|
|
const int power_Temp_sensor = 34, power_Windfahne = 36, LED_Fail = 24, R_Temp_fix = 500, |
|
|
|
const int power_Temp_sensor = 34, power_Windfahne = 36, LED_Fail = 24, R_Temp_fix = 13000, |
|
|
|
LED_Write = 5, LED_Normal = 6, LED_Batterie = 7, Grenz_U_Batterie = 13, |
|
|
|
taster_manuell_speichern = 28, Windfahne = 20, T_sensor_input = 17, Batterie_input = 38; |
|
|
|
|
|
|
@@ -203,31 +202,32 @@ private: |
|
|
|
|
|
|
|
struct temp_sensor{ |
|
|
|
private: |
|
|
|
int U_Temp; |
|
|
|
int R_Temp; |
|
|
|
float U_Temp; |
|
|
|
float R_Temp; |
|
|
|
int saved_minutes = 0; |
|
|
|
float Temp[60]; |
|
|
|
short int array_Temp_datenblatt[20] = { -30, -20, -10, 0, 10, 20, 25, 30, 40, 50, |
|
|
|
391, 424, 460, 498, 538, 581, 603, 626, 672, 722}; |
|
|
|
public: |
|
|
|
void measure() { |
|
|
|
digitalWrite(power_Temp_sensor, HIGH); |
|
|
|
U_Temp = analogRead(T_sensor_input); |
|
|
|
digitalWrite(power_Temp_sensor, LOW); |
|
|
|
R_Temp = R_Temp_fix / (1023 - U_Temp); |
|
|
|
U_Temp = analogRead(T_sensor_input); |
|
|
|
digitalWrite(power_Temp_sensor, HIGH); |
|
|
|
|
|
|
|
|
|
|
|
for (int t = 0; t < 9; t++) { |
|
|
|
/*for (int t = 0; t < 9; t++) { |
|
|
|
if ((R_Temp >= array_Temp_datenblatt[t + 10]) && (R_Temp <= array_Temp_datenblatt[t + 11])) { |
|
|
|
Temp[saved_minutes] = array_Temp_datenblatt[t] + ((R_Temp - array_Temp_datenblatt[t + 10]) * (array_Temp_datenblatt[t + 1] - array_Temp_datenblatt[t]) / (array_Temp_datenblatt[t + 11] - array_Temp_datenblatt[t + 10])); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
Temp[saved_minutes] = R_Temp_fix * ((1023 / U_Temp) - 1); |
|
|
|
saved_minutes++; |
|
|
|
} |
|
|
|
|
|
|
|
void file_print() { |
|
|
|
file.printf("\nTemperatur:\n"); |
|
|
|
file.printf("\nWiderstand NTC:\n"); |
|
|
|
for (int i = 0; i < saved_minutes; i++) { |
|
|
|
file.printf("%.2f °C\n", Temp[i]); |
|
|
|
file.printf("%.2f Ohm\n", Temp[i]); |
|
|
|
} |
|
|
|
saved_minutes = 0; |
|
|
|
} |
|
|
@@ -243,9 +243,9 @@ private: |
|
|
|
|
|
|
|
public: |
|
|
|
void measure() { |
|
|
|
digitalWrite(power_Windfahne, HIGH); |
|
|
|
//digitalWrite(power_Windfahne, HIGH); |
|
|
|
wind_sec = map(analogRead(Windfahne), 0, 1023, 20, 350); |
|
|
|
digitalWrite(power_Windfahne, LOW); |
|
|
|
//digitalWrite(power_Windfahne, LOW); |
|
|
|
wind_summ += wind_sec; |
|
|
|
saved_seconds++; |
|
|
|
} |