Azzera filtri
Azzera filtri

How to pass data from DHT11sensor (temperature&humidity Sensor) using Arduino software to Constant Block in Simulink?

3 visualizzazioni (ultimi 30 giorni)
hellos everyone . I am now working on a project that is the regulation of the temperautre and humidity with the help of the Arduino + DHT11 sensor and Simulink , I connected a script matlab in series with the Arduino software to extract values humidity and temperature to plots them in a graph. I'd like to display these values in Simulik for the regulation of these values ,I got Many problem at the declaration of set- param function here is the matlab code (exemple Temperature ):
s = serial ( 'COM5');
temps=1000;
i=1;
fopen(s);
while(i<temps)
fprintf(s, 'information de communication série');
out = fscanf(s)
global Temp ;
Temp(i) = str2num(out(1:4));
set_param('DHT11SIM','Temperature','value',num2str(Temp))
set_param('DHT11SIM', 'Temperature', 'update')
subplot(211);
plot(Temp,'g');
axis([0,temps,20,50]);
title('DHT11 Température');
xlabel('---> temps (secondes)');
ylabel('---> Température');
grid
code simulink:
here is the erruer thatI I always receives: Error using DHT (line 15) Invalid Simulink object name: DHT11SIM/Temperature .
please Help me

Risposte (1)

Damodar Reddy Ch
Damodar Reddy Ch il 8 Apr 2019
Please provide termination for while loop

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by