Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 19, 2024, 05:43:02 17:43


Login with username, password and session length


Pages: [1]
Print
Author Topic: Alarm simulation problem  (Read 5098 times)
0 Members and 1 Guest are viewing this topic.
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« on: May 13, 2012, 06:33:43 18:33 »

I'm having difficulties when I try to simulate a simple circuit on Proteus.
Its an alarm with an LCD and a PICF16877A.
If someone could help me with that, I would very much appreciate it.
The schematic is attached to this thread.

Winrar this circuit is implemented in ISIS.
« Last Edit: May 13, 2012, 07:58:21 19:58 by ratoseco » Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #1 on: May 17, 2012, 12:58:41 00:58 »

Keyboard does not work and the LCD does not show the second line nor the functions enabled by keyboard.

thank you
Logged
alfonsoagama
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 39
-Receive: 40



« Reply #2 on: May 17, 2012, 09:59:05 21:59 »

In the simulation does not exist problem.
The problem is in the programing code.
Please, define the Project and what should your desgin do?
Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #3 on: May 21, 2012, 07:11:01 19:11 »

Maybe I can help you by example.  Here you are an alarm design written in CCS C and simulated in Proteus.

http://www.4shared.com/rar/rP6vmDI9/Alarm_project.html

https://rapidshare.com/files/1170104046/Alarm_project.rar

I modified the KBD keys to match my real circuit.

You can have the source code for guidance.

The alarm has a door switch that give some time for you to leave the room before arming. Also give some time since you open the door to the moment you unarm it.

There is an alarm switch that gets triggered instantaneously. This one was used in my case for a motion sensor. If this switch is not triggered for the last 3 minutes, the alarm goes off and back to armed state.  In the LCD there is a trace of how many times the alarm has been triggered since the last arming.

It also has a circuit for charging a battery, but maybe it is not interesting for you. I used a battery to make the alarm system independent of the electric power of the building.

If it helps you and you need further assistance, do not hesitate to ask

Odiseo
Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #4 on: May 22, 2012, 07:55:06 19:55 »

Friend you can send me the PCB in the ARES if you have on the battery I am interested and literature to explain I am very thankful for. ...


I'm from Portugal I have difficulty in English 
Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #5 on: May 24, 2012, 04:58:54 16:58 »

Yesterday I tried to get some pictures of my alarm for you, but it was not possible.

It was done in a Vero board wired by hand. For me it is faster for small projects. So I never did any PCB design. Sorry

For the keyboard I hand saw an old PC keyboard. It is not a very standard practice, but it was a fast way out.

Here you are a schematic of the battery part that was not included in the Proteus schematic. You will notice that the system runs basically from the battery and only uses AC power for charging the battery through a P channel MOS FET.

In fact the consumption of the siren was better handled by the battery than by the transformer, because I used a small power one.

English is not my first language either, so I will be happy to rephrase any unclear idea.
Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #6 on: May 30, 2012, 12:02:23 00:02 »

Odiseo,, I need help on the circuit implemented in ISIS.
  The alarm does not simulate in Proteus appears on the LCD "alarms ver 1.0" and after a few seconds this message is replaced by "Alarm off 0 times."
 Besides I need to know the code and how it changes for other codes.
 greetings
Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #7 on: May 30, 2012, 03:42:55 15:42 »

Yes. Upon power on the alarm is in off state (not armed) and it report the times it was trigered last time, in this case 0 on Power on.

Messages are in Spanish, sorry. I guess they are very similar in Portuguese.

The circuit only checks for a sequence. If you make a mistake, no problem, you introduce your key and command immediately again.

You should input five (5) numbers in sequence. The four(4) digits key is followed by one(1) command digit. You should introduce five valid digits in sequence to get anything done.

The power up key is: 1 2 3 4. They are four digits.

There are several commands. Each one is one digit long.

1 : the alarm is armed.

You have a time to leave the room. It means there is a time you can pass through the door switch without activating the alarm. One this is triggered you will see the count down in the display.

2: the alarm is off or disarmed

If the alarm is already triggered, this is the way to set it off.
If you just entered the room and the alarm is armed, you will have a short time to unarmed it before it is triggered using the proper key (of course). During this process you will see a count down again in the display.

3: this command is for introducing a new four digit key.

If you change it and forget it later, you can just power it off to return to the 1 2 3 4 default key.
This can be considered a flaw. I did not need it stronger. You could save it in eeprom for a stronger system requiring PIC reprograming to get to initial state.
During this process you will have ‘*’ as feedback on the screen

4: this command is for changing the time you have for leaving and entering the room, before the alarm gets triggered.

the default value is 15 seconds.

One last thing

I mentioned before that I needed to change the keys distribution from proteus to match my key circuit.

This is the mapping:
Proteus       Real Circuit
1                     #
2                     0
3                     *
4                     3
5                     2
6                     1
7                     6
8                     5
9                     4
*                      9
0                     8
#                     7

So, for typing in my real circuit 1 2 3 4 1. For arming the alarm. In Proteus, this should be typed 6 5 4 9 6.

And so on.

You can change it back to get yourself trained. Wink

