Page 1 of 1

Security panel K2000

Posted: 02 Feb 2019, 16:13
by remko2000
I've bought a K2000 security keypad and connect it with a Wemos D1 with ES Easy (build mega-20181026).
7360c700-890b-4533-9900-ba57adeeac81.JPG
7360c700-890b-4533-9900-ba57adeeac81.JPG (154.59 KiB) Viewed 12324 times
I connect the two "BEL' contacts of the panel to Ground and GPIO12 of my wemos. With this switchinput I want to set my alarm ' IN'.This works fine.

The contact ' NO (normally in)/push' the panel I've connected to GPIO13.
With this switchinput I want to set my alarm 'OUT'.
When I enter the correct alarmcode on the panel to set, sometimes it works and sometimes it does not work. The signal on GPIO13 is very instable.
The output in the log when enter the correct code (setting: normal switch /no logic and pull up):
93787: SW : Switch state 1 Output value 0
93795: EVENT: NOAlarmuit#Switch=0.00
93987: SW : Switch state 0 Output value 1
93990: EVENT: NOAlarmuit#Switch=1.00
94187: SW : Switch state 1 Output value 0
94190: EVENT: NOAlarmuit#Switch=0.00
94687: SW : Switch state 0 Output value 1
94690: EVENT: NOAlarmuit#Switch=1.00
94987: SW : Switch state 1 Output value 0
94990: EVENT: NOAlarmuit#Switch=0.00
95687: SW : Switch state 0 Output value 1
95690: EVENT: NOAlarmuit#Switch=1.00
95787: SW : Switch state 1 Output value 0
95790: EVENT: NOAlarmuit#Switch=0.00
95887: SW : Switch state 0 Output value 1
95890: EVENT: NOAlarmuit#Switch=1.00
95987: SW : Switch state 1 Output value 0
95990: EVENT: NOAlarmuit#Switch=0.00
96097: SW : Switch state 0 Output value 1
96100: EVENT: NOAlarmuit#Switch=1.00
96287: SW : Switch state 1 Output value 0
96290: EVENT: NOAlarmuit#Switch=0.00
96787: SW : Switch state 0 Output value 1
96790: EVENT: NOAlarmuit#Switch=1.00
I think because it is a pushcontact that I get multiple switch changes. I do not want that.

I have experimented with the different switch settings in esp easy from my wemos but nothing helps.
Another setting maybe? Maybe a rull? Or can I set a delay after the first Switch state change so the rest is ignored?

I need a stable response to be able to set up follow-up actions in domoticz to enable the alarm out (for example.)

Re: Security panel K2000

Posted: 02 Feb 2019, 16:21
by grovkillen
Tried debounced?

Re: Security panel K2000

Posted: 02 Feb 2019, 17:24
by Shardan
How did you connect the "Bell" contacts.
From GPIO to GND?

In that case try a 10 KOhm resistor from GPIO to +3.3V and a capacitor of 47... 100 nF from GPIO to GND.

Re: Security panel K2000

Posted: 02 Feb 2019, 17:27
by remko2000
grovkillen wrote: 02 Feb 2019, 16:21 Tried debounced?
yes but that doesn't help.

Re: Security panel K2000

Posted: 02 Feb 2019, 17:31
by remko2000
Shardan wrote: 02 Feb 2019, 17:24 How did you connect the "Bell" contacts.
From GPIO to GND?

In that case try a 10 KOhm resistor from GPIO to +3.3V and a capacitor of 47... 100 nF from GPIO to GND.
The bell contacts I connect to GPIO and GND indeed. This contact gives a good stabile state 0 or 1 signal.

The problem is the other NO pushcontact which gives multiple signals (one wire from GPIO13 to the securitypanel NO-contact).Does help the resistors you mentioned for this problem?

Re: Security panel K2000

Posted: 02 Feb 2019, 21:38
by Shardan
remko2000 wrote: 02 Feb 2019, 17:31
Shardan wrote: 02 Feb 2019, 17:24 How did you connect the "Bell" contacts.
From GPIO to GND?

