![]() |
|
| If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
|
| Datasheet File OCR Text: |
| rh - 02 m anua l v 1 . 0 1. introduction 2. connecting to pc 3. principles of operation 4. specifications 5. technical information 6. using usb ports writing you own software overview other information technical information serial port settings (interrupts etc) serial port connections (pin connections on the serial port) protocol (directly driving the unit) modem operation (remote use with radio / telephone modems) legal information usage the software in this release is for use only with pico products or with data collected using pico products copyright pico technology limited claims the copyright of and retains the rights to all material (software, documents etc) contained in this release you may copy and distribute the entire release before it is installed, but you may not copy individual items within the release, other than for backup purposes liability pico technology and its agents shall not be liable for any loss, damage or injury, howsoever caused, related to the use of pico technology equipment or software. fitness for purpose no two applications are the same, so pico technology cannot guarantee that its equipment or software is suitable for a given application. it is therefore the users responsibility to ensure that the product is suitable for the users application. because the software runs on a computer that may be running other software products, and may be subject to interference from these other applications, this license specifically excludes usage in 'mission critical' applications, for example medical or safety related applications
trade marks borland, delphi and turbo pascal are trade marks or registered trade marks of borland international, inc. microsoft, ms-dos, windows, windows nt, visual c++, visual basic are registered trademarks or trademarks of microsoft corporation in the usa and other countries national instruments and labview are trademarks or national instruments corporation, registered in the united states and other countries pico technology limited, picoscope, picolog and drdaq are trademarks of pico technology limited, registered in the united kingdom and other countries. introduction the pico RH-02 is a complete temperature and humidity input device for use with ibm compatible computers. it connects to the serial port of the computer, and has built in sensors that are calibrated to give highly accurate readings. it can be used with the picolog data logging program: alternatively, you can use the RH-02 driver software to develop your own programs to collect and analyse data from the unit. picolog and the drivers support up to four RH-02 units under dos, and nine RH-02 units under windows. this file describes the physical and electrical properties of the RH-02, and explains how to use the software drivers. for more information about using the RH-02 with picolog, please consult the following files: picolog for windows plw044.hlp (windows help file) picolog for dos pl.txt principles of operation the RH-02 takes a reading every two seconds from each of two sensors- a humidity sensor and a precision thermistor. these sensors are built into the RH-02. the driver software contains everything necessary to convert the sensor readings into temperature and humidity. filtering the RH-02 software includes a filter which eliminates errors caused by electrical noise. you can use either the measured or the filtered value: the filtered value is much less prone to electrical noise, but it tends to lag behind if the measured value cha nges quickly. specifications conversion time 2 seconds (for both humidity & temp) resolution 0.0025% humidity range 0 to 100% (non condensing) accuracy 2% (5% to 95%) response time approx 1 minute temperature range 0 to 70 c accuracy 0.2c (0 to 70 c) 10 seconds connector d9 female to computer enclosure dimensions 130x60x30mm material black abs not waterproof connecting the RH-02 to use the RH-02, you should connect the d-connector on the RH-02 to the serial port on your computer using the cable provided. if you have a 25-way serial port, use the 9 to 25 way adaptor supplied. to check that the unit is working: 1. start up picolog for windows 2. select file 3. select new settings 4. at the recording dialog, press ok 5. at the sampling dialog, press ok 6. set the converter type to rh02 7. select the com port that you have connected the rh02 to 8. press ok 9. at the rh02 channels dialog, double-click on temp unused 10. at the edit rh02 channel dialog, press ok 11. back to the rh02 channels dialog, double_click on humidity unused 12. at the edit rh02 channel dialog, press ok 13. back to the rh02 channels dialog, press ok 14. the recorder view should now display the temperature and humidity. driver summary the RH-02 is supplied with driver routines that you can build short into your own programs. drivers are supplied for use with the following operating systems: dos windows 3.1 windows 95/98 windows nt/2000 linux once you have installed the software, the drivers directory contains the drivers and a selection of examples of how to use the drivers. it also contains a copy of this manual as a text file. if you installed under windows, the pico technology group conta ins a help file for the drivers. the driver routine is supplied as object files for dos and protected mode, and as a dynamic link library for windows. the object files use pascal linkage conventions and do not require any compiler run-time routines: they can therefore be used with most real-mode and some protected-mode c and pascal compilers. the windows dll can be used with c, delphi and visual basic programs: it can also be used with programs like microsoft excel, where the macro language is a form of visual basic. more than one application can access the windows dll at the same time, as long as the applications do not change the settings for channels that they are not using. the following table specifies the function of each of the routines in the driver: routine function rh02_open_unit open the driver to use a specified serial port(s) rh02_close_unit close the port ( warning! failure to do this under dos could cause your computer to malfunction) rh02_get_cycle find out when the driver has taken a new set of readings rh02_get_value get the most recent temperature or humidity reading rh02_get_version get the version number of this RH-02 the normal calling sequence for these routines is as follows: open driver while you want to measure temperatures, get temperature and/or humidity end while close driver rh02_open_unit dos version: short int rh02_open_unit ( short int port, short int base, short int irq); windows version: short int rh02_open_unit ( short int port); this routine specifies the serial port number with an RH-02 unit. if you wish to use more than one RH-02, you should call the routine once for each RH-02. the port must be 1 for com1, 2 for com2, etc. under dos, this routine has extra parameters to specify the base address an short interrupt number for the com port. these can be set to zero for the default base address and irq. see serial port settings for more information under windows, the base address and irq information is defined within windows, so it is not necessary to specify a value. this routine returns true if the driver successfully opens the RH-02. rh02_close_unit void rh02_close_unit (unsigned short int port); this routine disconnects the driver from the specified serial port. if you successfully open any serial ports, you must call rh02_close_unit for each port before you exit from your program. if you do not, your computer may misbehave until you next reboot it. rh02_get_cycle short int rh02_get_cycle (long * cycle, short int port); this routine returns the number of complete cycles of readings taken from a particular rh - 02 . when you call rh02_get_value , it returns immediately with the most recent reading for the specified channel. if you call it repeatedly, it will return the same reading repeatedly, until the driver takes the next reading from that channel. if you wish to record values only when the driver has taken a new reading, you can use this routine to find out how many complete cycles of readings the driver has taken, then you can call rh02_get_value only when a cycle has completed. note: each RH-02 is polled independently, so the cycle numbers for multiple RH-02s may not keep in step. rh02_get_value short int rh02_get_value ( long * value, short int port, short int channel, short int filtered); once you open the driver, the driver constantly takes readings from the RH-02. when you call this routine, it immediately sets value to the most recent reading for the specified channel. the temperature is in hundredths of a degree celsius, and the humidity in hundredths of a percent. if a reading is available, it returns true , otherwise it returns false . it will normally return false for a few seconds after you open the driver, until the driver has taken a reading from the specified channel. channel should be 1 for channel temperature, 2 for humidity. if you set filtered to true , the driver returns a low-pass filtered value of the temperature. the time constant of the filter depends on the value of filter_factor for this channel, and on how many channels are active. rh02_get_version short int rh02_get_version ( short int * version, short int port); this routine sets version to version number of the specified RH-02. the upper byte of the version is always 8 for a RH-02: the lower byte is the two hex digits of the version and release. it provides a useful check that the link to the RH-02 is working correctly. dos driver the dos driver is supplied in two object files, rh02drv.obj and commdrv.obj . it can be used in both c and pascal programs. windows 16-bit driver the windows 16-bit driver is the file rh0216.dll : it is installed in the drivers\win directory. if an application is unable to find the dll, try moving the dll to \windows\system . it has been tested under windows 3.11 and under windows 95 with the following 16-bit applications: borland c 4.5 delphi 1 visual basic 3 excel 5 windows 95/98 windows 95 and 98 can run both 16-bit and 32-bit applications. for 16-bit applications, see windows 3.1. the windows 32-bit driver is the file rh0232.dll : it is installed in the drivers\win32 directory. if an application is unable to find the dll, try moving the dll to \windows\system . windows nt/2000 most applications running under windows nt are 32-bit applications. the windows 32-bit driver is the file rh0232.dll : it is installed in the drivers\win32 directory. if an application is unable to find the dll, try moving the dll to \windows\system . linux a linux driver is under development: please check the drivers section of the pico technology web site ( http:// www.picotech.com/drivers.html ) for availability. c dos to link the driver into you program, you should take the following steps: #include the header file rh02.h into your program if you are using an ide, include the file rh02 drv.obj and commdrv.obj in you project. if you are using a command-line compiler, include the file rh02drv.obj and commdrv.obj in you linkfile. c / c++ windows the c example program is a generic windows application- ie it does not use borland appexpert or microsoft appwizard. to compile the program, create a new project for an application containing the following files: rh02tes.c rh02tes.rc either rh0216.lib (all 16-bit applications) or rh0232.lib (borland 32-bit applications) or rh02ms.lib (microsoft visual c 32-bit applications) the following files must be in the same directory: rh02tes.rch rh02w.h either rh0216.dll (all 16-bit applications) or rh0232.dll (all 32-bit applicaitons) c++ c++ programs can access all versions of the driver . if adc11 . h or adc11w . h are included in a c++ program , the pref1 macro expands to extern c : this disables name-mangling (or decoration, as microsoft call it), and enables c++ routines to make calls to the driver routines using c headers. pascal the program rh02pas.pas can be compiled either as a stand-alone program {$define main} or as a unit which can be linked short into other programs {$undef main} . rh02pas.pas includes the driver using the {$l rh02drv.obj} and {$l commdrv.obj} commands: it also provides pascal prototypes for each of the routine in the driver. this program has been tested with borland turbo pascal v6.0. delphi the win sub-directory contains a simple program rh02.dpr which opens the drivers and reads temperatures from the three channels. you will need the following files to build a complete program. rh02fm.dfm rh02fm.pas rh02.inc the file rh02.inc contains procedure prototypes for the driver routines: you can include this file in your application. this example has been tested with delphi versions 1, 2 and 3. excel the easiest way to get data into excel is to use picolog for windows. if, however, you need to do something that is not possible using picolog, you can write an excel macro which calls the driver to read in a set of data values. the excel macro language is similar to visual basic. excel 5 the example rh0216.xls reads in 20 values of the channel 1 temperature, one per second, and assigns them to cells a1..a20. excel 7 the example rh0232.xls reads in 20 values of the channel 1 temperature, one per second, and assigns them to cells a1..a20. visual basic version 3 (16 bits) the drivers\win16 sub-directory contains a simple visual basic program, rh0216.mak . rh0216.mak rh0216.frm note that it is usually necessary to copy the .dll file to your \windows\system directory. version 4 and 5 (32 bits) the drivers\win32 sub-directory contains the following files: rh0232.vbp rh0232.bas rh0232.frm labview the routines described here were tested using labview for windows 95 version 4.0. while it is possible to access all of the driver routines described earlier, it is easier to use the special labview access rou tine. the rh02.llb library in the drivers\win32 sub-directory shows how to access this routine. to use this routine, copy rh02 .llb and rh0232.dll to your labview user.lib directory. you the rh02 sub-vi will now appear in the user libraries box. you can load the rh02_example sub-vi which demonstrate how to use it. the sub-vi accepts the port (1 for com1) and, optionally, whether to filter the data. it returns the temperature in degrees celsius and the relative humidity in percent. hp-vee the example program rh02.vee is in the drivers\win32 directory. it was tested using hp-vee version 5 under windows 95. the example shows how to collect readings continuously from the rh02. serial port settings the following table shows the standard serial port settings for com ports. port base address interrupt standard? com1 3f8 4 yes com2 2f8 3 yes com3 3e8 4 de facto com4 2e8 3 de facto com5... no note that, on most computers, it is not possible to use the same interrupt for two serial ports at the same time. if, for example, you wish to use com1 and com3 at the same time, it is necessary to use a serial port card which can be set to an interrupt other than 4. these can be obtained either from pico technology or your computer supplier. connections the information presented here is necessary only if you wish to connect the rh02 to the pc in some unusual way (for example, via a radio modem). the RH-02 uses the following rs232 data lines (pin connections as on RH-02) pin name usage 3 tx data from the pc to the RH-02 2 rx data from the RH-02 to the pc 7 rts held at a positive voltage (>7v) to power the RH-02 5 gnd 0v line 4 dtr held at a negative voltage (<-7v) to power the RH-02 the driver powers up the RH-02 by enabling rts and disabling dtr to provide the correct polarity power supply. if these are set incorrectly no damage will occur to either pc or RH-02. protocol the RH-02 operates at 2400 baud with 1 stop bit and no parity. the driver controls the RH-02 using the following sequence 1. switch rts on and dtr off to provide power. 2. wait for more than 1 second for the rh02 to settle 3. send an single control byte to the rh02 4. wait for a response from the rh02 steps 3 and 4 are repeated for each measurement. the rh02 signals the end of conversion by sending a block of bytes. no data should be sent to the rh02 during the conversion, as it may be lost or corrupted. the rh02 accepts the following commands: command function response length response 0x01 2 rh02 version 0x02 32 rh02_info (see below) 0x04 2 temperature reading 0x05 2 humidity reading the rh02 version response is made up of a 2 (for rh02) followed by the version number (currently 1). the rh02_info block contains the following information: typedef struct { unsigned short checksum; uns i gne d c h ar vers i on; unsigned char spare1; unsigned short ref_low; unsigned short ref_high; char batch [6]; unsigned short unit; char cal_date [8]; char spare2 [8]; } rh02_info; the temperature reading is converted to a temperature using the following table: static unsigned short humtemp_table [] = { /* 0000 */ 14522u, /* 0001 */ 15142u, /* 0002 */ 15776u, /* 0003 */ 16425u, /* 0004 */ 17087u, /* 0005 */ 17754u, /* 0006 */ 18441u, /* 0007 */ 19139u, /* 0008 */ 19849u, /* 0009 */ 20569u, /* 0010 */ 21290u, /* 0011 */ 22028u, /* 0012 */ 22774u, /* 0013 */ 23527u, /* 0014 */ 24287u, /* 0015 */ 25042u, /* 0016 */ 25811u, /* 0017 */ 26584u, /* 0018 */ 27360u, /* 0019 */ 28138u, /* 0020 */ 28905u, /* 0021 */ 29684u, /* 0022 */ 30461u, /* 0023 */ 31236u, /* 0024 */ 32009u, /* 0025 */ 32768u, /* 0026 */ 33532u, /* 0027 */ 34292u, /* 0028 */ 35046u, /* 0029 */ 35794u, /* 0030 */ 36523u, /* 0031 */ 37255u, /* 0032 */ 37979u, /* 0033 */ 38693u, /* 0034 */ 39398u, /* 0035 */ 40082u, /* 0036 */ 40766u, /* 0037 */ 41439u, /* 0038 */ 42101u, /* 0039 */ 42751u, /* 0040 */ 43379u, /* 0041 */ 44005u, /* 0042 */ 44618u, /* 0043 */ 45219u, /* 0044 */ 45808u, /* 0045 */ 46373u, /* 0046 */ 46936u, /* 0047 */ 47485u, /* 0048 */ 48022u, /* 0049 */ 48545u, /* 0050 */ 49047u }; the humidity reading is converted to a relative humidity using the following procedure: humidity = (value - rh02_info.ref_low) * 100 / (rh02_info.ref_high - rh02_info.ref_low); temp_correction = (temp - 25) * 0.00216; humidity = humidity / (1 - temp_correction); modem operation the RH-02 is normally connected directly to the computer, but it is also possible to access the RH-02 via a modem using the windows driver. it is necessary to provide power to the RH-02, either by instructing the modem to provide power or by c onnecting a power supply directly to the rh02. see serial connections for information. for some radio modems, there is a delay between sending text to the modem and its arrival at the other end, and a similar delay for the response from the rh 02. if, for example, the maximum possible delay is 150ms each way, 300ms total, the following text should be added to win.ini so that the driver waits longer for each response. [rh02] turnround=300 |
|
Price & Availability of RH-02
|
|
|
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
| [Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
|
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |