Fetching data from DS18B20 Temperature sensor connected to arduino in matlab

47 vues (au cours des 30 derniers jours)
Mridul Tiwari
Mridul Tiwari le 19 Oct 2015
Commenté : delil codes le 5 Jan 2021
How do fetch the temperature values from DB18B20, connected to arduino, in matlab. I can't use the general analog read command as this sensor has its own library ( called " OneWire" ) which is not available in MATLAB. SO is there any way to read the temperature directly in MATLAB or use arduino library to do it ?
  2 commentaires
Ella
Ella le 28 Oct 2015
Hi Did you find any solution for this ? Please share with us
Art
Art le 26 Jan 2016
Look at ARDUINO DS LIBRARY in File Central. I haven't tried it yet, but it claims to read this one-wire sensor.

Connectez-vous pour commenter.

Réponses (6)

Stalin Samuel
Stalin Samuel le 28 Oct 2015

Art
Art le 10 Fév 2016
If you are up to date on Matlab and the Arduino package, you should be able to use any 3rd party library. Excerpt from Mathworks:
5. Adding support for custom libraries is possible, with the latest support package version (MATLAB R2015b with MATLAB Arduino support package version 15.2.3). Please follow these links: http://www.mathworks.com/help/supportpkg/arduinoio/ug/custom-library-concepts.html http://www.mathworks.com/help/supportpkg/arduinoio/custom-arduino-libraries.html

planet86_Chris
planet86_Chris le 15 Fév 2016
Hello all,
Actually, I am beginner on Arduino hardware and I would like to use this temperature sensor (DS18B20 one-wire technology) in my project.
For that, the package "OneWire" must be installed by using the manager library in Arduino program. After working on Arduino with this package, things worked well.
Now and before starting any programming on Matlab, the library "OneWire" (use previously in Arduino program) must be installed into Matlab so that the sensor can be used to run any operation from Matlab.
However, I did not find any clear explanation of: How to install an Arduino Library ("OneWire" for DS18B20 library for example, but also other library) into Matlab 2015b step by step ?
Thank you very much for any answers with clear and coherent methodology to follow for installing an Arduino Library "OneWire" with I2C protocol and also others packages in general (please do not post the useless Matlab documentation link again and again).
  2 commentaires
Walter Roberson
Walter Roberson le 15 Fév 2016
Download the .zip . Unzip it into any convenient directory that is not part of the MATLAB installation directories. Use MATLAB's pathtool to add the directory to the MATLAB path, and tell pathtool to save the result. After that, you can refer to the function or model as if it were provided by Mathworks.
Dan Maria
Dan Maria le 12 Nov 2017
I've tried this and it doesn't work...

Connectez-vous pour commenter.


Ricardo Quiroz
Ricardo Quiroz le 21 Oct 2016
Modifié(e) : Walter Roberson le 21 Oct 2016
Hello everyone, I found something related that may help you reading the sensor DS18B20 with matlab and Arduino. Here's the link: https://www.mathworks.com/matlabcentral/fileexchange/57897-1-wire-add-on-library-for-arduino
I hope it helps.
Ricardo
  3 commentaires
Tesfaye Tereche
Tesfaye Tereche le 19 Fév 2020
how i can add data acquisition devices into MATLAB 2019 Tool box

Connectez-vous pour commenter.


jose manuel
jose manuel le 26 Mar 2017
Error in S-function 'DS18B20_BLOCK/DS18B20/DS18B20': S-Function 'DS18B20_03' does not exist
  2 commentaires
Han Son Go
Han Son Go le 6 Avr 2017
I had the same error. After building the s-function, it disappeared. But i still read the temperature from the sensor.
Christopher Harness
Christopher Harness le 9 Août 2019
How exactly did you make your S-Function? Do you still have a working model?

Connectez-vous pour commenter.


delil codes
delil codes le 5 Jan 2021
Hello all,
I tried to add library to matlab but it doesnt work. Basically I used addpath;
addpath ('D:\Program Files\Polyspace\OneWire')
and then looked the libraries which added to matlab
listArduinoLibraries
ans =
12×1 cell array
{'Adafruit/BNO055' }
{'Adafruit/MotorShieldV2'}
{'CAN' }
{'I2C' }
{'MKRMotorCarrier' }
{'MotorCarrier' }
{'RotaryEncoder' }
{'SPI' }
{'Serial' }
{'Servo' }
{'ShiftRegister' }
{'Ultrasonic' }
What I did wrong?
  2 commentaires
delil codes
delil codes le 5 Jan 2021
Modifié(e) : delil codes le 5 Jan 2021
This is done(by doing the same steps) but now matlab does not reach arduino skecth libraries
delil codes
delil codes le 5 Jan 2021
Matlab 3P library source is different from arduino default folder.
I solved the problem with;

Connectez-vous pour commenter.

Catégories

En savoir plus sur Arduino Hardware dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by