PIC Lesson: HR202 Humidity Sensor


HR202 adalah salah satu Humidity Sensor. Di bawah adalah gambar HR202 humidity sensor dengan keluarannya digital dan analog.

HR202 Humidity Sensor

HR202 Humidity Sensor Ex

Sensor ini disambungkan 5V, GND, digital signal dan analog signal.

Berikut adalah videonya.

PIC Source Code

Sertai Telegram Group bagi dapatkan source code


13 responses to “PIC Lesson: HR202 Humidity Sensor”

  1. Slm. T. Kaseh. Abng, sila boleh tolong “code”, MBLAP COde, for this project. sy tak tahu PM, tapi sikit lah. 🙂 sila tolong, T. Kaseh

  2. Salam, saudara shahrul,saya ade membuat satu projek untuk temperature dgn humidity mgunakan pic16f877a, component yg sama utk humidity (HR202). Saya telah membuat coding sendiri dan terdapat kesilapan dalam coding saya. Saya minta jasa baik tuan untuk memeriksa coding saya. Saya mggunakan humidity sensor kat a01(kaki no 3|) dan temp sensor kat a02(kaki no 4). Saya meminta jasa baik en shahrul untuk memeriksa, disebabkan bahagian temperature telah siap,tetapi tidak boleh di sekalikan dengan bahagian humidity. Koding :

    // Lcd pinout settings
    sbit LCD_RS at RB0_bit;
    sbit LCD_EN at RB1_bit;
    sbit LCD_D4 at RB2_bit;
    sbit LCD_D5 at RB3_bit;
    sbit LCD_D6 at RB4_bit;
    sbit LCD_D7 at RB5_bit;

    // Pin direction
    sbit LCD_RS_Direction at TRISB0_bit;
    sbit LCD_EN_Direction at TRISB1_bit;
    sbit LCD_D4_Direction at TRISB2_bit;
    sbit LCD_D5_Direction at TRISB3_bit;
    sbit LCD_D6_Direction at TRISB4_bit;
    sbit LCD_D7_Direction at TRISB5_bit;

    unsigned int adc;
    char k[14];
    char l[14];
    char loop1;
    char loop2;
    char loop3;
    char loop4;
    int adc2;
    int adc1;

    void main()
    {
    ADCON1 = 0x80; // Configure analog inputs and Vref
    TRISA = 0xFF; // PORTA is input
    TRISD=0;PORTD=0;
    Lcd_Init();
    Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
    Lcd_Out(1,1, “HUMIDITY & TEMP”);
    Lcd_Out(2,1, “MONITORING”);
    delay_ms(2000);
    Lcd_Cmd(_LCD_CLEAR);

    Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
    Lcd_Out(1,1, “TEMP:”);
    Lcd_Out(2,1, “RS:”);
    Lcd_Out(2,6, “%”);
    delay_ms(500);

    PORTD=0B00000000;

    while(1)
    {
    l2:
    PORTD=0B00000000;
    adc = Adc_Read(2);
    adc2 = 0.49*adc;
    IntToStr(adc2,k);
    lcd_out(1,6,k);
    goto l7;
    }

    while(1)
    {
    l7:
    if(adc2>27&&adc231)
    {
    Lcd_Out(2,1, “Temp:”);
    PORTD=0B00001010;
    delay_ms(60000);
    PORTD=0B00001010;
    delay_ms(3500);

    }

    while(1)
    {
    l3:
    PORTD=0B00000000;
    adc = Adc_Read(1);
    adc1 = 4.888*adc;
    IntToStr(adc1,k);
    lcd_out(2,4,k);
    goto l8;
    }
    while(1)
    {
    l8:
    if(adc2>80)
    {
    Lcd_Out(2,1, “RS:”);
    PORTD=0B00001000;
    delay_ms(60000);
    PORTD=0B00001000;
    delay_ms(3500);
    goto l7;
    }

    }
    }
    }

  3. how your supplying Power supply: 1.5V AC(Max sine).Operating frequency: 500Hz-2kHz. to HR202 humidity sensor element ? i know you have use hr202 sensor module with 3 to 5 V supply .
    and please send hr202 calibration equation to convert adc smaples to % humidity .

Leave a Reply

Your email address will not be published. Required fields are marked *