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 microcontroller alarm system

Status
Not open for further replies.

Bezo88

New Member
Hi, my name is kanan. Its a pleasure to meet you all.I have a project to complete. It's a home alarm system with a keypad , 2 sensors , contact sensor and motion sensor , LEDs , back up power supply, pic microcontroller , 4 push button switches, LCD . The alarm has to do the following, change the code, arm , disarm , show on led if back up is running, if sensor is triggered delay for 10 seconds then activate siren.push button A is for arm, push button B is disarm, push button C is to change code , push button D is backspace.the LCD will display the code entered and time left to exit house before arm.
Any input to this project is greatly appreciated.
Thanks for taking the time to read this. I will have a build log on this project.
 
Welcome to the forum!
I suggest you start by googling for PIC-based alarm circuits. There must be heaps of them on the net, which would give you a lot of the info you need and a basis for adaptation to meet your specific requirements. There's no point in re-inventing the wheel.
 
Last edited:
Break down each module and figure out the best method of communications, I.E. Hard-wired, or wireless, 433MHz transmitter / receiver type system. Bluetooth, Zigbee, etc.

Breaking down each module would be for example:

Keypad, 4 x 4 type? Are you going to read the keypad using a matrix I.E. row / column driver? Do you need de-bouncing? If so what is your preferred method? Hardware / software?

Sensors, all the same type? Do you need a contact switch, for example, a pull up connected to a wire which when closed grounds the input, or are you doing this all wireless? Or is it a voltage feedback, in which case you need ADC, how many ADC channels.

You require all of this information to select the PIC appropriate, ideally pick one with a scalable memory footprint, for example, if you chose a 64KB memory chip, if for example you feel you may need / want to expand it in the future, do you need more I/O? If so it may be better to re-design, if you think you may just need more memory for whatever reason chose a PIC which has pin compatible upgrades to 128, 256 or even 512 KB of memory. Of course if it is a one off project it wont matter.

Usually the keypad will arm / disarm the system, and you would normally enter the original code, press hash (pound) or star in a sequence or so and then enter the new code to save it. Normally twice for confirmation, better user feedback especially with the LCD if you do it this way. You don't normally have "backspace", maybe a clear button or hold down '0' for 3 seconds or more.

Alarms are also entry / exit zone and trigger to alert (sound) user definable on times (or at least a range from 10 - 60 second for example).

Just a few tips!

Wilksey
 
thanks Wilksey. I decided to change the keypad to a 3x4 matrix keypad.I'm using a decoder and a low pass filter for the de-bouncing. The micro controller is the 16F873A. It is all hard wired. The sensors are the same type I.E. when activated sends 0 to micro controller. I have taken your advice and changed the backspace to a clear.I have taken out the LCD.The delay between arming is 10 seconds. I am having a problem with the programming for it.
 
Ok, well you seem to have most of the hardware sorted out.
I am going to assume your sensors have a pull up and when "Activated" it grounds the pin.

You have selected your target PIC, now you need to chose a target compiler, ASM or HITECH C, and if you want to count 10 seconds (or any number of seconds / milliseconds), then you will need a good timing base, so you will need to select an appropriate crystal or if that one has an internal one use that, set up the fuses to the configuration you require, I would switch on the WDT if it is an alarm, and even the brown out detection etc. I would recommend sending a timing pulse to a pin and measuring that pin with an Oscilloscope to double check you have the correct timings.

Be careful, some devices couple a timer device with the WDT so you cant use both, for example, my 18f26k22 chip has Timer 0 as the WDT so I use Timer 1 as my main timer. You will need to set up an interrupt to handle the timer "ticks".

You then need to figure out how your decoder interfaces with the micro and write a "driver" for it accordingly.

That should get you started!

Wilksey
 
<mod edit: self promotion deleted. If you have content to share, please post directly to ETO. Do not link to your own personal website>
 
Last edited by a moderator:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top