Intruder alarm

Discussion about project that uses other controller, or non controller based project such as using logic gates, FPGA, ARM, Mechanical ....etc. Welcome to post it here

Re: Intruder alarm

Postby lockman_akim » Thu Jan 26, 2012 12:07 am

have u set the IO pin in your program?

if you want to use 9V battery, you dont need to draw new footprint, just put 2 pin DIL connector. decide the pin 1 as postive, and pin 2 as negatif.. later when you export to PCB, it have 2 hole for that connector.. when assembly the component to the board, use the battery cap (cap wit wire red and black).. solder it at the board.
lockman_akim
Novice
 
Posts: 22
Joined: Sun Aug 29, 2010 11:50 pm

Re: Intruder alarm

Postby ABSF » Thu Jan 26, 2012 8:00 am

krys WROTE:It is said that the extension dsn is not allowed. How can I attach the project then?


This forum (and most forums) only allows jpg images to be attached. dsn files are only recognised by your proteus program so you must find a way to convert it to jpg format. The easiest way is to Print Screen and paste it to "paint" then save as a jpg file. That way you can attach it to the forum.

krys WROTE:And supposedly the red LED blinks, but it doesn't blink. When I test for the voltage probe, it said that the voltage is zero. Why did this happened?


Are you able to load in the sample program into the PIC in your proteus? In your last post you're asking why there is no UIC00A component symbol. You dont need the UIC00A in the simulator, just load the program into the PIC by right click and then left click the PIC. On the "Program file" window just load in your program in ".hex" then you can run it.

krys WROTE:How do I create PCB footing for battery and GP2D120? Proteus doesn't have PCB layout for them though.


I dont think you can find any specialised battery footprint in ISIS or ARES. Sometimes you have to create your own and sometimes you just put 2 pins to represent the battery just like lockman_akim said. I think the important point is to get your circuit working first. What is the point to make a PCB if your circuit is not working.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Intruder alarm

Postby krys » Thu Jan 26, 2012 12:12 pm

I've done just as you said. The RED LED lights up, but it didn't auto off after 15 seconds. LED2 and LED3 supposedly to blink for a few sec - indicating scanning mode, but there's no sign of them. Does that mean I need to modify the PIC hex file? Or is it just a problem in simulator which will auto resolve when turned into PCB?

The attachment is on my PCB layout. I still haven't place the footage of reset switch, battery and spdt connector. The problem is, when I place the footing of reset switch, the PCB suddenly have error, without me doing any routing on it yet.

I'm planning on using CONN-SIL2 for battery, SW-PUSH2 for spdt and SW-PUSH1 for reset. When importing the netlist to ARES, it said that the pin of '+' and '-' hasn't been assigned for battery, which I'm already assigned it as you told me to. It happened to the other switch too.
Attachments
PCB.JPG
krys
Novice
 
Posts: 23
Joined: Fri Dec 02, 2011 12:49 pm

Re: Intruder alarm

Postby ABSF » Fri Jan 27, 2012 10:34 am

Well I simulated the circuit on my proteus and it works fine. What is the frequency of your PIC in your ISIS running. I am not able to run at 20MHz as my PC is too slow so I run it at 8MHz. I pressed the button at RA0 once and the LED lights up. After about 30 seconds (I didnt time it), the LED was off and it blinked every 15 or so seconds.

Then I applied +5V on RB2, the LED and the buzzer were both on and off every 2 or 3 seconds.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Intruder alarm

Postby krys » Fri Jan 27, 2012 1:22 pm

It seems like the LED RED also didn't blink when I re-simulate it again (after turning off and on my laptop the next day). I try changing the PIC frequency to 8MHz like you did, but it didn't have any effect. Do you write the PIC program yourself?

Btw, the original frequency of my pic is 1Mhz.

Can you please check my circuit in case I missed something?
Attachments
PIC.JPG
LEDGREEN.JPG
BUZZ.JPG
krys
Novice
 
Posts: 23
Joined: Fri Dec 02, 2011 12:49 pm

Re: Intruder alarm

Postby ABSF » Fri Jan 27, 2012 4:24 pm

What is the state (H or L) of MCLR when your circuit is running.
In you DC supply, you use Vdd and Vcc interchangeably. Was it allowed by Proteus?
Try put a DC voltmeter on all the Vcc and Vdd points and see if +5V is there.

