More advanced LCD Four Digit Door Lock.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
More advanced LCD Four Digit Door Lock.
Flowcode version: V4 or higher.
Hardware: Eb006 programming board, EB004 LED board, EB005 LCD board & EB014 Keypad board.
With This lock there are two pass codes.
1) Master code
This used for changing the normal pass code (just in case the normal pass code has been changed, then forgotten)
It can only be changed by altering on flowchart (so you can look at flowchart if master pass code is forgotten) then resending to target device. For security reasons this cannot be used for opening the door.
2) Normal pass code.
This is used to open the door. The default is 1234. But if you change this pass code, then the new pass code will be stored in EEPROM.
So it will be remembered in event of a power failure. You can also use this normal pass code to change the current pass code.
To change the current pass code, before entering any digits press Hash key #
Now enter the old pass code or master code. (currently set at 6543)
Note: The hash key is also used as an enter key, after entering four digits.
The star key * is use to remove the last digit entered. so if you want 1234 but enter 234 by mistake, then press *** then enter 1234 finally press #
Although used a 16F883, you can use any target device will will allow you to connect a keypad an LCD and 2 spare o/p pins. ( one, if you don't require a door locked indicator).
To open a door, if current pass code is 1234, then press 1234#
If you would like to see any improvements or new features added then any suggestions are welcome.
Martin.
Hardware: Eb006 programming board, EB004 LED board, EB005 LCD board & EB014 Keypad board.
With This lock there are two pass codes.
1) Master code
This used for changing the normal pass code (just in case the normal pass code has been changed, then forgotten)
It can only be changed by altering on flowchart (so you can look at flowchart if master pass code is forgotten) then resending to target device. For security reasons this cannot be used for opening the door.
2) Normal pass code.
This is used to open the door. The default is 1234. But if you change this pass code, then the new pass code will be stored in EEPROM.
So it will be remembered in event of a power failure. You can also use this normal pass code to change the current pass code.
To change the current pass code, before entering any digits press Hash key #
Now enter the old pass code or master code. (currently set at 6543)
Note: The hash key is also used as an enter key, after entering four digits.
The star key * is use to remove the last digit entered. so if you want 1234 but enter 234 by mistake, then press *** then enter 1234 finally press #
Although used a 16F883, you can use any target device will will allow you to connect a keypad an LCD and 2 spare o/p pins. ( one, if you don't require a door locked indicator).
To open a door, if current pass code is 1234, then press 1234#
If you would like to see any improvements or new features added then any suggestions are welcome.
Martin.
- Attachments
-
- Door Lock V2 16F883.fcf
- (21.53 KiB) Downloaded 1341 times
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
I will be adding more features as I either think of them or someone suggests in this thread some features.
Every time a new feature is added, I will increment letter after V2 by 1.
Added: Number of tries feature.
Like pass code, this is also stored in EEPROM.
So it can't be fooled by removing and restoring power.
Number of tries will reset to 0 when correct pass code is entered (not master code!) Next feature I will be adding is: Set door open delay time in seconds via keypad.
Every time a new feature is added, I will increment letter after V2 by 1.
Added: Number of tries feature.
Like pass code, this is also stored in EEPROM.
So it can't be fooled by removing and restoring power.
Number of tries will reset to 0 when correct pass code is entered (not master code!) Next feature I will be adding is: Set door open delay time in seconds via keypad.
- Attachments
-
- Door Lock V2A 16F883.fcf
- (24.16 KiB) Downloaded 1163 times
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: More advanced LCD Four Digit Door Lock.
Hi Martin,
Very nice program there thanks for sharing
Might have to go and get myself a shed so I can have a go with fitting a electronic lock on it 
Very nice program there thanks for sharing


Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Thanks Ben.
I will be doing the same to my shed
I thought the number of tries would come in handy to see if someone unauthorised is trying to gain access.
I guess can add another output to trigger a relay for a set time if more then three tries have been registered?
Then there will be an unauthorised attempt alarm.
I will be doing the same to my shed

I thought the number of tries would come in handy to see if someone unauthorised is trying to gain access.
I guess can add another output to trigger a relay for a set time if more then three tries have been registered?
Then there will be an unauthorised attempt alarm.
Martin
-
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
Re: More advanced LCD Four Digit Door Lock.
Hi Martin,
this is somthing that i have been thinking about for a while now, after seening a few electronic locks on my travels i have thought of having a go my self at them but have not had the time
here are a couple of ideas
using the RFID EBlock, keypad, ethernet pcb.
The user presents the RF card to the unit then enters a pin number to open the lock, 3 incorrect codes = 30 min lock out period and the card will be ignored and not allow a code to be entered further attempts increase the lock out time delay.
the ethernet module is used to program access so that various levels can be programed so you can open some locks and not others
and can also see who has operated the lock. and incorrect codes.
the second idea
using a touch screen e block ( don't know if it's available yet) as a keypad, and drawing different key pad patterns on the display
as key pads can get worn and you can see the numbers that have been pressed regular
steve
this is somthing that i have been thinking about for a while now, after seening a few electronic locks on my travels i have thought of having a go my self at them but have not had the time

here are a couple of ideas
using the RFID EBlock, keypad, ethernet pcb.
The user presents the RF card to the unit then enters a pin number to open the lock, 3 incorrect codes = 30 min lock out period and the card will be ignored and not allow a code to be entered further attempts increase the lock out time delay.
the ethernet module is used to program access so that various levels can be programed so you can open some locks and not others
and can also see who has operated the lock. and incorrect codes.
the second idea
using a touch screen e block ( don't know if it's available yet) as a keypad, and drawing different key pad patterns on the display
as key pads can get worn and you can see the numbers that have been pressed regular
steve
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Thanks for your input,
You have some good ideas Steve.
Good point with the keypad. I guess it would be a good idea to regularly change the code to prevent the wearing out of pads.
Martin
You have some good ideas Steve.
Good point with the keypad. I guess it would be a good idea to regularly change the code to prevent the wearing out of pads.
Martin
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
As promised added a function to change seconds door stays unlocked, by entering a new delay value via keypad:
Then you must enter correct code to access delay function to prevent unauthorised delay alterations.
Then enter seconds, followed by #
E.g. if pass code is 1234 and I want to change delay door stays unlocked to 15 seconds.
Key sequence is:
1#
1234#
15#
The new value will be stored in EEPROM, and will be retrieved in event of power failure.
Martin
To do this enter 1#Then you must enter correct code to access delay function to prevent unauthorised delay alterations.
Then enter seconds, followed by #
E.g. if pass code is 1234 and I want to change delay door stays unlocked to 15 seconds.
Key sequence is:
1#
1234#
15#
The new value will be stored in EEPROM, and will be retrieved in event of power failure.
Martin
- Attachments
-
- Door Lock V2B 16F883.fcf
- (32.09 KiB) Downloaded 1032 times
Martin
Re: More advanced LCD Four Digit Door Lock.
Hi everybody,
Mr. Martin, you can make a conversion for PIC16F628 ?
Without delay, without count of tries.
Thank you in advance
Mr. Martin, you can make a conversion for PIC16F628 ?
Without delay, without count of tries.
Thank you in advance
- Attachments
-
- Door Lock V2B.fcf
- (47.63 KiB) Downloaded 901 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Hi donald,
The attachment on the very 1st post is without count of retries or delay.
Just change the target for your device (not forgetting to disable WDT and LVP)
There is a version here:
http://www.matrixmultimedia.com/mmforum ... =26&t=7413
which is more basic and does not even use EEPROM .
Martin
The attachment on the very 1st post is without count of retries or delay.
Just change the target for your device (not forgetting to disable WDT and LVP)
There is a version here:
http://www.matrixmultimedia.com/mmforum ... =26&t=7413
which is more basic and does not even use EEPROM .
Martin
Martin
Re: More advanced LCD Four Digit Door Lock.
Hi Martin,
I am interested to tackle EEPROM and to operate on a PIC16F628, if possible.
I am interested to tackle EEPROM and to operate on a PIC16F628, if possible.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Not sure if this will work on 16F628A as I have not got that chip to test Flowchart with.
Try attached flowchart. It is the flowchart that's posted on the first post, but has be altered for 16F628A.
What type of oscillator (e.g internal, external ) and clock frequency are you using?
Try attached flowchart. It is the flowchart that's posted on the first post, but has be altered for 16F628A.
What type of oscillator (e.g internal, external ) and clock frequency are you using?
- Attachments
-
- Door Lock V2 16F628A.fcf
- (31.56 KiB) Downloaded 796 times
Martin
Re: More advanced LCD Four Digit Door Lock.
Internal oscillator, usually 4MHz, it seems to me that it works, I tell you made me very happy.
Thank you very much



Thank you very much
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
No problem.
Glad it seems to work for you.
I have altered settings for 4MHz internal osc with no external reset.
Glad it seems to work for you.
I have altered settings for 4MHz internal osc with no external reset.
- Attachments
-
- Door Lock V2 16F628A.fcf
- 4MHz int osc. No external reset.
- (31.56 KiB) Downloaded 785 times
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Compiles just fine for me.
I'm sure yours is not compiling because EEPROM is not available in the free version of Flowcode.
Try attached flowchart.
The only difference is I have removed the EEPROM component.
Here are all the limitations of the free version:
I'm sure yours is not compiling because EEPROM is not available in the free version of Flowcode.
Try attached flowchart.
The only difference is I have removed the EEPROM component.
Here are all the limitations of the free version:
Code: Select all
Nag Screen : Always (5 seconds, startup and close down)
Icon count per macro : 16
Macros per project : 4
C code lines per C icon : 4
C code lines for suplementary code : 4
Vnet : Disabled
ICD : Disabled
Customise component code : Disabled
Components : LEDarray, LED, LED7Seg1, LED7Seg4, LCD, Switch, Switchbank, ADC, Keypad, PWM, FormulaFlowcode, MIAC
Allowed chips (PIC_8) : 16F84A, 16F628A, 16F690, 16F88, 16F877A, 16F887, 16F1937, 18F4431, 18F2220, Formula Flowcode Buggy, ECIO-40, ECIO-28, MIAC, Locktronics PIC
- Attachments
-
- Door Lock V2 16F628A No EEPROM.fcf
- (29.46 KiB) Downloaded 811 times
Martin
Re: More advanced LCD Four Digit Door Lock.
Hi everybody,
Thank you very much Martin, with a battery stored in extra code changed or if I give up to the battery
and a source of power is accidentally disconnected returns to the code initially, is not an issue.
All the best !
Thank you very much Martin, with a battery stored in extra code changed or if I give up to the battery
and a source of power is accidentally disconnected returns to the code initially, is not an issue.



All the best !
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Thanks donald.
Martin
Yes that's the big advantage of using a non volatile memory like EEPROM to sore pass code.donald wrote: if I give up to the battery
and a source of power is accidentally disconnected returns to the code initially, is not an issue.![]()
![]()
![]()

Martin
Martin
Re: More advanced LCD Four Digit Door Lock.
Hi all,
I've been using this example to learn Flowcode, tried some modifications. I wanted the lock to have a limit of tries. I've changed the wrong_tries to not exceed 4. I've inserted a reset_macro on the code_check macro to display "YOU HAVE EXCEEDED NUMBER OF TRIES" and to jump to end on the main macro. My main idea is to block further attempts for input and to require a physical reset or to power reset. It jumps to end, but I can't display the message somehow. Using V5 Pro.
I've been using this example to learn Flowcode, tried some modifications. I wanted the lock to have a limit of tries. I've changed the wrong_tries to not exceed 4. I've inserted a reset_macro on the code_check macro to display "YOU HAVE EXCEEDED NUMBER OF TRIES" and to jump to end on the main macro. My main idea is to block further attempts for input and to require a physical reset or to power reset. It jumps to end, but I can't display the message somehow. Using V5 Pro.
- Attachments
-
- mydoorlock2A_877A_limit.fcf
- (38.94 KiB) Downloaded 722 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Hi Dan,
All you need to do is place text after the jump to point A
Then a continuous loop so routine is halted.
Martin
All you need to do is place text after the jump to point A
Then a continuous loop so routine is halted.
Martin
- Attachments
-
- mydoorlock2A_877B_limit.fcf
- (39.86 KiB) Downloaded 700 times
Martin
-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: More advanced LCD Four Digit Door Lock.
nice project, i have to get a keypad now... i've always wondered about static shocks on keypads, how vonerable are they to this, have you ever taken a automotive spark tester and set it to 20,000 volts, then get out of your car with it in your hand, it will arch across no problem with a loud pop when its dry outside, of course i live in the desert so its always dry
Re: More advanced LCD Four Digit Door Lock.
never had the problem with keypads. it gets pretty dry here in winter and i always have the habit of grounding myself before touching anything metallic. then again keypads have plastic keys and there is usually a rubber membrane before the actual contact. don't know how much they are rated though.
Re: More advanced LCD Four Digit Door Lock.
Got back on the project and added a lock/unlocked routine. Works, but I got lost in the change_code portion. I can make the change in the lock code, but I need help on the unlocked code change. I figured this program can be used for alarm circuits also. Any ideas appreciated.
- Attachments
-
- lock_dualcode_limit.fcf
- (38.45 KiB) Downloaded 727 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: More advanced LCD Four Digit Door Lock.
Hi Dan,
I have altered Flowchart so pressing the star key before any numbers will allow you to change the Lock code.
pressing the hash before any numbers will allow you to change the Unlock code.
When four digit code is entered, as usual press the Hash key
Any codes that get change are then stored in EEPROM
Master Key will allow you to set both Lock and Unlock codes should you forget what the new codes are, once altered.
The idea being if you forget the master key, you just look at the Flowchart and your see it's code.
Best to change the master key value within Flowcode before programming target device, to make security higher.
Martin
I have altered Flowchart so pressing the star key before any numbers will allow you to change the Lock code.
pressing the hash before any numbers will allow you to change the Unlock code.
When four digit code is entered, as usual press the Hash key
Any codes that get change are then stored in EEPROM
Master Key will allow you to set both Lock and Unlock codes should you forget what the new codes are, once altered.
The idea being if you forget the master key, you just look at the Flowchart and your see it's code.
Best to change the master key value within Flowcode before programming target device, to make security higher.
Martin
- Attachments
-
- lock_dualcode_limit V2.fcf
- (46.28 KiB) Downloaded 759 times
Martin
Re: More advanced LCD Four Digit Door Lock.
Hi Martin,
Thanks a million. That was the routine that I couldn't figure out where to insert. I was also thinking in bed last night why do I need two pass codes? Most alarm systems only use one. Will try with an output variable and a decision to check on or off state. Thanks again.
Dan
Thanks a million. That was the routine that I couldn't figure out where to insert. I was also thinking in bed last night why do I need two pass codes? Most alarm systems only use one. Will try with an output variable and a decision to check on or off state. Thanks again.
Dan