How can i read real-time data from dht11 sensors connected to ESP32 into Simulink

13 次查看(过去 30 天)
I have connected dht11 sensors to ESP32 and have been trying to figure out how to read and visualize the real-time data on simulink. I kindly need help on how to resolve this. I can read the data in Arduino IDE serial monitor on real time but want to also read them in Simulink for my work.
  1 个评论
Cris LaPierre
Cris LaPierre 2025-5-4
Posted in a separate question:
"I had installed simulink support package to my Matlab Simulink, and confirmed that there is connection to the esp32 by blinking the onboard LED. The challenge is the right block and the configuration to enable visualization on real time in Simulink. Kindly assist"

请先登录,再进行评论。

采纳的回答

Aravind
Aravind 2025-5-13
Hi @Nonso,
To read live data from the sensors and ESP32 in Simulink, you can use the "IO Device Builder" app, which is part of the Simulink Support Package for Arduino. This app allows you to incorporate Arduino's C++ libraries into MATLAB System objects, which can then be used to create a Simulink block. You can find more information about this app in the following documentation: https://www.mathworks.com/help/simulink/io-device-builder-arduino.html.
Using the "IO Device Builder," you can create a block that incorporates the DHT11 sensor’s Arduino libraries to read the desired values. Once you have done this, you can run the Simulink model to obtain readings from the DHT11 sensor connected to the ESP32 into Simulink. Additionally, you can use code generation to deploy the model onto the ESP32.
Here are some resources to help you get started with the "IO Device Builder" app:
  1. Getting started with the "IO Device Builder" app: https://www.mathworks.com/help/simulink/supportpkg/arduino_ug/io-device-builder.html
  2. Example of implementing the DHT11 sensor: https://www.mathworks.com/help/simulink/supportpkg/arduino_ref/dht11-relative-humidity-temperature-io-device-builder.html
I hope this answers your question.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by