Skip to content

Commit 7b24fed

Browse files
committed
KeypadInterface - add Classic series keypad support (PC1500RK) #200
1 parent 7d0ee63 commit 7b24fed

File tree

12 files changed

+664
-33
lines changed

12 files changed

+664
-33
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This library uses a combination of hardware and timer interrupts to accurately c
6464
* Virtual keypad:
6565
- Write keys to the panel for all partitions
6666
* Keypad interface:
67-
- Use DSC keypads as physical input devices for any general purpose without needing a DSC panel.
67+
- Use DSC PowerSeries and Classic series keypads as physical input devices for any general purpose without needing a DSC panel.
6868
* Panel time - retrieve current panel date/time and set a new date/time (including an example with NTP sync)
6969
* Panel installer code unlocking - determine the 4-digit panel installer code
7070
* Direct Keybus interface:
@@ -105,7 +105,7 @@ This library uses a combination of hardware and timer interrupts to accurately c
105105
## Release notes
106106
* develop
107107
- New: DSC Classic series panel support: PC1500, PC1550
108-
- New: `KeypadInterface` example sketch - interfaces with DSC keypads as physical input devices for any general purpose without needing a DSC panel.
108+
- New: `KeypadInterface` and `KeypadInterface-MQTT` example sketches - interface with DSC PowerSeries and Classic keypads as physical input devices for any general purpose without needing a DSC panel.
109109
- New: esp32-s2 microcontroller support
110110
* 2.0
111111
- New: [Telegram](https://www.telegram.org) bot example sketch
@@ -239,7 +239,7 @@ The included examples demonstrate how to use the library and can be used as-is o
239239

240240
* **Unlocker**: Checks all possible 4-digit installer codes until a valid code is found, including handling keypad lockout if enabled. The valid code is output to serial as well as repeatedly flashed with the built-in LED.
241241

242-
* **KeypadInterface**: Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of DSC keypads as physical inputs for any general purpose. Note that this uses a different wiring setup from the standard Keybus interface, refer to the wiring diagram in the sketch.
242+
* **KeypadInterface**: Interfaces directly to DSC PowerSeries and Classic series (tested with PC1500RK) keypads (without a DSC panel) to enable using these as physical inputs for any general purpose. Examples included for interfacing via serial and MQTT. Note that this uses a different wiring setup from the standard Keybus interface, refer to the wiring diagram in the example sketch.
243243

244244
* **KeybusReader**: Decodes and prints data from the Keybus to a serial interface, including reading from serial for the virtual keypad. This can be used to help decode the Keybus protocol and is also handy as a troubleshooting tool to verify that data is displayed without errors. For esp8266/esp32, `KeybusReaderIP` enables connectivity over WiFi.
245245

examples/Arduino/KeypadInterface-MQTT/KeypadInterface-MQTT.ino

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* DSC Keypad Interface-MQTT 1.1 (Arduino with Ethernet)
2+
* DSC Keypad Interface-MQTT 1.2 (Arduino with Ethernet)
33
*
4-
* Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of
5-
* DSC keypads as physical inputs for any general purpose.
4+
* Interfaces directly to a DSC PowerSeries or Classic series keypad (without a DSC panel) to
5+
* enable use of DSC keypads as physical inputs for any general purpose.
66
*
77
* This interface uses a different wiring setup from the standard Keybus interface, adding
88
* an NPN transistor on dscClockPin. The DSC keypads require a 12v DC power source, though
99
* lower voltages down to 7v may work for key presses (the LEDs will be dim).
1010
*
11-
* Supported features:
11+
* PowerSeries keypad features:
1212
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
1313
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Fire, Program, Backlight, Zones 1-8: dsc.lightReady, dsc.lightZone1, etc
1414
* - Set keypad beeps, 1-128: dsc.beep(3)
@@ -18,7 +18,12 @@
1818
* 3 beeps, constant tone, 2 second interval: dsc.tone(3, true, 2)
1919
* Disable the tone: dsc.tone() or dsc.tone(0, false, 0)
2020
*
21+
* Classic keypad features:
22+
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
23+
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Zones 1-6: dsc.lightReady, dsc.lightZone1, etc
24+
*
2125
* Release notes:
26+
* 1.2 - Add Classic keypad support - PC1500RK
2227
* 1.1 - Add keypad beep, buzzer, constant tone
2328
* 1.0 - Initial release
2429
*
@@ -53,7 +58,10 @@
5358
*
5459
* This example code is in the public domain.
5560
*/
61+
62+
// Set the keypad type
5663
#define dscKeypad
64+
//#define dscClassicKeypad
5765

5866
#include <SPI.h>
5967
#include <Ethernet.h>
@@ -78,7 +86,11 @@ const char* mqttSubscribeTopic = "dsc/Set"; // Receives messages to send
7886
#define dscWritePin 6 // Arduino Uno: 2-12
7987

8088
// Initialize components
89+
#ifdef dscKeypad
8190
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
91+
#else
92+
dscClassicKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
93+
#endif
8294
bool lightOff, lightBlink, inputReceived;
8395
const byte inputLimit = 50;
8496
char input[inputLimit];

examples/Arduino/KeypadInterface/KeypadInterface.ino

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* DSC Keypad Interface 1.1 (Arduino)
2+
* DSC Keypad Interface 1.2 (Arduino)
33
*
4-
* Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of
5-
* DSC keypads as physical inputs for any general purpose.
4+
* Interfaces directly to a DSC PowerSeries or Classic series keypad (without a DSC panel) to
5+
* enable use of DSC keypads as physical inputs for any general purpose.
66
*
77
* This interface uses a different wiring setup from the standard Keybus interface, adding
88
* an NPN transistor on dscClockPin. The DSC keypads require a 12v DC power source, though
99
* lower voltages down to 7v may work for key presses (the LEDs will be dim).
1010
*
11-
* Supported features:
11+
* PowerSeries keypad features:
1212
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
1313
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Fire, Program, Backlight, Zones 1-8: dsc.lightReady, dsc.lightZone1, etc
1414
* - Set keypad beeps, 1-128: dsc.beep(3)
@@ -18,7 +18,12 @@
1818
* 3 beeps, constant tone, 2 second interval: dsc.tone(3, true, 2)
1919
* Disable the tone: dsc.tone() or dsc.tone(0, false, 0)
2020
*
21+
* Classic keypad features:
22+
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
23+
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Zones 1-6: dsc.lightReady, dsc.lightZone1, etc
24+
*
2125
* Release notes:
26+
* 1.2 - Add Classic keypad support - PC1500RK
2227
* 1.1 - Add keypad beep, buzzer, constant tone
2328
* 1.0 - Initial release
2429
*
@@ -53,7 +58,10 @@
5358
*
5459
* This example code is in the public domain.
5560
*/
61+
62+
// Set the keypad type
5663
#define dscKeypad
64+
//#define dscClassicKeypad
5765

5866
#include <dscKeybusInterface.h>
5967

@@ -62,9 +70,12 @@
6270
#define dscReadPin 5 // Arduino Uno: 2-12
6371
#define dscWritePin 6 // Arduino Uno: 2-12
6472

65-
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
66-
6773
// Initialize components
74+
#ifdef dscKeypad
75+
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
76+
#else
77+
dscClassicKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
78+
#endif
6879
bool lightOff, lightBlink, inputReceived;
6980
const byte inputLimit = 50;
7081
char input[inputLimit];

examples/esp32/KeypadInterface-MQTT/KeypadInterface-MQTT.ino

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* DSC Keypad Interface-MQTT 1.1 (esp32)
2+
* DSC Keypad Interface-MQTT 1.2 (esp32)
33
*
4-
* Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of
5-
* DSC keypads as physical inputs for any general purpose.
4+
* Interfaces directly to a DSC PowerSeries or Classic series keypad (without a DSC panel) to
5+
* enable use of DSC keypads as physical inputs for any general purpose.
66
*
77
* This interface uses a different wiring setup from the standard Keybus interface, adding
88
* an NPN transistor on dscClockPin. The DSC keypads require a 12v DC power source, though
99
* lower voltages down to 7v may work for key presses (the LEDs will be dim).
1010
*
11-
* Supported features:
11+
* PowerSeries keypad features:
1212
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
1313
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Fire, Program, Backlight, Zones 1-8: dsc.lightReady, dsc.lightZone1, etc
1414
* - Set keypad beeps, 1-128: dsc.beep(3)
@@ -18,7 +18,12 @@
1818
* 3 beeps, constant tone, 2 second interval: dsc.tone(3, true, 2)
1919
* Disable the tone: dsc.tone() or dsc.tone(0, false, 0)
2020
*
21+
* Classic keypad features:
22+
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
23+
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Zones 1-6: dsc.lightReady, dsc.lightZone1, etc
24+
*
2125
* Release notes:
26+
* 1.2 - Add Classic keypad support - PC1500RK
2227
* 1.1 - Add keypad beep, buzzer, constant tone
2328
* 1.0 - Initial release
2429
*
@@ -53,7 +58,10 @@
5358
*
5459
* This example code is in the public domain.
5560
*/
61+
62+
// Set the keypad type
5663
#define dscKeypad
64+
//#define dscClassicKeypad
5765

5866
#include <WiFi.h>
5967
#include <PubSubClient.h>
@@ -78,7 +86,11 @@ const char* mqttSubscribeTopic = "dsc/Set"; // Receives messages to send
7886
#define dscWritePin 21 // 4,13,16-33
7987

8088
// Initialize components
89+
#ifdef dscKeypad
8190
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
91+
#else
92+
dscClassicKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
93+
#endif
8294
bool lightOff, lightBlink, inputReceived;
8395
const byte inputLimit = 255;
8496
char input[inputLimit];

examples/esp32/KeypadInterface/KeypadInterface.ino

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* DSC Keypad Interface 1.1 (esp32)
2+
* DSC Keypad Interface 1.2 (esp32)
33
*
4-
* Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of
5-
* DSC keypads as physical inputs for any general purpose.
4+
* Interfaces directly to a DSC PowerSeries or Classic series keypad (without a DSC panel) to
5+
* enable use of DSC keypads as physical inputs for any general purpose.
66
*
77
* This interface uses a different wiring setup from the standard Keybus interface, adding
88
* an NPN transistor on dscClockPin. The DSC keypads require a 12v DC power source, though
99
* lower voltages down to 7v may work for key presses (the LEDs will be dim).
1010
*
11-
* Supported features:
11+
* PowerSeries keypad features:
1212
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
1313
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Fire, Program, Backlight, Zones 1-8: dsc.lightReady, dsc.lightZone1, etc
1414
* - Set keypad beeps, 1-128: dsc.beep(3)
@@ -18,7 +18,12 @@
1818
* 3 beeps, constant tone, 2 second interval: dsc.tone(3, true, 2)
1919
* Disable the tone: dsc.tone() or dsc.tone(0, false, 0)
2020
*
21+
* Classic keypad features:
22+
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
23+
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Zones 1-6: dsc.lightReady, dsc.lightZone1, etc
24+
*
2125
* Release notes:
26+
* 1.2 - Add Classic keypad support - PC1500RK
2227
* 1.1 - Add keypad beep, buzzer, constant tone
2328
* 1.0 - Initial release
2429
*
@@ -53,7 +58,10 @@
5358
*
5459
* This example code is in the public domain.
5560
*/
61+
62+
// Set the keypad type
5663
#define dscKeypad
64+
//#define dscClassicKeypad
5765

5866
#include <dscKeybusInterface.h>
5967

@@ -62,9 +70,12 @@
6270
#define dscReadPin 19 // 4,13,16-39
6371
#define dscWritePin 21 // 4,13,16-33
6472

65-
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
66-
6773
// Initialize components
74+
#ifdef dscKeypad
75+
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
76+
#else
77+
dscClassicKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
78+
#endif
6879
bool lightOff, lightBlink, inputReceived;
6980
const byte inputLimit = 50;
7081
char input[inputLimit];

examples/esp8266/KeypadInterface-MQTT/KeypadInterface-MQTT.ino

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* DSC Keypad Interface-MQTT 1.1 (esp8266)
2+
* DSC Keypad Interface-MQTT 1.2 (esp8266)
33
*
4-
* Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of
5-
* DSC keypads as physical inputs for any general purpose.
4+
* Interfaces directly to a DSC PowerSeries or Classic series keypad (without a DSC panel) to
5+
* enable use of DSC keypads as physical inputs for any general purpose.
66
*
77
* This interface uses a different wiring setup from the standard Keybus interface, adding
88
* an NPN transistor on dscClockPin. The DSC keypads require a 12v DC power source, though
99
* lower voltages down to 7v may work for key presses (the LEDs will be dim).
1010
*
11-
* Supported features:
11+
* PowerSeries keypad features:
1212
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
1313
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Fire, Program, Backlight, Zones 1-8: dsc.lightReady, dsc.lightZone1, etc
1414
* - Set keypad beeps, 1-128: dsc.beep(3)
@@ -18,7 +18,12 @@
1818
* 3 beeps, constant tone, 2 second interval: dsc.tone(3, true, 2)
1919
* Disable the tone: dsc.tone() or dsc.tone(0, false, 0)
2020
*
21+
* Classic keypad features:
22+
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
23+
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Zones 1-6: dsc.lightReady, dsc.lightZone1, etc
24+
*
2125
* Release notes:
26+
* 1.2 - Add Classic keypad support - PC1500RK
2227
* 1.1 - Add keypad beep, buzzer, constant tone
2328
* 1.0 - Initial release
2429
*
@@ -53,7 +58,10 @@
5358
*
5459
* This example code is in the public domain.
5560
*/
61+
62+
// Set the keypad type
5663
#define dscKeypad
64+
//#define dscClassicKeypad
5765

5866
#include <ESP8266WiFi.h>
5967
#include <PubSubClient.h>
@@ -78,7 +86,11 @@ const char* mqttSubscribeTopic = "dsc/Set"; // Receives messages to send
7886
#define dscWritePin D8 // GPIO 15
7987

8088
// Initialize components
89+
#ifdef dscKeypad
8190
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
91+
#else
92+
dscClassicKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
93+
#endif
8294
bool lightOff, lightBlink, inputReceived;
8395
const byte inputLimit = 255;
8496
char input[inputLimit];

examples/esp8266/KeypadInterface/KeypadInterface.ino

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* DSC Keypad Interface 1.1 (esp8266)
2+
* DSC Keypad Interface 1.2 (esp8266)
33
*
4-
* Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of
5-
* DSC keypads as physical inputs for any general purpose.
4+
* Interfaces directly to a DSC PowerSeries or Classic series keypad (without a DSC panel) to
5+
* enable use of DSC keypads as physical inputs for any general purpose.
66
*
77
* This interface uses a different wiring setup from the standard Keybus interface, adding
88
* an NPN transistor on dscClockPin. The DSC keypads require a 12v DC power source, though
99
* lower voltages down to 7v may work for key presses (the LEDs will be dim).
1010
*
11-
* Supported features:
11+
* PowerSeries keypad features:
1212
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
1313
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Fire, Program, Backlight, Zones 1-8: dsc.lightReady, dsc.lightZone1, etc
1414
* - Set keypad beeps, 1-128: dsc.beep(3)
@@ -18,7 +18,12 @@
1818
* 3 beeps, constant tone, 2 second interval: dsc.tone(3, true, 2)
1919
* Disable the tone: dsc.tone() or dsc.tone(0, false, 0)
2020
*
21+
* Classic keypad features:
22+
* - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
23+
* - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Zones 1-6: dsc.lightReady, dsc.lightZone1, etc
24+
*
2125
* Release notes:
26+
* 1.2 - Add Classic keypad support - PC1500RK
2227
* 1.1 - Add keypad beep, buzzer, constant tone
2328
* 1.0 - Initial release
2429
*
@@ -53,7 +58,10 @@
5358
*
5459
* This example code is in the public domain.
5560
*/
61+
62+
// Set the keypad type
5663
#define dscKeypad
64+
//#define dscClassicKeypad
5765

5866
#include <dscKeybusInterface.h>
5967

@@ -62,9 +70,12 @@
6270
#define dscReadPin D2 // GPIO 4
6371
#define dscWritePin D8 // GPIO 15
6472

65-
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
66-
6773
// Initialize components
74+
#ifdef dscKeypad
75+
dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
76+
#else
77+
dscClassicKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin);
78+
#endif
6879
bool lightOff, lightBlink, inputReceived;
6980
const byte inputLimit = 50;
7081
char input[inputLimit];

keywords.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
dscKeybusInterface KEYWORD1
22
dscClassicInterface KEYWORD1
33
dscKeypadInterface KEYWORD1
4+
dscClassicKeypadInterface KEYWORD1
45
dsc KEYWORD1
56

67
dscClockPin LITERAL1

0 commit comments

Comments
 (0)