top of page
Writer's pictureSanskruti Ashtikar

Wireless Temperature Monitoring System Using 8051 Microcontroller

Introduction


Monitoring temperature remotely is crucial in many applications, including industrial processes, environmental monitoring, and smart homes. A wireless temperature monitoring system provides real-time temperature data without the need for physical access to the sensor location. This article explores the design and implementation of a wireless temperature monitoring system using the 8051 microcontroller.


Components Required


  1. 8051 Microcontroller

  2. Temperature Sensor (LM35)

  3. RF Module (Transmitter and Receiver)

  4. LCD Display (16x2)

  5. Power Supply

  6. Connecting Wires

  7. Resistors, Capacitors, and other passive components


System Overview


The wireless temperature monitoring system consists of a temperature sensor (LM35) to measure temperature, an RF module to transmit and receive data wirelessly, and an 8051 microcontroller to process and display the data. The temperature sensor sends an analog signal to the microcontroller, which converts it to a digital signal, processes it, and transmits it wirelessly. The receiver side receives the data and displays the temperature on an LCD.


Circuit Diagram


Transmitter Section:



Receiver Section:



Note: Add the circuit diagram images as described above.


Working Principle


  1. Temperature Sensing: The LM35 temperature sensor generates an analog voltage proportional to the temperature. The output of the LM35 is connected to the ADC input of the 8051 microcontroller.

  2. Analog to Digital Conversion: The 8051 microcontroller reads the analog voltage from the LM35 sensor and converts it to a digital value using its built-in ADC.

  3. Wireless Transmission: The microcontroller sends the digital temperature data to the RF transmitter module, which transmits the data wirelessly to the receiver module.

  4. Data Reception and Display: The RF receiver module receives the data and sends it to the 8051 microcontroller on the receiver side. The microcontroller processes the data and displays the temperature on the LCD.


Circuit Design


1. Transmitter Section:

  • Connect the Vout pin of the LM35 temperature sensor to one of the ADC input pins of the 8051 microcontroller.

  • Connect the data pin of the RF transmitter module to the microcontroller's UART (TX) pin.

  • Connect Vcc and GND pins of both the LM35 and the RF module to the power supply.

2. Receiver Section:

  • Connect the data pin of the RF receiver module to the microcontroller's UART (RX) pin.

  • Connect the data pins of the LCD to the designated ports of the 8051 microcontroller.

  • Connect the control pins (RS, RW, E) of the LCD to the appropriate microcontroller pins.

  • Connect Vcc and GND pins of both the RF module and the LCD to the power supply.


Programming the 8051 Microcontroller


The program for the 8051 microcontroller is written in Embedded C. It involves initializing the ADC, reading the temperature sensor values, transmitting the data wirelessly, and displaying the received data on the LCD.


Transmitter Code:


#include <reg51.h>
// Define connections
sbit ADC_CS = P1^0; // Chip select
sbit ADC_RD = P1^1; // Read
sbit ADC_WR = P1^2; // Write
sbit ADC_INTR = P1^3; // Interrupt
sfr ADC_DATA = 0x90; // ADC data port
void delay(unsigned int ms) {
    unsigned int i, j;
    for(i = 0; i < ms; i++) {
        for(j = 0; j < 1275; j++);
    }
}
unsigned int read_adc() {
    unsigned int adc_value;
    ADC_CS = 0;
    ADC_RD = 1;
    ADC_WR = 0;
    delay(1);
    ADC_WR = 1;
    while(ADC_INTR == 1);
    ADC_RD = 0;
    adc_value = ADC_DATA;
    ADC_CS = 1;
    return adc_value;
}
void uart_init() {
    TMOD = 0x20; // Timer1 mode 2
    TH1 = 0xFD; // 9600 baud rate
    SCON = 0x50; // 8-bit UART mode
    TR1 = 1; // Start Timer1
}
void uart_transmit(unsigned char data) {
    SBUF = data;
    while(TI == 0);
    TI = 0;
}
void main() {
    unsigned int temperature;
    uart_init();
    while(1) {
        temperature = read_adc();
        uart_transmit(temperature);
        delay(1000);
    }
}

Receiver Code:

#include <reg51.h>
// Define connections
sbit RS = P2^0;
sbit RW = P2^1;
sbit EN = P2^2;
sfr LCD_DATA = 0xA0; // LCD data port
void delay(unsigned int ms) {
    unsigned int i, j;
    for(i = 0; i < ms; i++) {
        for(j = 0; j < 1275; j++);
    }
}
void lcd_cmd(unsigned char cmd) {
    LCD_DATA = cmd;
    RS = 0;
    RW = 0;
    EN = 1;
    delay(1);
    EN = 0;
}
void lcd_data(unsigned char data) {
    LCD_DATA = data;
    RS = 1;
    RW = 0;
    EN = 1;
    delay(1);
    EN = 0;
}
void lcd_init() {
    lcd_cmd(0x38); // 2 lines, 5x7 matrix
    lcd_cmd(0x0C); // Display on, cursor off
    lcd_cmd(0x06); // Increment cursor
    lcd_cmd(0x01); // Clear display
}
void lcd_string(unsigned char *str) {
    while(*str) {
        lcd_data(*str++);
    }
}
void uart_init() {
    TMOD = 0x20; // Timer1 mode 2
    TH1 = 0xFD; // 9600 baud rate
    SCON = 0x50; // 8-bit UART mode
    TR1 = 1; // Start Timer1
}
unsigned char uart_receive() {
    while(RI == 0);
    RI = 0;
    return SBUF;
}
void main() {
    unsigned int temperature;
    char temp_str[4];
    lcd_init();
    uart_init();
    while(1) {
        temperature = uart_receive();
        sprintf(temp_str, "%d", temperature);
        lcd_cmd(0x80); // Move to first line
        lcd_string("Temperature: ");
        lcd_string(temp_str);
        lcd_string(" C");
        delay(1000);
    }
}

Conclusion


A wireless temperature monitoring system using the 8051 microcontroller is an efficient solution for real-time temperature monitoring in various applications. This article outlines the components, circuit design, and programming required to build the system. With further enhancements such as additional sensors and more advanced communication protocols, this system can be adapted for more complex and large-scale applications.


Want us to guide you through your project or make the project for you ?






Create Various Projects

Check out our Free Arduino Projects Playlist - Arduino Projects 

Check out our Free Raspberry Pi Projects Playlist - Raspberry Pi Projects 

Check out our Free TinkerCAD Projects Playlist - TinkerCAD Projects 

Check out our Free IoT Projects Playlist - IoT Projects 

Check out our Free Home Automation Projects Playlist - Home Automation Projects 

Check out our Free NodeMCu Projects Playlist - NodeMCu Projects 


0 views0 comments

Related Posts

See All

Komentar