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.

PIC16F887 microcontroller interface with RS 232

Status
Not open for further replies.

salimabdullah

Newbie level 3
Joined
Dec 12, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,346
I want to design project include microcontroller programmed based on gas leak sensed by gas sensor . Starting at minimum range of 10 PPM(part per million) gas leak measured by the gas sensor,it will send signal to PIC16F887 microcontroller and should be displayed in LCD display. in addition, the microcontroller also will send signal interface with serial port RS 232 to send the signal as message through GSM modem to the authorised person,informing him (there is gas leak). The authorised person can replay by message to the GSM modem and MAX 232 will convert the message as signal received to PIC16F887 microcontroller.in the same time, the microcontroller will acknowledge solenoid valve to shut it off and isolate the leak. i have started to write LCD and UART codes. As showing here:
// 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;


void main()
{
void Lcd_Init();
Lcd_Out(1, 1, "LPG Detector");
Lcd_Cmd(_LCD_CURSOR_OFF);



_void(){
UART_init(9600) ;

UART_Write_Text("AT+CMGS="); //AT+CMGS=
Delay_ms(1000);
UART_Write(0x22); //"
Delay_ms(2000);
UART_Write_Text("0060179291471"); // my no
Delay_ms(2000);
UART_Write(0x22);
UART_Write(0x0D); //(CR) means Enter
Delay_ms(2000);
UART_Write_Text("PLG Leack concentration > 10ppm"); // my text
UART_Write(0x0D); //(CR) means Enter
Delay_ms(2000);
UART_Write(26); // Ctrl z
Delay_ms(2000);
//(CR) means Enter
UART_Write(0x0D);
Delay_ms(2000);

}

now, i am not sure how i link both LCD and UART codes and how do i add extra commands based on my project functions and how can i include them with these codes. For example, in my project the gas leak starting at 10ppm should be displayed in the LCD. How can i write code for this when gas sensor start giving signal to PIC? And how I complete the code when the authorized person send signal to the gsm/mobile(modem) and another code for PIC giving command to acknowledge and close the valve? I am beginner, so please bear with me and I really will appreciate any help. The URL bellow is my project simplfy circuit for my project

https://obrazki.elektroda.pl/94_1323684944.png

---------- Post added at 11:38 ---------- Previous post was at 11:36 ----------

can anyone help me to complete the codes based of the exploitation of how the circuit works
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top