|
Documentazione sistema acquisizione Arduino
|
![]() |

var
cnt:integer;
procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.Cells[0,0]:='T (°C)';
StringGrid1.Cells[1,0]:='R mis.(ohm)';
StringGrid1.Cells[2,0]:='R cal.(ohm)';
end;
procedure TForm1.Timer1Timer(Sender: TObject);
const
KT=0.01;
R0=10000;
B=3380;
T0=25;
var
te,T,V,R,Rc:real;
begin
inc(cnt);
T:=5*FormArduSerCom.RdAna(0)/1023/KT;
V:=5*FormArduSerCom.RdAna(1)/1023;
R:=(5-V)/(V/6800);
Rc:=R0*exp(B*(1/(T+273)-1/(T0+273)));
StringGrid1.Cells[0,cnt]:=Format('%5.2f',[T]);
StringGrid1.Cells[1,cnt]:=Format('%5.0f',[R]);
StringGrid1.Cells[2,cnt]:=Format('%5.0f',[Rc]);
if cnt>=StringGrid1.RowCount-1 then
begin
Timer1.Enabled:=False;
Button2.Enabled:=True;
Grafico(StringGrid1,Image1);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if Timer1.Enabled then
begin
Timer1.Enabled:=False;
Button2.Caption:='Start';
end
else
begin
cnt:=0;
Timer1.Enabled:=True;
Button2.Caption:='Stop';
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
SalvaDati(StringGrid1,Self);
end;
N.B. per ottenere una lettura più stabile della temperatura sull' LM35 occorre un condensatore da 1uF in parallelo tra uscita e massa.
Curva blu valori di resistenza NTC rilevati
Curva rossa valori di resistenza NTC elaborati con la formula fornita dal costruttore.

| T (įC) | R mis.(ohm) | R cal.(ohm) |
| 18,6 | 12417 | 12841 |
| 19,6 | 12207 | 12353 |
| 21,0 | 11850 | 11661 |
| 22,5 | 11458 | 11014 |
| 24,9 | 11037 | 10028 |
| 27,4 | 10591 | 9144 |
| 30,3 | 10167 | 8201 |
| 32,3 | 9763 | 7636 |
| 34,7 | 9378 | 6993 |
| 37,2 | 9010 | 6414 |
| 39,1 | 8659 | 5990 |
| 41,5 | 8323 | 5507 |
| 43,5 | 8001 | 5153 |
| 45,5 | 7723 | 4826 |
| 46,9 | 7455 | 4597 |
| 48,9 | 7225 | 4311 |
| 50,8 | 6975 | 4046 |
| 52,3 | 6734 | 3861 |
| 54,3 | 6526 | 3628 |
| 55,2 | 6301 | 3518 |
| 57,2 | 6082 | 3310 |
| 58,7 | 5894 | 3164 |
| 60,6 | 5712 | 2980 |
| 61,6 | 5556 | 2893 |
| 63,1 | 5404 | 2769 |
| 64,0 | 5256 | 2689 |
| 65,0 | 5091 | 2612 |
| 67,0 | 4951 | 2466 |
| 67,9 | 4794 | 2397 |
| 69,4 | 4679 | 2297 |
| 70,4 | 4530 | 2234 |
| 71,9 | 4402 | 2142 |
| 72,8 | 4295 | 2083 |
| 73,8 | 4190 | 2027 |
| 74,8 | 4086 | 1972 |
| 75,8 | 3985 | 1919 |
| 77,7 | 3869 | 1818 |
| 79,2 | 3772 | 1747 |
| 79,7 | 3677 | 1724 |