Beste,
In afwerking van mijn CV sturing met Qbus domotica, heb ik een rookgastemperatuursensor nodig voor mijn CV haard. Omdat de sensors van Qbus maar tot maximum 93°C gaan wil ik dit via een omweg doen.
Ik zou met een thermokoppel temperaturen van 100-630°C willen meten en deze inlezen in Qbus als 10-63°C. Ik moet met de arduino een ohmse waarde moeten krijgen omdat deze dan overeen komt waardes die Qbus zou inlezen met temperaturen van 10-63°C. Hoe moet ik deze omzetting doen? Temperatuur meten met thermokoppel is al gelukt.
Aansluitingen:
Ohmse waarden die ik moet hebben bij de temperaturen:
Qbus temp RG temp Ohmse waarde
10 100 18410
11 110 17641
12 120 16909
13 130 16212
14 140 15548
15 150 14916
16 160 14313
17 170 13739
18 180 13192
19 190 12669
20 200 12171
21 210 11696
22 220 11242
23 230 10809
24 240 10395
25 250 10000
26 260 9621
27 270 9260
28 280 8915
29 290 8585
30 300 8269
31 310 7966
32 320 7677
33 330 7400
34 340 7134
35 350 6880
36 360 6636
37 370 6403
38 380 6179
39 390 5964
40 400 5758
41 410 5561
42 420 5371
43 430 5189
44 440 5014
45 450 4846
46 460 4685
47 470 4530
48 480 4381
49 490 4238
50 500 4101
51 510 3969
52 520 3842
53 530 3719
54 540 3601
55 550 3488
56 560 3379
57 570 3274
58 580 3172
59 590 3075
60 600 2981
61 610 2890
62 620 2803
63 630 2719
64 640 2638
65 650 2559
66 660 2484
67 670 2411
68 680 2341
69 690 2273
70 700 2207
71 710 2144
72 720 2083
73 730 2024
Mijn code:
// declareren van variabelen
float temp;
int meetwaardethermo;
byte address = 0x11;
int CS= 10;
int weerstandbit;
int weerstand;
// include the library code:
#include <LiquidCrystal.h>
#include <SPI.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
void setup() {
// put your setup code here, to run once:
analogReference(EXTERNAL); // doorlussen van voeding sensor naar AREF
Serial.begin(9600); //seriele communicatie met computer (debugging)
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, Stijn!");
delay(1000);
lcd.clear();
pinMode (CS, OUTPUT);
SPI.begin();
digitalPotWrite(0); //0 wegschrijven naar potmeter
}
void loop() {
// put your main code here, to run repeatedly:
meetwaardethermo = analogRead(A0);
float Voutthermo = meetwaardethermo * (5.0 / 1023.0); // omvormen van 0-1023 naar 0-5V
temp = (Voutthermo - 1.25)/0.005; // temperatuur zoeken via formule op omvormer
// set the cursor to column 0, line 0
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 0);
lcd.print(weerstand);
lcd.setCursor(0, 1);
lcd.print(temp);
lcd.setCursor(6, 1);
lcd.print("C");
weerstandbit = temp;
weerstandbit = map(weerstandbit, 0, 100, 0, 255); //omvormen van waarde
weerstand = 50000*(256-weerstandbit)/256+125;
digitalPotWrite(weerstandbit);
delay(100);
// testen
Serial.print(weerstandbit);
// Serial.print(weerstand);
delay(1000);
// Serial.println(meetwaardethermo);
}
int digitalPotWrite(int value)
{
digitalWrite(CS, LOW);
SPI.transfer(address);
SPI.transfer(value);
digitalWrite(CS, HIGH);
}
Kan iemand mij hiermee verder helpen?
Alvast bedankt!
Stijn