Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interfacing HS1101 to AT89s52

Status
Not open for further replies.

vallarakesh

Newbie level 5
Joined
May 5, 2011
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,338
i need to interface the humidity sensor in my project.
the data sheet for HS1101 is not so clear and i am facing problem with its interfacing.
can any one give the interfacing circuit and a sample program for "interfacing HS1101 to AT89S52".
 

thanks for your reply friend but i am not having idea about pic controllers.
can we interface HS1101 to AT89s52 in same way as you have interfaced to pic?
 

thanks for your reply friend but i am not having idea about pic controllers.
can we interface HS1101 to AT89s52 in same way as you have interfaced to pic?

Ok. I can give you the idea only as I dont have ready code.

Step 1:
Develop a circuit using 8051 to calculate frequency of a signal.
As we all know frequency of a signal is number of cycles per second.
Once I did a similar project as follows--8051 has two timers, Timer 0 is configured for 1 second delay to sample the input signal and Timer 1 is used as a counter to calculate number of cycles in that 1 second. If timer1 overflows then the overflow is counter in another register which is considered as the high byte of Frequency. Input signal is provided at P3.5/T1 which is input for Timer 1 in counter mode. You will find similar codes in net also in Mazidi's book.

Step2

In the datasheet of HS1101 you will get a circuit diagram using IC555 and HS1101.
This circuit is the typical astable design for 555.
The HS1100/HS1101, used as variable capacitor, is connected to the TRIG and THRES pin. Pin 7 is used as a short circuit pin for resistor R4. The HS1100/HS1101 equivalent capacitor is charged through R2 and R4 to the threshold voltage (approximately 0.67Vcc) and discharged through R2 only to the trigger level (approximately 0.33Vcc) since R4 is shorten to ground by pin 7. R1 unbalances the internal temperature compensation scheme of the 555 in order to introduce a temperature coefficient that matches the HS1100/HS1101 temperature coefficient. In all cases, R1 should be a 1% resistor with a maximum of 100ppm coefficient temperature like all other R-C timer resistors. Since 555 internal temperature compensation changes from one trademark to one other, R1 value should be adapted to the specific chip. To keep the nominal frequency of 6660Hz at 55%RH, R2 also needs slight adjustment. Details in the datasheet.

Fout of the circuit is output and this is the line that will be used to sense requency by microcontroller.

Step 3
See the datasheet for typical response lookup table showing RH% represented by frequency.

///////////////
Example code for the calculation of moisture from the frequency:
caculate_rh void (void)
{
float f;
if (period! = 0)
/ / Period is the result from the Input-capture
{
f = 16 / (float) period * 1000000;
/ / This example uses 16MHz crystal frequencies. Results in units Hz
if (k <3)
/ / For example, averaging 3 consecutive samples
{
Fsum = (Fsum + f);
k + +;
}
if (k == 3)
{
Fsum = Fsum / 3;
rh = RHR + (F-Fsum) * 0.0762 + 0,001 * (temp-T);
Fsum = 0;
k = 0;
}
}
}
Standardization of moisture for HS1101
In the above example, the humidity is calculated as follows:
rh = RHR + (F-Fsum) * 0.0762 + 0,001 * (temp-T);
RHR: Moisture content of standardized
F: Frequency of standardized
T: Temperature of standardization.
0001: Temperature Coefficient of moisture, are described in the HS1101 datasheet, showing the influence

of temperature to humidity RH / ° C.
0.0762: coefficient of moisture (you can find this ratio in each frequency partition, then the moisture measured as accurately)
The standardized coefficient, RHR, F, T is the parameter when you use the sensor with higher accuracy HS1101

Note when the measuring frequency:
- You should get an average number of consecutive samples to be concentrated in the frequency of the frequency
- Adjust R4, R5, R6, R7 so ​​that the frequency of 6660Hz to 55% relative humidity (25 ° C). Typical circuit values ​​or as the HS1101 datasheet.

Hope this will help
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top