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.

PIC controlled intruder alarm

Status
Not open for further replies.

samcheetah

New Member
has anyone built the "PIC controlled intruder alarm" from the April 2002 issue of EPE. well ive set onto building this project and i have some difficulties. the first is the hex keypad it uses. its quite different from the hex keypads ive seen on the internet. ive attatched the picture of the keypad.

this is quite different to the keypad at nigel's website on the page.

and i have one more question. what should i use for a strobe.
 

Attachments

  • hexkeypd.png
    hexkeypd.png
    8.1 KB · Views: 1,170
samcheetah said:
has anyone built the "PIC controlled intruder alarm" from the April 2002 issue of EPE. well ive set onto building this project and i have some difficulties. the first is the hex keypad it uses. its quite different from the hex keypads ive seen on the internet. ive attatched the picture of the keypad.

this is quite different to the keypad at nigel's website on the page.

and i have one more question. what should i use for a strobe.

As with all EPE projects, component availability is discussed in the ShopTalk section of the magazine (page 290 in that issue). It explains that they used a keypad from RS Components, and gives the part number for it - plus the phone number, and web address. It also explains that you can get the strobe etc. from any DIY superstore.
 
thanx Nigel for the reply. actually i was just wondering that which layout was the standard, the one used in the alarm or the one at your website. i dont think im gonna order something over the net. because usually the shipping is very high for Pakistan (where i live).
 
samcheetah said:
thanx Nigel for the reply. actually i was just wondering that which layout was the standard, the one used in the alarm or the one at your website. i dont think im gonna order something over the net. because usually the shipping is very high for Pakistan (where i live).

The one I used is a cheap one :lol:

The various ones I've seen (also cheap ones) have all had connections like the one in my tutorial.
 
okay ill try to search for that keypad here. if i dont get it ill try to make it myself. the connections will be the same like row 1 and column 1 and so on. but its just the different labels. i dont know if it will work or not but its worth a try. and its gonna be dirt cheap if i made it on a stripboard.

about the sensors, have u ever built such a system. which sensors did u use?
 
samcheetah said:
i dont think that keypad uses the standard row and column layout. it has 9 pins and its quite awkward looking. can somebody get me the internal diagram of this keypad

You've already posted it! - look at the picture you posted! - it only uses 8 pins out of the nine.
 
how silly of me !!!!!!!!

so there is no need for the 9th pin. its only for grounding the case of the keypad. right????

so can i just buy a hex keypad like the one at your site and re-label the keys and then use it???? i think its worth a try.

its just that when i get into a problem it starts looking like rocket science to me :lol:
 
samcheetah said:
how silly of me !!!!!!!!

so there is no need for the 9th pin. its only for grounding the case of the keypad. right????

Presumably so!.

so can i just buy a hex keypad like the one at your site and re-label the keys and then use it???? i think its worth a try.

Yes, it's just a matrix of keys. But rather than relabel the keys, you may be able to redefine them in the software - I've not looked at the EPE software, but in my tutorial software I use a lookup table for the keyboard, so it's easy to redefine. If the EPE software doesn't do this, it would be easy to add a small lookup table to redefine the keys.
 
okay thanx

i havent studied the hex keypad tutorial. maybe im just being too lazy. some day i will get there. and then ill understand it better.

its just that the 2443 lines of code for the alarm scare me off :lol: well thats because this is the first time im working with assembly. anyway i think i have to do this someday because i have to strip the thing down. like i dont want the second keypad and certain other things. i was also looking into the possibility of using some other PIC instead of the PIC16F877. but before that i have to gain alot of experience. so just wish me good luck 8)
 
samcheetah said:
okay thanx

i havent studied the hex keypad tutorial. maybe im just being too lazy. some day i will get there. and then ill understand it better.

its just that the 2443 lines of code for the alarm scare me off :lol: well thats because this is the first time im working with assembly. anyway i think i have to do this someday because i have to strip the thing down. like i dont want the second keypad and certain other things. i was also looking into the possibility of using some other PIC instead of the PIC16F877. but before that i have to gain alot of experience. so just wish me good luck 8)

