![]() | ![]() | ![]() |
| | #31 |
|
HI Birdman 0 i have been off for 5 days. im glad to see that code you have paste. i have tested it on MPLAB and i was happy with the results. below is my code which i tried to correct it before i got that one. Code:
;PROGRAM FUNCTION:light control for smart home
;Written by: : Lebohang Maphothoane
list P=16F877a
include "P16F877a.inc"
__config 0x3D18
;errorlevel -302, -207;suppress message 302 from the list
;Declarations:
NumH equ 20h
NumL equ 21h
org 0x0000
goto Start
;Program Start:
Start
call Init ;sets the values of ADCON0 and ADCON1
;initialize porta
Main
; Read_ADC
bsf ADCON0, GO_DONE ;initiate conversion
btfsc ADCON0, GO_DONE
goto $-1 ;wait for ADC to finish
movf ADRESH,W
andlw 0x03
movwf NumH
BANKSEL ADRESL
movf ADRESL,W
BANKSEL ADRESH
movwf NumL ;return result in NumL and NumH
btfss NumH,1
goto led_on
bcf PORTA,4 ; turn 0ff the LED
goto Main
led_on
bsf PORTA,4 ;turn on the LED
goto Main
;Subroutines:
; initialize ADC
Init
; Initializing porta
BCF STATUS, RP0 ;
BCF STATUS, RP1 ; Bank0
CLRF PORTA ; Initialize PORTA by
; clearing output
; data latches
BSF STATUS, RP0 ; Select Bank 1
MOVLW 0x06 ; Configure all pinss
MOVWF ADCON1 ; as digital inputs
MOVLW 0xCF ; Value used to
; initialize data
; direction
MOVWF TRISA ; Set RA<3:0> as inputs
; RA<5:4> as outputs
; TRISA<7:6>are always
; read as '0'.
movlw b'10000001';
movwf ADCON0 ;
BANKSEL ADCON1
movlw b'10000101'
movwf ADCON1
BANKSEL ADCON0
return
END
| |
| |
| | #32 |
|
Always nice to see closure | |
| |
| | #33 |
|
hello birdman0, the project is not yet finished that was part one. The second part is that i have to use the motion sensor to detect movement. and the system should work like this: if there is movement then the LEDs must be on and if there is no movement, the LEDs must be off
| |
| |
| | #34 |
|
Thats easy enough, do you know how to set an input, and how to read it? How does the motion sensor work, is it digital or analog? | |
| |
| | #35 |
|
The motion sensor iam to use is called PIR325 Infrared Pyroelectric Sensor. i do not know how it operates, i searched and read about it but i do not get exactly what i want. i want to know whether there is output voltage i can read from the sensor if the sensor detects any moving object and how much is the output voltage if there is no movement.
| |
| |
| | #36 |
| | |
| |
| | #37 |
|
please,can u help me?i have a problem to sensor pir.i use sensor pir to receive signal to turn on_off bid cock electric.i don't understand this law.can u help me?if u can give me application circuit,it is useful for me
| |
| |
| | #38 |
|
What is a "bid cock electric" P.S. next time start your own thread. | |
| |
| | #39 |
|
Part three of the project is to use the stepping motor. im going to use the unipolar stepping motor to close or open the blinds(curtain window) depending on the light needed. i have to open the blinds using the motor, i have to turn the motor to a certain angle depending on how i want to open the blinds.
| |
| |
| | #40 |
| Whatever you do don't google it! | |
| |
| | #41 |
|
part four which is the last part is to use USART(Universal Asynchronous Receive and Transmit) where by the lights can be turned on or off, and the blinds can be closed or opened by the user using computer interface. The cable i will be using is RS232 to conect the computer and the circuit. That is the input comes from the computer interface. i would be glad if u can provide me with the reliable materials of USART or links.
| |
| |
| | #42 |
|
I'll pass you my USART tutorial code later today ( if not on monday ) !
| |
| |
| | #43 |
|
As promised...
| |
| |
| | #44 |
| | |
| |
| | #45 |
|
birdman0 i thought it was internet problems yesterday while i tried to download the link about (PIR232) but even today after downloading it, when i open the pdf it says the file is damaged. could you please post it again. but as for the UART.asm file i have download it and it is alright
| |
| |
|
| Tags |
| control, home, light, smart, system |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Guys this is my home made 2.1 Home Theater System | pasanlaksiri | Electronic Projects Design/Ideas/Reviews | 40 | 11th November 2009 05:07 AM |
| Traffic light control system with timer display | hocklin12 | Electronic Projects Design/Ideas/Reviews | 6 | 7th May 2009 09:10 PM |
| smart traffic light: HELP! | Crystal86 | Electronic Projects Design/Ideas/Reviews | 3 | 22nd January 2009 04:17 PM |
| smart home using blue tooth | jayanthi | Electronic Projects Design/Ideas/Reviews | 4 | 4th September 2008 04:29 PM |
| traffic light control system | samcheetah | Electronic Projects Design/Ideas/Reviews | 3 | 3rd May 2004 07:30 PM |