I saw many articles and examples about DS18xxx termal sensor.
I use my library, in few industrial aplications ( 8 sensor / 1Wire ) and work very good.
My library was made and tested on BigPIC4 board, PIC18F8722 , GRAPH LCD 128x64, DS18B20 temp sensor and include functions and procedures for termal and humidity aplications.
About humidity, i tried a few sensors ( SHT11, SHT15, ..., HIH3605, HIH3610), but for my aplications (dust conditions) right choise was DRY BULB and WET BULB.
This library is only for P18 MCU. Examples are for this configuration.
My library include :
Code: Select all
sub function BusFree(dim port, pin as byte) as boolean
Code: Select all
sub function GetRomCode(dim port, pin as byte, dim byref romcode as byte[8]) as boolean
Code: Select all
sub procedure ConvertTempAll(dim port, pin as byte)
Code: Select all
sub procedure ConvertTemp(dim port, pin as byte, dim byref romcode as byte[8])
Code: Select all
sub function GetTemp(dim port, pin as byte, dim byref romcode as byte[8], dim byref temp as real) as boolean
Code: Select all
sub function GetTempSkipCode(dim port, pin, family as byte, dim byref temp as real) as boolean
Code: Select all
sub procedure GetHumidity(dim TempDryBulb, TempWetBulb as real, dim byref humidity as real)
Code: Select all
sub procedure Byte2Hex(dim data as byte, dim byref hex as string[2])
You can download code and examples of using this library from:
http://www.microelemente.ro/MikroBasic/ ... ibrary.zip
First copy termal_library_bas.mcl file in ../Uses/P18/
Source of this library is available only in MikroPascal language.
About HUMIDITY you found many articles on the net.
Best regards, Florin Medrea.