Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Automatic control and display of Room temperature

Status
Not open for further replies.

AFTERDATE

New Member
hello to all

could any one help me . i have this circuit

and i have a code or the program does't work i do't know.

thank you very much
+++++++++++++ (1)

Device =16F877
XTAL 4
Declare LCD_DTPIN PORTB.4
Declare LCD_ENPIN PORTB.3
Declare LCD_INTERFACE 4
Declare LCD_RSPIN PORTB.2
Declare ADIN_RES 10
Declare ADIN_TAD frc
Declare ADIN_STIME 50
Input PORTA.0
ADCON1 = %10000000
Dim volt As Float
main:
volt=ADIn 0
Print At 1,1,@volt
If volt=127 Then
PORTC.0=1
Else
EndIf
GoTo main

++++++++++++++++ (2)

Device 16F877
XTAL 4
Output PORTB
Symbol led = PORTB
Dim I As Byte
Main:
led = 255
DelayMS 500
For I=0 To 7
PORTB=PORTB << 1
PORTB=led
DelayMS 500
Next I
GoTo Main

+++++++++++++++++++++++ (3)
Device =16F877
XTAL 4
Declare LCD_DTPIN PORTB.4
Declare LCD_ENPIN PORTB.3
Declare LCD_INTERFACE 4
Declare LCD_RSPIN PORTB.2
Declare ADIN_RES 10
Declare ADIN_TAD frc
Declare ADIN_STIME 50
Input PORTA.0

Output PORTB
Output PORTC

Dim var1 As Byte
Dim volt As Byte
main:
var1=ADIn 1
volt= var1
GoSub compar
GoTo main
compar:
If var1 <150 Then
PORTB.2=1
Else
PORTB.2=0
EndIf
Return

+++++++++++++++++++ (4)
Device = 16F877
XTAL 4
Declare LCD_DTPIN PORTB.4
Declare LCD_ENPIN PORTB.3
Declare LCD_INTERFACE 4
Declare LCD_RSPIN PORTB.2
Dim x As Float
Dim y As Float
y=58.5
x=665.25
label:
Print At 1,1,"hi Ali"
DelayMS 1000
Print At 2,1,Dec y
GoTo label
 

Attachments

  • picture_120.jpg
    picture_120.jpg
    50.1 KB · Views: 651
Can't help much on the code, as it's specific to your compiler, but the circuit looks rather lacking?.

Where are the capacitors on the crystal?, what about a driver for the relay, and there are not enough connections to the LCD (to name but a few!).
 
Hi,

1. Check out the Driver for relay
2. It will be good if u have a few coupling capacitors.
3. Check for proper connections of the controller......
4. Try to give seperate power for LCD if u are having problems..
 
You have the fan inline with the relay coil? Or do you have the relay contact going to the PIC? Also, when you add the driver for the relay, add a diode across the coil..

I will look at the code when I get to work, but if that is your schematic, Nigel is right, it will not work.
 
When you say it does not work.. What does not work, everything, the relay, the LCD.. You need to re-draw the circuit for everyone to start with.
 
@threadstarter

If you think you can take a quick shortcut by writing code in who knows what version PIC basic and expect to make your project work from the starting gate, you're dreaming. Take few baby steps first and try to do a few simple stuff first like making the lcd module display a short message. Then test if you can turn ON/OFF the relay. Only after that should you attempt to make it work all together.

As to the hardware, Nigel is right and you have to clean it up first. Add 0.1uF bypass caps across each pair of the VCC supply and ground pins too.
 
Let me point out some things.

#1. The R/S should Not be left floating, because its state tells the LCD what mode to be in, and the R/S line must be used for the LCD to display characters properly.

#2. The VEE line is most likely your contrast pin. If it continues to float, chances are you will see nothing on the screen.

What you need is a 3-pin pot that should be at least 10K. Connect the two outer pins to +ve and ground. (one outer pin to +ve, then one outer pin to ground). Connect the middle pin to VEE.

Now you can turn the knob to adjust the contrast.
 
you will also need diode accross inductive load (fan or relay).
 
Status
Not open for further replies.

Latest threads

Back
Top