In that case try a 10 KOhm resistor from GPIO to +3.3V and a capacitor of 47... 100 nF from GPIO to GND.
The bell contacts I connect to GPIO and GND indeed. This contact gives a good stabile state 0 or 1 signal.

The problem is the other NO pushcontact which gives multiple signals (one wire from GPIO13 to the securitypanel NO-contact).Does help the resistors you mentioned for this problem?
That is difficult to say without any knowledge about what the system does behind the scenes.
Multiple signals sounds a bit like data being sent, a resistor/capacitor combination wont help in that case.
If it is just contact bouncing, a very long debounce time or a 10KOhm and a fat capacitor may help.
But that depends a bit on what "NO" says. Is that a mechanical contact, Relay or such or an
open collector output with a transistor? In the second case this might damage the switching transistor.

It's difficult to find a resolution without hands on.. a view with an oscilloscope on the signal would be a good idea.

Re: Security panel K2000

Posted: 02 Feb 2019, 22:16
by remko2000
Maybe this picture explains more. I found it on internet. It's explains the possibilities of the K2000 panel and in yellow how I use the contacts now.
e826b7bf-20a0-4ce6-9cb7-30590bc93928.JPG
e826b7bf-20a0-4ce6-9cb7-30590bc93928.JPG (164.48 KiB) Viewed 12279 times

Re: Security panel K2000

Posted: 02 Feb 2019, 22:58
by Shardan
I can't find any manual or at least info what "NO" is really.

Following this short manual
https://cdn.shopify.com/s/files/1/0248/ ... TimTec.pdf
the NO is a pushbutton input - that won't work as an output to a ESP-GPIO.

As said, it needs some hands-on.....

Re: Security panel K2000

Posted: 02 Feb 2019, 23:59
by remko2000
thx for helping me. Indeed, I think it's a pushbutton input.

I came up with the idea because I have read that this panel works with a Fiabaro binary sensor. See this scheme:
Image-1.png
Image-1.png (116.74 KiB) Viewed 12266 times
There the use the NO-contact.

Maybe can I use an other contact?
A relay also switches when I enter the code code. Maybe I can do something with ESP in this contact?

Re: Security panel K2000

Posted: 03 Feb 2019, 01:42
by Shardan
I've looked up some documentation.
Mostly that pin is called "Push/NO". I guess that means "Push button, normaly open".
Definitely that naming is a bit misleading.

Re: Security panel K2000

Posted: 03 Feb 2019, 08:44
by remko2000
Shardan wrote: 03 Feb 2019, 01:42 I've looked up some documentation.
Mostly that pin is called "Push/NO". I guess that means "Push button, normaly open".
Definitely that naming is a bit misleading.
So no other solutions to connect the wemos in your opinion?

Re: Security panel K2000

Posted: 03 Feb 2019, 11:58
by Shardan
Hm... it should be possible to use the NC contact instead.

It is the inverted signal of an NO contact so you would have to configure ESPEasy accordingly.
As this contact uses 12V and drives a coil for lock opening it is necessary to use a kind of level converting:
A resistor 1KOhm/0,25W from NC to the GPIO, a zener diode of 3.3V from GPIO to GND, that should do the job.
See the schematic at https://www.letscontrolit.com/wiki/inde ... _Converter
The second schematic in the wiki post.
Do not use 330 ohm as shown, that is calculated for 5V, not for 12V.

The zener diode limits the voltage to 3.3V. Even voltage spikes from the coil are eliminated.

Re: Security panel K2000

Posted: 03 Feb 2019, 18:12
by remko2000
Yes! THX for the great help.

The NC-contact do the job.
I connect it with GROUND and my GPIO13 connected on the 12V. I use a LM1117 in between to convert the 12V to 3,3V (max V GPIO).This works great.

