Logo Banner

ELECTRONICS - [Smart doorbell System]

Smart doorbell System

Introduction

On request I have built a microcontroller-based doorbell system which is being used in an industrial environment. This is the basic function: When you push the bell-button, a horn will sound for about 10 seconds. At the same time a light, which keeps burning until someone pushes a reset-button, will be activated.

The system has a lot of features:

Schematics

Here you can find the schematics for this circuit. I didn't create a PCB design because it was soldered on a prototype PCB. You can also download the PDF version of this circuit.

This circuit uses a PIC16F84A microprocessor whose frequency is regulated by a 14 MHz crystal. The circuit itself should be powered by a 12VDC voltage. Attention: I didn't add a protection against reversing the polarity of the inputs.

Schematic diagram for the smart doorbell

Software

The software for the PIC is written in High-Tech C (the freeware version that is shipped with Microchip MPLab). You can download it at the bottom of this webpage.

The software is written in a way a certain task doesn't block the other tasks. Every large delay is split up into tiny delays.

A push on any of the push buttons will cause an interrupt (PortB portchange interrupt). During the execution of the interrupt handler an internal counter is increased. This counter holds the number of times the button was pressed. If you take a look at the source code you will probably notice there is a delay function inside the interrupt handler. I realize this is a big NO-NO as an interrupt handler should finish its task as quickly as possible. But in this particular case I don't see any harm in delaying the handler.

The microprocessor works with a 14.31818 MHz crystal. This is a little bit high for this kind of application but I had no other crystals at my disposal during the development of the circuit.

Download

You can download the C source for this project here:

Developed in: High-Tech C (Microchip)
Download type: Doorbell Source (.C Source)
License: Freeware
Size: 1 kB
Source code: Available
MD5 Checksum: 472bddf9f9cdd3f160ac0ce9bc103411

Copyright ©1998-2017 Vanderhaegen Bart - last modified: August 24, 2013