The 7805 and the crystal osc circuits are optional for the simulation unless you want to make the PCB. You can leave them out for simplicity.

Have a look at my circuit:



Allen
Attachments
sim2.JPG
sim1.JPG
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Intruder alarm

Postby krys » Fri Jan 27, 2012 9:36 pm

The MCLR is blue so I supposed it's high. Sorry I can't be sure. I learned PIC on my own since my major course doesn't include PIC as a subject.

I try modify my schematic according to your design. The green LED doesn't turn on at all. The red LED turned on and does blink but the other two remain off. And the MCLR turned red. Why's the change?

I noticed you changed the resistor value from 4.7k to 10k (the one connecting to diode and MCLR). When I used the original value, the voltage becomes an exponential value and keeps on varying. But when I changed it to 10k, the voltage stabilized to 4.77V. Is that the purpose of your decision to change the value?

Why do you only connects the PIR2 to reset switch? What's the function of it? Why not connects the PIR1 to reset switch as well? When I run the simulation, there's an error stating that input B is connected to an analogue net - which is referring to the PIR2 reset switch. How to fix that?

The buzzer did not beep even after I modify the design. So, I try to add digital speaker to it. It does produce a beep. So if I convert it to PCB and make a hardware out of it, can I take it as my buzzer works properly? (since the speaker is just a test I carried out to know whether the buzzer works or not)
krys
Novice
 
Posts: 23
Joined: Fri Dec 02, 2011 12:49 pm

Re: Intruder alarm

Postby ABSF » Fri Jan 27, 2012 10:19 pm

krys WROTE:The MCLR is blue so I supposed it's high. Sorry I can't be sure. I learned PIC on my own since my major course doesn't include PIC as a subject.

I try modify my schematic according to your design. The green LED doesn't turn on at all. The red LED turned on and does blink but the other two remain off. And the MCLR turned red. Why's the change?

I noticed you changed the resistor value from 4.7k to 10k (the one connecting to diode and MCLR). When I used the original value, the voltage becomes an exponential value and keeps on varying. But when I changed it to 10k, the voltage stabilized to 4.77V. Is that the purpose of your decision to change the value?

Why do you only connects the PIR2 to reset switch? What's the function of it? Why not connects the PIR1 to reset switch as well? When I run the simulation, there's an error stating that input B is connected to an analogue net - which is referring to the PIR2 reset switch. How to fix that?

The buzzer did not beep even after I modify the design. So, I try to add digital speaker to it. It does produce a beep. So if I convert it to PCB and make a hardware out of it, can I take it as my buzzer works properly? (since the speaker is just a test I carried out to know whether the buzzer works or not)


Blue=logic L, Red=logic H and grey=NC or open. Since your MCLR is L when running, that means your PIC is not getting a power up reset so it wont run properly.
[edit] I notice now that your reset button is in the ON state, so that's why your PIC is in the reset state. And that's the reason your circuit won't run at all.

The resistor connected to MCLR can be any value from 1K to 20K. You can try 10K on your circuit and see if it works????

I dont know what happens to the way you layout your schematics. But it seems your circuit on page 2 doesnt connect to your circuit in page 1 and that's why your simulations failed.

You have to study the sample program in C and unserstand what is going on. In the program only the button connected to RA0, the LED connected to RC0 and the sensor connected to RB2 plus the buzzer are used. The rest are just there for you to use them in your own program. They are not involved in the sample program. The PB-PIR is not a reset button. It is pressed to simulate a PIR alarm.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Intruder alarm

Postby krys » Sat Jan 28, 2012 1:53 am

The RED LED only switched on if the switch connected to MCLR is in pressed state, but not in free state.
Attachments
new.JPG
krys
Novice
 
Posts: 23
Joined: Fri Dec 02, 2011 12:49 pm

Re: Intruder alarm

Postby ABSF » Sat Jan 28, 2012 5:52 am

You dont need to disturb the reset button at all. the mcu will reset itself when power is up. You need to push the button connected to RA0 to trigger on the red LED.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

PreviousNext

Return to Misc Project

Who is online

Users browsing this forum: No registered users and 8 guests

cron