I'm no stuggling with rules to set a timer. I want a delay of 30 secondes when I set my alarmin. After 30 secondes I want to set GPIO 0 (with timer 1) on low (0) like this:
23915337: SW : Switch state 1 Output value 1
23915339: EVENT: belalarmin#alarmin=1.00
I use this rule:
on belalarmin#state do
if [belalarmin#state]=1.00
timerSet,1,30
endon

on Rules#Timer=1 do
gpio,0,0
endon
What do I missing?

Re: Security panel K2000

Posted: 03 Feb 2019, 18:42
by grovkillen
If segments need a closing "EndIf".

Re: Security panel K2000

Posted: 03 Feb 2019, 19:37
by remko2000
thx I changed it to:
on alarmin#state do
if [alarmin#state]=1.00
timerSet,1,30 // 30 second timer
endon

on Rules#Timer=1 do
gpio,0,0
endif
endon
but no change. No response at all.

Re: Security panel K2000

Posted: 03 Feb 2019, 20:26
by grovkillen
Please review your rule ;)

Code: Select all

on alarmin#state do
if [alarmin#state]=1.00
timerSet,1,30 // 30 second timer
EndIf
endon

on Rules#Timer=1 do
gpio,0,0 
endon

Re: Security panel K2000

Posted: 04 Feb 2019, 18:21
by remko2000
I don't understand. I change my rule but still nothing happened.
My rule is now:
on belalarmin#state do
if [belalarmin#state]=1.00
timerSet,1,30 // 30 second timer
EndIf
endon

on Rules#Timer=1 do
gpio,0,0
endon
My switch is called ' belalarmin'

If I push it I get in my log:
200525: SW : Switch state 0 Output value 0
200532: EVENT: belalarmin#alarmin=0.00
200725: SW : Switch state 1 Output value 1
200727: EVENT: belalarmin#alarmin=1.00
I want that GPIO0 get low after 30 secondes but nothing happening. What am I doing wrong?

Re: Security panel K2000

Posted: 04 Feb 2019, 19:37
by grovkillen
Where do you set the GPIO to be high?

Re: Security panel K2000

Posted: 09 Feb 2019, 11:31
by remko2000
remko2000 wrote: 03 Feb 2019, 18:12 Yes! THX for the great help.

The NC-contact do the job.
I connect it with GROUND and my GPIO13 connected on the 12V. I use a LM1117 in between to convert the 12V to 3,3V (max V GPIO).This works great.

I'm no stuggling with rules to set a timer. I want a delay of 30 secondes when I set my alarmin. After 30 secondes I want to set GPIO 0 (with timer 1) on low (0) like this:
23915337: SW : Switch state 1 Output value 1
23915339: EVENT: belalarmin#alarmin=1.00
I use this rule:
on belalarmin#state do
if [belalarmin#state]=1.00
timerSet,1,30
endon

on Rules#Timer=1 do
gpio,0,0
endon
What do I missing?
I do not understand it any more. This solution only works if my wemos is being fed through my computer via USB. As soon as I have my wemos fed by external power supply such as 12V (from my panel) that I convert to 5V, I get no response in esp easy when I enter the correct code on my panel. how can this be explained?

Re: Security panel K2000

Posted: 09 Feb 2019, 13:09
by Shardan
First:
Check if you have a reliable ground connection.
K2000 GND and WeMos GND must be properly connected.

Second:
Use a standard 5V/1A Wall Plug Type power supply with USB pluig and test with that.
The voltage regulators like LM1117-%, LM7805, LF-50 and so on are always good for
some surprises, for example oscillationg voltage on output.

Re: Security panel K2000

Posted: 09 Feb 2019, 16:00
by remko2000
thx for your response.

I checked ground; if I connect ground K2000 with ground Wemos the voltage no longer falls away (normaly a couple of seconds) when activate the NC-contact.

So I tried a separate wall plug 5V3A. Even then nothing happens. As soon as I reconnect my wemos to my computer, I get a signal on activation of the nc:
5776: SW : Switch state 0 Output value 1
38776: SW : Switch state 1 Output value 0
This is the response I want but without connecting to my computer (I want to use a external powersupply).

A summary of how I connected it:

Wemos GPIO 13 to LM1117 Vout +
Wemos GROUND to LM1117 GND

LM1117 Vin+ to 12V K2000
LM1117 GND to NC contact K2000