TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (393 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (140567 times)
  2. FAT32 Library (73071 times)
  3. Network Ethernet Library (58078 times)
  4. USB Device Library (48250 times)
  5. Network WiFi Library (43842 times)
  6. FT800 Library (43330 times)
  7. GSM click (30367 times)
  8. mikroSDK (29010 times)
  9. PID Library (27121 times)
  10. microSD click (26742 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

TempSensors Ds1820 LM35

Rating:

16

Author: dany

Last Updated: 2022-09-23

Package Version: 5.0.0.0

Category: Measurement

Downloaded: 9502 times

Followed by: 2 users

License: MIT license  

The basic functions for the DS18(S/B)20 (onewire digital temperature sensor), including string output, ready to display.
A routine to convert a more than 9 bits temperature read from a DS18B20 to a string (to e.g. display on an LCD) is also present.
Including Parasite Power and Configuration routines.
The LM35 basic functions, code efficient.

No Abuse Reported
  • Information
  • Comments (4)

Library Blog

DS1820 library, suitable for the DS18(S/B)20 and equivalents.

LM35 library, without float calculations, so code size effective.See the package content for the documentation.


  The zipfiles have the same content as the packages, except that the mikroBasic version is also present in them.

===============================================================================
2012-11-12: The microBasic package(s) ha(s)(ve) been added.

Only the .mcl files are available as "library" files: they are copied from the mikroPascal version (the mP and mB .mcl files are compatible - luckely - ).

If you want to see some sources: look into the mP versions.

The example files are still in mP, not in mB. (I do not have an mB licence, so I can not compile them).

Some of the helpfiles are also still referring to mP, but all library "interfaces" are available in the mB language.

--------------------------------------------------------------------------------------------------------------------------------------------
2013-01-26:  Replaced "Delay_ms" and "Delay_us" by routines available in the Delays lib.
"Delay_ms" and "Delay_us" are inline routines and cannot be used in libraries if they are to be used without source (e.g. non Pascal compilers).

---------------------------------------------------------------------------------------------------------------------------------------

Version 2.0 (2013-10-23): Added the routine "DS1820_TempConversionReady". The purpose of this routine is to replace the fixed waiting time needed after "DS1820_StartTempConversion" by a "ready" measurement. The latter method will result in shorter waiting times than the fixed one of 750 ms.

----------------------------------------------------------------------------------------------------------------------------------------

Version 3.0 (2013-10-28): Added the "Parasite Power" capability.

-------------------------------------------------------------------------------------------------------------------------------------- 2013-10-29: Corrected an error in the waiting time during conversion of the "DS1820_StartTempConversion_.._PP" routines. The delay used was 10 times too short. Sorry for the inconvenience caused by that.

---------------------------------------------------------------------------------------------------------------------------------------

Version 4.0 (2013-11-06):

- Added the "DS18B20_TempToString_HR" procedure. Resolution is 9-12 bits.
- Changed the "DS1820_StartTempConversion_.._PP to make variable waiting time possible
- Added ClrWdt while waiting during temp conversion
- Added the DS1820_Family function.
- Added the procedures "DS1820_SetConfiguration", "DS18B20_SetConfiguration",
   "DS1820_SetConfigurationROM" and "DS18B20_SetConfigurationROM",
   "DS1820_GetConfiguration", "DS18B20_GetConfiguration",
   "DS1820_GetConfigurationROM" and "DS18B20_GetConfigurationROM"

--------------------------------------------------------------------------------------------------------------------------------------

2013-11-12: Added a small correction to the "read bit" parts in some of the routines. Nothing essential.

-------------------------------------------------------------------------------------------------------------------------------------- 2013-11-18: Added the PIC24 versions.

--------------------------------------------------------------------------------------------------------------------------------------

2013-12-18. Changed the signature of the routine "DS1820_Family_ROM".

-------------------------------------------------------------------------------------------------------------------------------------------

2013-12-27: Added the routines "DS1820_ReadTemperature_Fast" and "DS1820_ReadTemperatureROM_Fast". They only read the first 2 bytes from the DS1820 scrathpad, so they need less time.

---------------------------------------------------------------------------------------------------------------------------------------- 2014-03-13: The mikroBasic files and zip files have been updated. All mB sources are present now (not tested if compilable though).

-------------------------------------------------------------------------------------------------------------------------------------- 2014-05-16:

- Simplified the "DS18B20_TempToString_HR" procedure: smaller code, better time performance  and one parameter ("Resolution") removed. The latter proved to be not necessary.
- Removed the writing to EEPROM and Reading from EEPROM in the "xxx_SetConfiguration" and    "xxx_GetConfiguration" routines.

--------------------------------------------------------------------------------------------------------------------------------------

2014-05-30: The LM35 library has been added to the package.


2015-01-26: Replaced the mB files: all mB files are compilable now (which e.g. means that all "with" statements are dealt with). I could however not link and test the libraries (no mB licence).


2015-06-27: Changed the PIC24 libraries: the "simple" routine for 5V has been deleted.


2015-07-18: - Changed "DS18B20_SetConfiguration..." to the spec of the "configuration" byte. No functional change.
            - Added the routine "DS18B20_ResetUnusedBits" for the DS18B20 when used at a lower resolution than 12 bits, see the spec sheet.

------------------------------------------------------------------------------------------------------------------------------------------------
2018-02-24: made the CRC checking routines smaller and more understandable.

ALSO FROM THIS AUTHOR

Tool: PIC uart to USB interface

0

Converts PIC level Uart signals to USB in both directions. This project is meant for use with PC's that do not have an RS232 interface any more. It makes it possible to handle the pic uart signals with a PC without an RS232 interface.

[Learn More]

RTOS for PIC32

5

Pre-emptive RTOS for PIC32, written (almost entirely) in mikroPascal/mikroBasic/mikroC. The way of working is very easy to understand. The functionality is kept very limited with respect to other RTosses, to keep it simple. The library code only consists of 1 .mpas file...

[Learn More]

RTCC_PIC32

5

RTCC library for the PIC32 family

[Learn More]
Close menu