SW1 is the door switch. The one with the time window. SW2 is the instant alarm switch. I used it for a motion sensor.

You can give it another try now.

Good luck
« Last Edit: May 30, 2012, 03:54:05 15:54 by Odiseo » Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #8 on: May 30, 2012, 05:19:06 17:19 »

Friend I'm online if you want to communicate with me, I understand well Español
Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #9 on: May 31, 2012, 01:05:17 13:05 »

Great. It is a relief your Spanish knowledge. In that case you will have no problems with the LCD messages.

I think we are some hours apart. I will be watching in case I see you online.

Regards
Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #10 on: June 05, 2012, 12:24:58 00:24 »

Odiseio: After the alarm sounds as if it stops.
Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #11 on: June 05, 2012, 06:45:00 18:45 »

There are two ways of get stopped

1-   After 3 minutes of the last sensor activation

For example: 3:05 am the sensor is activated it stop at 3:08 am and count one activation. The alarm will go on armed.
If the sensor is activated at 3:05 am, 3:06am, 3:08am, 3:10 am it continues to be active the whole time until 3 minutes after the last sensor action. Meaning the alarm will stop at 3:13 am and count one.

Another activation after that it counts two, three, …, and so on.

When you come back the next day or week, you will see how many times it was activated. (I just hope all those were false alarms)

The alarm is ready (armed) the whole time

2-   By unarm command.

Key (# # # #) and command 2. Default key is 1 2 3 4, so it would be 1 2 3 4 2.
Then the system will be unarmed.

I am not sure if that was your question


Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #12 on: June 05, 2012, 10:45:11 22:45 »

Friend Odiseo, yes I understand, this code is not what works in Proteus! but the real alarm?. Code activate 6 4 5 9 6 and to disable the alarm simulation in Proteus, 6 5 4 9 5, right?.
Regards
Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #13 on: June 06, 2012, 01:16:24 13:16 »

Yes, right  Smiley

6 5 4 9 6 activate
6 5 4 9 5 deactivate
6 5 4 9 4 change password
6 5 4 9 9 change time

Posted on: June 06, 2012, 02:07:33 14:07 - Automerged

The original keyboard has keys * &  # disabled. So in the proteus keys you can not use 1 nor 3 for a new password.

In case you want to change time, you must look at the original meaning of the keys to set up the proper time
« Last Edit: June 06, 2012, 01:20:54 13:20 by Odiseo » Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #14 on: June 14, 2012, 07:04:07 19:04 »

Friend Odiseo, the PIC16F873A serves any manufacturer or have a preference?.
Thank you.

Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #15 on: June 15, 2012, 01:02:37 13:02 »

I am not sure if its manufactured any one besides Microchip. As long as it is PIC16F873A it will do.

I gave you the source code, you can change it to any other PIC provided it has analog converter input and pwm for the buzzer. I guess you can go without the buzzer if you have a siren anyway.

Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #16 on: June 23, 2012, 04:25:45 16:25 »

Odiseo, 2N2222 transistor has no collector on, I need you to tell me something because I have a friend to make the PCB, I am awaiting information.
thank you
Logged
FTL
Junior Member
**
Offline Offline

Posts: 83

Thank You
-Given: 170
-Receive: 33


« Reply #17 on: June 23, 2012, 04:48:46 16:48 »

I think Q2 is just a spare transistor that can be used to drive something. The circuitry around Q1 is an issue though. It can't do anything as the collector is effectively connected to ground through the buzzer. If you turn Q1 on, it is just going to ground the buzzer, which will not cause any current to flow. That is a good thing actually, as there is no flyback diode on the relay primary. If Q1 actually turns on and puts current through the relay primary, it will be fried from the flyback voltage on the relay primary. It may survive a few turn-offs, but it will eventually die from teh volateg spikes. That whole part of the circuit has some serious problems.
Logged
Odiseo
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 1


« Reply #18 on: June 25, 2012, 03:29:48 15:29 »

ratoseco

You can see the transistor connection on the schematic completion of the circuit I gave you related to the battery circuit.

check it out

FTL

Q2 was used for the charging circuit of the battery in the schematic I uploaded a few posts back. It was not included in the Isis circuit because it was not interesting for simulation.

Q1 is not connected to ground because there is a NET name VBAT that is connected to a power supply in that point.

If you would try the Isis file I gave you would have noticed that. I suggest you do that.

In fact the buzzer is connected to power unless the transistor is actuated under program.This last detail was on purpose. In case the micro was disabled or the wires were cut, the siren would just go active.

About the fly back diode I agree with you partially. I should have put one, for avoiding the spikes, for the micro stability sake. It will never fry the transistor. VBAT is only 12V, it wont go too far up that any common transistor would not stand with out problems, I think. Anyway, there should be one, my fault.

I have the actual circuit working for more than a year now, only one circuit, but still fully responsive.
« Last Edit: June 25, 2012, 03:36:01 15:36 by Odiseo » Logged
ratoseco
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 54
-Receive: 18


« Reply #19 on: June 25, 2012, 11:49:09 23:49 »

Odiseio sorry for forgetting the image of the power supply, because I have already run on my plate, I did not remember who put the photo in a forum. PCB is in progress.

thank you very much
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC