Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 2nd October 2009, 10:59 PM   #31
Default

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
lebohangmaphothoane is offline  
Old 2nd October 2009, 11:14 PM   #32
Default

Always nice to see closure
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is online now  
Old 4th October 2009, 01:12 AM   #33
Default

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
lebohangmaphothoane is offline  
Old 4th October 2009, 02:14 AM   #34
Default

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?
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is online now  
Old 8th October 2009, 10:41 PM   #35
Default

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.
lebohangmaphothoane is offline  
Old 9th October 2009, 05:40 AM   #36
Default

This link

Page 6, then just play around.
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is online now  
Old 9th October 2009, 03:09 PM   #37
Default

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
061012A is offline  
Old 9th October 2009, 03:38 PM   #38
Default

What is a "bid cock electric"

P.S. next time start your own thread.
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is online now  
Old 10th October 2009, 03:15 AM   #39
Default

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.
lebohangmaphothoane is offline  
Old 10th October 2009, 03:25 AM   #40
Default

Quote:
Originally Posted by birdman0_o View Post
What is a "bid cock electric"
Whatever you do don't google it!
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/
blueroomelectronics is offline  
Old 10th October 2009, 03:35 AM   #41
Default

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.
lebohangmaphothoane is offline  
Old 10th October 2009, 06:04 PM   #42
Default

I'll pass you my USART tutorial code later today ( if not on monday ) !
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is online now  
Old 10th October 2009, 07:06 PM   #43
Default

As promised...
Attached Files
File Type: asm UART.asm (5.4 KB, 12 views)
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is online now  
Old 11th October 2009, 01:29 AM   #44
Default

Quote:
Originally Posted by birdman0_o View Post
As promised...
That looks good birdman0 good work
be80be is online now  
Old 11th October 2009, 02:38 AM   #45
Default

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
lebohangmaphothoane is offline  
Reply

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



All times are GMT. The time now is 12:59 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker