Forum Replies Created
-
AuthorPosts
-
August 13, 2015 at 6:20 pm in reply to: Temperature Sensor : Interfacing LM35 and LCD Display to PIC18F4550 #13163Prabakaran P MParticipant
can u tell me whether the character TEMPERATURE is displaying are not?
Prabakaran P MParticipantPlease make the question more clear
Prabakaran P MParticipantHi erika,
Connect one end of LDR to ground and the other end to positive through a resistor not less than 1K.
Connect the common point of LDR and the resistor to one of the ADC pin of the ATMEGA.
Prabakaran P MParticipant
#define _XTAL_FREQ 8000000
#define RS RD2
#define EN RD3
#define D4 RD4
#define D5 RD5
#define D6 RD6
#define D7 RD7
#include <xc.h>
#include "lcd.h";
#include <pic16f877a.h>
// BEGIN CONFIG
#pragma config FOSC = HS
#pragma config WDTE = OFF
#pragma config PWRTE = OFF
#pragma config BOREN = ON
#pragma config LVP = OFF
#pragma config CPD = OFF
#pragma config WRT = OFF
#pragma config CP = OFF
//END CONFIG
int a;
void interrupt echo()
{
if(RBIF == 1) //Makes sure that it is PORTB On-Change Interrupt
{
RBIE = 0; //Disable On-Change Interrupt
if(RB4 == 1) //If ECHO is HIGH
TMR1ON = 1; //Start Timer
if(RB4 == 0) //If ECHO is LOW
{
TMR1ON = 0; //Stop Timer
a = (TMR1L | (TMR1H<<)/58.82; //Calculate Distance
}
}
RBIF = 0; //Clear PORTB On-Change Interrupt flag
RBIE = 1; //Enable PORTB On-Change Interrupt
}
void main()
{
TRISB = 0b00010000; //RB4 as Input PIN (ECHO)
TRISD = 0x00; // LCD Pins as Output
GIE = 1; //Global Interrupt Enable
RBIF = 0; //Clear PORTB On-Change Interrupt Flag
RBIE = 1; //Enable PORTB On-Change Interrupt
Lcd_Init();
Lcd_Set_Cursor(1,1);
Lcd_Write_String("Developed By");
Lcd_Set_Cursor(2,1);
Lcd_Write_String("electroSome");
__delay_ms(3000);
Lcd_Clear();
T1CON = 0x10; //Initialize Timer Module
while(1)
{
TMR1H = 0; //Sets the Initial Value of Timer
TMR1L = 0; //Sets the Initial Value of Timer
RB0 = 1; //TRIGGER HIGH
__delay_us(10); //10uS Delay
RB0 = 0; //TRIGGER LOW
__delay_ms(100); //Waiting for ECHO
a = a + 1; //Error Correction Constant
if(a>=2 && a<=400) //Check whether the result is valid or not
{
Lcd_Clear();
Lcd_Set_Cursor(1,1);
Lcd_Write_String("Distance = ");
Lcd_Set_Cursor(1,14);
Lcd_Write_Char(a%10 + 48);
a = a/10;
Lcd_Set_Cursor(1,13);
Lcd_Write_Char(a%10 + 48);
a = a/10;
Lcd_Set_Cursor(1,12);
Lcd_Write_Char(a%10 + 48);
Lcd_Set_Cursor(1,15);
Lcd_Write_String("cm");
}
else
{
Lcd_Clear();
Lcd_Set_Cursor(1,1);
Lcd_Write_String("Out of Range");
}
__delay_ms(400);
}
}
LCD.H
//LCD Functions Developed by electroSomevoid Lcd_Port(char a){if(a & 1)D4 = 1;elseD4 = 0;if(a & 2)D5 = 1;elseD5 = 0;if(a & 4)D6 = 1;elseD6 = 0;if(a &D7 = 1;elseD7 = 0;}void Lcd_Cmd(char a){RS = 0; // => RS = 0Lcd_Port(a);EN = 1; // => E = 1__delay_ms(4);EN = 0; // => E = 0}Lcd_Clear(){Lcd_Cmd(0);Lcd_Cmd(1);}void Lcd_Set_Cursor(char a, char b){char temp,z,y;if(a == 1){temp = 0x80 + b – 1;z = temp>>4;y = temp & 0x0F;Lcd_Cmd(z);Lcd_Cmd(y);}else if(a == 2){temp = 0xC0 + b – 1;z = temp>>4;y = temp & 0x0F;Lcd_Cmd(z);Lcd_Cmd(y);}}void Lcd_Init(){Lcd_Port(0x00);__delay_ms(20);Lcd_Cmd(0x03);__delay_ms(5);Lcd_Cmd(0x03);__delay_ms(11);Lcd_Cmd(0x03);/////////////////////////////////////////////////////Lcd_Cmd(0x02);Lcd_Cmd(0x02);Lcd_Cmd(0x08);Lcd_Cmd(0x00);Lcd_Cmd(0x0C);Lcd_Cmd(0x00);Lcd_Cmd(0x06);}void Lcd_Write_Char(char a){char temp,y;temp = a&0x0F;y = a&0xF0;RS = 1; // => RS = 1Lcd_Port(y>>4); //Data transferEN = 1;__delay_us(40);EN = 0;Lcd_Port(temp);EN = 1;__delay_us(40);EN = 0;}void Lcd_Write_String(char *a){int i;for(i=0;a!='';i++)Lcd_Write_Char(a);}void Lcd_Shift_Right(){Lcd_Cmd(0x01);Lcd_Cmd(0x0C);}void Lcd_Shift_Left(){Lcd_Cmd(0x01);Lcd_Cmd(0x08);}Prabakaran P MParticipantsave the above file in xxxx.h extension. call this function in the new project using <xxxx.h>
Use Setcursor(x,y) to call the function in new code.
Prabakaran P MParticipanthttp://www.engineersgarage.com/electronic-circuits/battery-level-indicator
you can refer this link for you design i could'nt help you in getting ready made pcb board.
Prabakaran P MParticipantYou can use a flexible rheostat which is to be custom designed for this project. which will result in resistance difference according to where the metal part of the belt touches the belt. like a linear variable resistance. which can be converted to the length and transferred to any device.
Prabakaran P MParticipanthttp://www.engineersgarage.com/embedded/avr-microcontroller-projects/sd-card-interfacing-project
Refer this link it may help you..
Prabakaran P MParticipantPlease give some more details about the TFT screen you have like model number are purchase links like that.
Prabakaran P MParticipantDivide your project into small parts like battery monitoring system, solar charger circuit design, changing brightness of LED using LDR. this can help you to approach your project easily.
Prabakaran P MParticipantDo search for some online vendors.
Prabakaran P MParticipantCheck whether you connect pulldown resistor to the ground and capacitance to 5v?
Prabakaran P MParticipantCheck with other LCD if you have
July 23, 2015 at 4:18 am in reply to: How to interface both lcd and multiplexed seven segment display with a single arduino #13096Prabakaran P MParticipantYES, you can use 7 segment drivers like MAX6954,HEF4543B,MAX7219CNG
Prabakaran P MParticipantSFGDemoV2.0 this is the software to connect R305 sensor with Computer. First connect the sensor with computer and try to access it using terminal softwares.
-
AuthorPosts