I've just had a quick look, right near the start of the code is this section:
Code:
VALUE:  ADDWF PCL,F       ;lookup table for key allocation
        retlw '1'
        retlw '2'
        retlw '3'
        retlw 'A'
        retlw '4'
        retlw '5'
        retlw '6'
        retlw 'B'
        retlw '7'
        retlw '8'
        retlw '9'
        retlw 'C'
        retlw '-'
        retlw '0'
        retlw 'E'
        retlw 'D'

This is a lookup table, just as in my tutorials :lol:

There are 16 entries in it, one for each key, all you need to do is rearrange them so the values returned correspond to your keypad.

The routine is called twice in the assembler listing, presumably once for each keypad?.
 
thanx

so all i have to do is change this lookup table to

Code:
VALUE:  ADDWF PCL,F       ;lookup table for key allocation 
        retlw '1' 
        retlw '2' 
        retlw '3' 
        retlw 'F' 
        retlw '4' 
        retlw '5' 
        retlw '6' 
        retlw 'E' 
        retlw '7' 
        retlw '8' 
        retlw '9' 
        retlw 'D' 
        retlw 'A' 
        retlw '0' 
        retlw 'B' 
        retlw 'C'

is that it???

ill try to program the chip with this and see if it works. actually im having some problems with programming because my batteries are near to going flat (they arent rechargeable) so i think now ill get a 15V transformer and a 1A fuse. that way i wont have to worry about batteries going flat.
 
samcheetah said:
thanx

so all i have to do is change this lookup table to

Code:
VALUE:  ADDWF PCL,F       ;lookup table for key allocation 
        retlw '1' 
        retlw '2' 
        retlw '3' 
        retlw 'F' 
        retlw '4' 
        retlw '5' 
        retlw '6' 
        retlw 'E' 
        retlw '7' 
        retlw '8' 
        retlw '9' 
        retlw 'D' 
        retlw 'A' 
        retlw '0' 
        retlw 'B' 
        retlw 'C'

is that it???

I didn't study it that much, try it like that and see which key does what, if they are wrong it will be obvious which ones you need to move round.
 
I didn't study it that much, try it like that and see which key does what, if they are wrong it will be obvious which ones you need to move round.

i didnt study it either :lol: i just made a wild guess. because looking at the code it goes like from first row i.e 123A and then the second row 456B but the keypad commoly available goes like 123F and then in the second line 456E and so on. so thats why i changed it like this. is this right??
 
Nigel have u tried to write an '877 with the code supplied by EPE for this project.

as i told u that i was having problems with my supply so the programmer wasnt working. but now ive got a good supply and still it cant be programmed. ive tried a simple code like

Code:
LIST p=16F877
        include "P16F877.inc"
        __config 0x393A

	org	0x0000			;org sets the origin, 0x0000 for the 16F628,
					;this is where the program starts running	
	BANKSEL ADCON1
        movlw 0x06
        movwf ADCON1
        BANKSEL PORTA

   	bsf 	STATUS,		RP0	;select bank 1
   	movlw 	b'00000000'		;set PortB all outputs
   	movwf 	TRISB
	movwf	TRISA
        movwf	TRISC                   ;set PortA all outputs
	bcf	STATUS,		RP0	;select bank 0

Loop	
	movlw	0xff
	movwf	PORTA			;set all bits on
	movwf	PORTB
	movwf	PORTC
        nop				;the nop's make up the time taken by the goto
	nop				;giving a square wave output
	movlw	0x00
	movwf	PORTA			;set all bits on
	movwf	PORTB
	movwf	PORTC
	goto	Loop			;go back and do it again

	end

and this works. but not the hex file for this project. could u check it out for me.
 
samcheetah said:
Nigel have u tried to write an '877 with the code supplied by EPE for this project.

and this works. but not the hex file for this project. could u check it out for me.

I've not tried it, I've no interest in the project, but I can download it later at home and try it - I'm currently at work, and while I've got a PIC programmer here, I don't have a 16F877.

What error message do you get?.
 
well ive done it (yeah 8) )

actually i think the adapter had alot of ripple so there was some problem in programming the chip. i just played with the pot to adjust the voltage and it somehow worked. the adapter was from a laptop charger so i thought it would be nice. i guess i have to buy heavy duty 9V batteries after all :lol:
 
Status
Not open for further replies.

Latest threads

Back
Top