Advanced 4 Digit Keypad Entry Alarm.

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8294
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2373 times
Been thanked: 3380 times
Contact:

Advanced 4 Digit Keypad Entry Alarm.

Postby medelec35 » Sun Aug 02, 2009 2:40 am

For this alarm, Credit to Benj for original coding which I have modified with added features.
Also Credit to Sean for the graphics.
Features of alarm:
1) Four digit password is changeable and stored in EEPROM. If password is changed, and power is lost, then when power is restored, changed password is read from EEPROM and stored in password string.

2) There are thee zones. Zone 1 has exit and entry delay of 1 minute. during that 60 seconds an internal sounder is activated and time left in seconds is displayed on LCD. Zone 2 and 3 instantly trigger alarm. If zone 1 is triggered after initial 60 second time out, then count down is started for another 60seconds. If alarm is not deactivated by time 60 seconds has elapsed then main alarm is triggered
seconds count down is achieved using timer0 and not delay icon. that way time can be counting down whist waiting to press a key.

3) Alarm will not be enabled if A) wrong password entered to enable, or B) if there is a fault in any of the three zones. This fault could be due to a window/door left open.

4) When alarm is disabled and correct password is entered, there are two choices. press 1 will enable alarm, press 3 to change password.

Note, not sure if bug in V4 or is normal, but if you open V4_alarm1.fcf (even after saving) , the EEPROM contents will be random. So Either enter your code in EEPROM within programing software or you can save the correct password word to Hex file can be done as follows: With V4_alarm1.fcf loaded, the 1st digit of each location of EEPROM on panel 0 - 3 will be password. E.g. 0=431, 1=261, 2=5 & 3=74. Password = 4257. Make a note of pass word then program can then be run and enter current password and press 3 to change to your own password. After you have entered new password, EEPROM is automatically updated with new password.

Press # to accept 4 digit, press * to clear and re-enter password

I have not yet tried this on real hardware. I will be adding improvements over time. The improvements already added may not be best way of coding, but I don't claim to be an expert. I'm sure there could be better ways.

I was going to have a 30 second delay for zone 1 originally, so I know the macro name has only 30seconds instead of 60.

I will update with improvements/features when I get the chance. All new versions will be on one separate new post. So you can tell from date post added if new version or not.
Maybe this could be a community forum project, and anyone could post their version with improvements. feel free to download this version, alter and upload - stating improvements made.
Would someone mind testing on real hardware please and feed back.

Improvements:
V2. 1) Remembers status of alarm on power failure. If alarm was triggered, then power failed/restored. Alarm will continue when power is restored. If alarm is not set, then Alarm will stay off on power restore.

2)Added function when alarm is 1st disarmed to display zone which initially triggered alarm. This is also save to EEPROM and restored when power is restored. No zone is shown if alarm not triggered.

3)Zone inputs changed from port C to port B with weak pull-ups enabled. Eliminates pull-up resistor requirements. If zone is not used e.g zone 3 then there must be a pull down shorting link from port B3 to ground.

LCD shows current status of alarm. E.g Alarm On Code: or Alarm off Code:

V3.
1) Changed LCD message so ‘Input Code:’ is on line 2. Freeing up line 1 for more text.
2) Added Address 6 EEPROM function to remember if alarm is set or not in event of power failure. Pre V3 if alarm was set, but not triggered and power failed/restored, then alarm would be in disabled mode. (not good news if burglars who disconnect power 1st :p )
3) Minor LCD message tweeks.
4) Removed ‘Alarm Disabled!’ message on initial 60 seconds count down mode.
Last edited by medelec35 on Tue Aug 04, 2009 1:22 pm, edited 2 times in total.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8294
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2373 times
Been thanked: 3380 times
Contact:

Re: Advanced 4 Digit Keypad Entry Alarm.

Postby medelec35 » Sun Aug 02, 2009 1:56 pm

V3
Attachments
V4_alarm3.fcf
(139.18 KiB) Downloaded 358 times
Last edited by medelec35 on Tue Aug 04, 2009 1:26 pm, edited 2 times in total.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
Benj
Matrix Staff
Posts: 14075
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4297 times
Been thanked: 4051 times
Contact:

Re: Advanced 4 Digit Keypad Entry Alarm.

Postby Benj » Mon Aug 03, 2009 8:42 am

Hi Medelec

Your program looks great, you've done me and Sean proud.

Also turning this program into a community effort would be fantastic. Maybe even try and progress it as far as an actual alarm system then could be made with a schemetic and parts list etc.

Ill try and get some time later to have a better play around with it.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8294
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2373 times
Been thanked: 3380 times
Contact:

Re: Advanced 4 Digit Keypad Entry Alarm.

Postby medelec35 » Mon Aug 03, 2009 9:52 am

Thanks Ben & Sean, that’s really appreciated.



saschech@gmx.de wrote:Hallo Benj

Excuse please , but i mean it is very importantly to debug v4 first and foremost in the basics,before we debate over nice programs.....
In the moment i cannot export macros etc. ............!!!!!!!

Regards Wolfgang


I’m a sure important things like updates don’t grind to a halt or even get delayed because we ask questions or post files. You can’t stop everything else in the hope of that will make an update be posted quicker than it normally would have been.

What would be causing an update delay is testing time of updates. There will be so many scenarios to cover. In a different post we were told update would be available in mid august.

V4 is still very useable. I have used V4 to create several projects. If we get stuck then matrix staff helps as much as they can to get your Flowcode working to your satisfaction. Can you say that other things you have bought get the same support?

Odd about macros. I have imported/exported macros, that function has always worked great for me. The great things about importing macros is, the flowcode macros are imported to, automaticly assigns any new variables contained within the macro.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8294
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2373 times
Been thanked: 3380 times
Contact:

Re: Advanced 4 Digit Keypad Entry Alarm.

Postby medelec35 » Tue Aug 04, 2009 1:26 pm

Changed from revision V2 to V3.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.