How can I read the Grove Temperature & Humidity sensor via Arduino Mega 2560?
6 views (last 30 days)
Show older comments
I am trying to set up a Seeedstudio ADK Main Board (Arduino Mega 2560) with Grove Mega Shield and Grove Temperature & Humidity sensor so I can read the temperature and use it in further calculation. So far, I have been able to connect to the Arduino with the Arduino IO Support Package in MATLAB R2014a.
Now, I want to read the temperature. On the Wiki page of the sensor ( http://www.seeedstudio.com/wiki/Grove-_Temperature_and_Humidity_Sensor ) there is a reference to libraries which can be used to read the temperature and humidity. These are, of course, in C/C++ for use in the Arduino IDE. However, I am wondering what the best way is to convert one of the libraries for use in MATLAB?
The library that I would like to use can be found here: https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTlib.
0 Comments
Answers (1)
Christiaan
on 2 Apr 2015
Dear Wilko,
Once you have accomplished to connect the Arduino to Simulink, the next step would be to first show the data you collect from the sensor in your ''built-in serial monitor''. (shift M in Arduino IDE). The library can be used directly in the Arduino code, to obtain the correct output.
If you see that the output in your Arduino monitor is 'correct', you can now connect the Arduino over either an analog input or digital input (depends at which port the data is received) and use Simulink blocks to obtain the data. You could display this at a scope or save it in your MATLAB workspace.
It is advised to first try an easy example ( here), that the connection between Arduino and Simulink is working and that you understand how you can transmit data from/to the Arduino.
Good luck! Christiaan
See Also
Categories
Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!