Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

PIR Doorbell Reference Design

PIR Doorbell Reference Design

D/N: WAS-1923EN

Introduction
This Holtek PIR doorbell solution uses the BA45F6622, which is a PIR sensor detection dedicated
MCU, along with the BC2161, which is a Sub-1GHz transmitter with an integrated encoder, and
the BC68F2332, which is a Sub-1GHz OOK receiver MCU. This allows an OOK RF link below
1GHz (315MHz, 433MHz, 868MHz, 915MHz) to be constructed to implement a wireless alarm
and a wireless doorbell application. The BA45F6622 MCU includes a fully integrated operational
amplifier (OPA), which simplifies the peripheral circuit and therefore results in lower application
costs. As it includes an integrated encoder, the BC2161 can support multiple data formats such as
1527 format, custom format, etc, and provides a maximum transmission power of 13dBm. The
BC68F2332 MCU includes an RF receiver, offering the advantages of low power consumption with
a receiving current of only 3.2mA in the 433MHz frequency band and a high sensitivity of -112dBm
at a data rate between 1~10Ksps.

Figure 1

Applications
Home security products, PIR doorbells, welcoming and anti-theft products.

WAS-1923EN V1.00 1 / 10 August 10, 2020


PIR Doorbell Reference Design

Solution Features
1. Transmitter which includes an integrated encoder: Supports common data formats such as the
1527, HT6P20B, etc., as well as custom formats.
The BC2161 is a highly integrated OOK/GFSK transmitter that supports the 315/433/868/915MHz
frequency bands and offers a programmable transmission power with a maximum power of +13dBm.
It includes an integrated encoder, which simplifies control, ensuring that only an external crystal and
a minimal of external components are required to implement a complete RF transmitter. Additionally,
the BC2161 provides an I2C interface and an internal FUSE data memory that can be easily
programmed.

2. MCU which includes an integrated receiver: This has low power consumption, high sensitivity
and simplified circuitry.
The BC68F2332 is a high-performance low-IF OOK RF receiver Flash MCU. In addition to
the usual advantages of Holtek MCUs, its integrated RF receiver includes a low-IF OOK
receiver architecture providing an automatic gain control (AGC) unit and a fully-integrated
OOK demodulator, allowing operations in the 315/433/868/915MHz frequency bands. These
features make the MCU suitable for use in a variety of products, such as doorbells described in
this document.

3. MCU with an OPA amplification circuit: simplified peripheral circuit


The BA45F6622 is a MCU dedicated for PIR and microwave sensor design. It includes a LDO,
a multi-channel 10-bit A/D converter and an integrated OPA, requiring only a few external
components for implementing low cost, low power consumption and high performance. These
features make the MCU suitable for use in a variety of PIR products, such as PIR lamps and
PIR doorbells described in this document.

Functional Description
PIR doorbells or alarms will generate a wireless bell ring, ringtone or alarm function as well as having
a PIR detection function and contain both a transmitting end and a receiving end. The transmitter is
usually located outside or on the door. When a visitor passes by, this will trigger the PIR sensor to
wake up the BC2161 after which data information will be formed into a packet and modulated onto
an RF signal. The receiver is usually located indoors. After the data sent from the transmitter has been
received, the receiver will trigger a ringtone which is played using a speaker or it will raise an alarm.

WAS-1923EN V1.00 2 / 10 August 10, 2020


PIR Doorbell Reference Design

The following figures show a PIR doorbell product.

Figure 2 Figure 3

Operating Principles
PIR doorbells contain a transmitting end and a receiving end. The transmitter uses the BA45F6622
and BC2161 as the master devices to detect PIR changes to trigger the BC2161 which will send an RF
signal. The receiver uses the BC68F2332 as the master device to receive and decode RF signals and
then trigger a bell ring sound or other actions according to the obtained data information. The
transmitter and receiver are described below.

Hardware Description

Figure 4

WAS-1923EN V1.00 3 / 10 August 10, 2020


PIR Doorbell Reference Design

This PIR doorbell transmitter is powered by a micro-usb power source or a battery. The PIR detection
angle and range can be expanded using a Fresnel lens in the shell. A PIR sensor change is detected by
the A/D converter in the BA45F6622. When the value increases or decreases beyond the trigger
threshold value, the BC2161will be woken up via the I/O port. After data has been sent, the BC2161
returns to the SLEEP mode and the BA45F6622 continues to detect until the next trigger.

Figure 5

This PIR doorbell receiver is powered by the mains supply and uses the HT7A6322 as the power
control IC, allowing operation using an 85~265VAC power source. As an OOK Flash MCU, the
BC68F2332 is used to process RF signals as well as detect the status of the K1, K2 and K3 keys, which
correspond to different user actions such as to increase or decrease the bell chime number or to adjust
the volume level. The ringtone playing function is implemented using widely marketed audio ICs.

Layout and Hardware Considerations

Figure 6 and Figure 7 show the transmitter PCB Layout top and bottom layers.

Figure 8 and Figure 9 show the receiver PCB Layout top and bottom layers.

Figure 6. Transmitter PCB Layout Top View Figure 7. Transmitter PCB Layout Bottom View

WAS-1923EN V1.00 4 / 10 August 10, 2020


PIR Doorbell Reference Design

Figure 8. Receiver PCB Layout Top View Figure 9. Receiver PCB Layout Bottom View
PCB BOM List

Table 1

WAS-1923EN V1.00 5 / 10 August 10, 2020


PIR Doorbell Reference Design

Table 2

WAS-1923EN V1.00 6 / 10 August 10, 2020


PIR Doorbell Reference Design

Software Description

Start

Initialisation

Y
Key pressed? Key action

Y
Play music? Send bell chime code

Receive Data

N Data reception
complete?

Y
N
Pairing Mode?

Store address code

Y Address code
To play music
is correct?

Figure 10

WAS-1923EN V1.00 7 / 10 August 10, 2020


PIR Doorbell Reference Design

Initialisation

After the power-on reset, the program will first execute the RF receiver setup initialisation, timer
setup initialisation, etc. It will then load the address code stored in the EEPROM. The address code,
if it is not already paired, is 0xFFFF. Once the initialisation is complete, the bell will ring once.

Main Loop
In the main loop, the program will first scan the keys to check whether any of the Music+, Volume
and Music– keys are pressed or not. If a key has been pressed, the program will set its corresponding
action flag to a high level and then return to the main loop.

Next, the program will determine whether the music playing flag is high or not. If it is high, which
means a bell chime code needs to be sent, the program will enter the code sending subroutine. The
main loop will stop at this point until the code has been sent and the music playing flag is cleared.

Next, the program will enter the RF data receiving subroutine to decode the RF data according to the
pre-set RF communication format and using a timer. The data is then shifted into the RAM for
processing. After detecting that the data receiving flag is high, it is then determined whether the device
is in the pairing mode or not. If it is, then save the current address code unconditionally and set the
playing flag to a high level. Otherwise, compare the current address code with the addresses that have
been paired to determine whether to set the playing flag high or exit. After this return to the main loop.

Operating Description
Before use, ensure that the transmitter and receiver have been paired with each other. Each receiver
can pair a maximum of eight transmitters. Therefore, if the ninth transmitter has been successfully
paired to the receiver, the first paired transmitter will be unavailable. The receiver only responds to
transmitters that have already been paired.

Each transmitter has a unique 16-bit ID. Pairings are required to enable the receiver to save the
transmitter IDs for identification.

Pairing Method
After power on, press the Music+ and Volume keys simultaneously until the LED indicator remains
on, which indicates that the pairing mode has been entered successfully. Then trigger the transmitter
and the receiver should ring along with a flashing LED to indicate that the pairing is complete.
Press any key to exit the pairing mode. Repeat the above operation to learn another address code.
A single receiver can pair up to eight transmitters. When a ninth address code is learned, the first
paired address code will be discarded and so on.

Selecting the following Bell Chime


Press Music+ key, the next bell chime will be selected and played, cycling between 32 melodies.

Selecting the Previous Bell Chime


Press Music– key, the previous bell chime will be selected and played, cycling between 32 melodies.

WAS-1923EN V1.00 8 / 10 August 10, 2020


PIR Doorbell Reference Design

Volume Adjustment
Press Volume keys to adjust the volume, along with a bell ring sound, this will cycle between four
different volume levels.

Test Data
Test Items Theoretical Value Actual Value
TX Transmission Power 10dBm 9.5dBm
RX Sensitivity -112dBm -112dBm
Working range indoors — 30m with two walls in room
Working range outdoors — More than 120m in open areas

Table 3

Conclusion
This document has introduced a PIR doorbell solution implemented using the Holtek BA45F6622,
BC2161 and BC68F2332 devices. The BC2161, as the transmitter, includes an integrated encoder,
providing a simple way to send data in the form of RF signals and the BA45F6622 detects the PIR
sensor change, thus implementing a wireless doorbell transmitter function. The BC68F2332 is an
OOK receiver MCU, which can output an audible ringtone as well as decoding the RF signals received
from the BC2161 transmitter easily by using its integrated RF OOK receiver. In this way, a complete
PIR doorbell can be implemented.

Reference Material
Consult the BC2161, BC68F2332 and BA45F6622 Datasheets.

For more information see the Holtek website www.holtek.com.

Version and Modification Information


Date Author Issue
2019.12.11 唐键强 V1.00

WAS-1923EN V1.00 9 / 10 August 10, 2020


PIR Doorbell Reference Design

Disclaimer
All information, trademarks, logos, graphics, videos, audio clips, links and other items appearing
on this website ('Information') are for reference only and is subject to change at any time without
prior notice and at the discretion of Holtek Semiconductor Inc. and its related companies
(hereinafter 'Holtek', 'the company', 'us', 'we' or 'our'). Whilst Holtek endeavors to ensure the
accuracy of the Information on this website, no express or implied warranty is given by Holtek to
the accuracy of the Information. Holtek shall bear no responsibility for any incorrectness or leakage.
Holtek shall not be liable for any damages (including but not limited to computer virus, system
problems or data loss) whatsoever arising in using or in connection with the use of this website by
any party. There may be links in this area, which allow you to visit the websites of other companies.
These websites are not controlled by Holtek. Holtek will bear no responsibility and no guarantee to
whatsoever Information displayed at such sites. Hyperlinks to other websites are at your own risk.

Limitation of Liability

In no event shall Holtek Limited be liable to any other party for any loss or damage whatsoever or
howsoever caused directly or indirectly in connection with your access to or use of this website, the
content thereon or any goods, materials or services.

Governing Law

The Disclaimer contained in the website shall be governed by and interpreted in accordance with
the laws of the Republic of China. Users will submit to the non-exclusive jurisdiction of the
Republic of China courts.

Update of Disclaimer
Holtek reserves the right to update the Disclaimer at any time with or without prior notice, all
changes are effective immediately upon posting to the website.

WAS-1923EN V1.00 10 / 10 August 10, 2020

You might also like