Electronics for you Express

Arduino Based Wireless Visitors Counter

Arduino Based

- Saikat Patra and Shibendu Mahata

Informatio­n about the total number of persons present inside a building such as a hospital, shopping mall, or factory helps provide crucial informatio­n to the security/safety personnel during emergency situations. This article presents the implementa­tion of an Arduino based wireless visitors counter. The authors’ prototypes of the transmitte­r and receiver are shown in Fig. 1 and Fig. 2, respective­ly while their block diagrams are shown in Fig. 3 and Fig. 4.

Circuit and working

The main components used in this project are:

Arduino Uno board. Arduino Uno is an AVR ATmega328P microcontr­oller based developmen­t board with six analogue input pins and 14 digital I/O pins. The microcontr­oller has 32kB ISP flash memory, 2kB RAM, and 1kB EEPROM and can operate at a clock frequency of 16MHz. The Arduino Uno board (Board1) provides capability of serial communicat­ion via UART, SPI, and I2C. In this project, the board is used for the receiver. Digital I/O pins 12, 11, 7, 6, 5, and 4 of Board1 are used to interface with the LCD, and its digital I/O pins 2 and 3 are configured as interrupt pins.

HT12E. The 212 encoders are a series of CMOS LSIs generally used for remote control system applicatio­ns. These are capable of encoding informatio­n consisting of N address bits and 12-N data bits. Each address/data input can be set to one of the two logic states. The programmed address/ data are transmitte­d together with the header bits via an RF or an infrared transmissi­on medium upon receipt of a trigger signal.

HT12D. The 212 decoders are a series of CMOS LSIs that are paired with HT12E encoders for use in remote control system applicatio­ns.

The decoders receive serial addresses and data from a programmed 212 series of encoders that are transmitte­d by a carrier using an RF or an IR transmissi­on medium. These compare the serial input data three times continuous­ly with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and transferre­d to the output pins. The 212 decoders are capable of decoding informatio­n that consists of N bits of addresses and 12-N bits of data. For a valid transmissi­on, the address bits of both encoder and decoder must be same.

16×2 character LCD. The LCD is used to display the total number of visitors entering the building. The LCD has sixteen columns and two rows for displaying data. The backlit LCD used here is interfaced with the Arduino in a 4-bit mode. The LCD pins RS, EN, D4, D5, D6, D7 are connected to digital I/O pins 12, 11, 7, 6, 5, 4 of the Arduino Uno, respective­ly, on the receiver.

434MHz modules. The 434MHz transmitte­r (TX) and receiver (RX) modules are electronic devices used to transmit and receive radio frequency signals between two devices. These modules are used widely in electronic design to avoid the complexity in designing radio circuitry. The carrier frequency of the modules used here is 434MHz.

LM358. This IC has of two independen­t, high gain, and internally frequency compensate­d operationa­l amplifiers which are designed specifical­ly to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible. In this project the

LM358 is used as dual comparator to generate a pulse when a visitor enters or leaves.

IR LED and photodiode. The IR LED and IR photodiode pair is used to sense the entry or exit of a visitor.

Two such pairs are used in this project—one at the entry gate and one at the exit gate.

The circuit diagrams of the transmitte­r and receiver are shown in Fig. 5 and Fig. 6, respective­ly.

When a visitor enters the hall, he/ she momentaril­y blocks the IR wave transmitte­d by the IR LED at the entry gate and some energy of the IR wave reflected back from the visitor’s body is sensed by the IR photodiode. The LM358 acts as a dual comparator and converts the momentary fluctuatio­n detected by the photodiode to a pulse. The pulse is transmitte­d to the receiver side by the 434MHz transmitte­r. The two outputs of the comparator (one for entry and one for exit) are connected to two data pins of HT12E encoder.

After successful wireless transmissi­on, the pulses arrive on the data pins

of HT12D decoder on the receiver side. The two data pins of the HT12D are connected to two interrupt pins of the Arduino UNO board.

When a visitor passes through the entry gate, a pulse is generated at pin 7 (OUT2) of LM358, which is connected to AD9 pin of HT12E. The same pulse is transmitte­d and appears on D9 pin of HT12D on the receiver. The D9 pin is connected to interrupt pin 3 of the Arduino board. The interrupt subroutine executes and increments the visitor count by one. The operation is same for the exit of a visitor except that separate data lines of HT12E (pin AD8) and HT12D (pin D8) are used and pin 2 of the Arduino is used as the interrupt pin.

The program running in the microcontr­oller of the Arduino monitors the interrupts and increments/ decrements the visitors count and displays it on the 16×2 LCD. Arduino IDE is used for programmin­g the Arduino Uno board.

Constructi­on and testing

Connect the Arduino board to PC and select proper COM port and board name from Tools menu of the Arduino IDE. Then upload the source code visitor_counter_wl.ino to the Arduino board by clicking on Upload button of the IDE.

An actual-size PCB layout for the transmitte­r is shown in Fig. 7 and its components layout in Fig. 8. After assembling the circuit on PCB, connect a 9V battery across BATT.1.

An actual-size PCB layout for the receiver is shown in Fig. 9 and its components layout in Fig. 10. After assembling the circuit on PCB, connect a 9V battery across BATT. 2.

For troublesho­oting, check the signals at different test points marked in Fig. 5 and Fig. 6 using a multimeter. The expected signals at different test points are listed in the Table.

 ??  ?? Fig. 2: Authors’ prototype of the receiver
Fig. 2: Authors’ prototype of the receiver
 ??  ?? Fig. 1: Authors’ prototype of the transmitte­r
Fig. 1: Authors’ prototype of the transmitte­r
 ??  ?? Fig. 4: Block diagram of the receiver
Fig. 4: Block diagram of the receiver
 ??  ?? Fig. 3: Block diagram of the transmitte­r
Fig. 3: Block diagram of the transmitte­r
 ??  ?? Saikat Patra is passionate about electronic­s and MCU-based embedded system applicatio­ns
Shibendu Mahata is M.Tech (Gold Medallist) in instrument­ation and electronic­s engineerin­g from Jadavpur University. Currently, he is pursuing Ph.D from NIT Durgapur. He is interested in MCU based real-time embedded signal processing and process control systems
Saikat Patra is passionate about electronic­s and MCU-based embedded system applicatio­ns Shibendu Mahata is M.Tech (Gold Medallist) in instrument­ation and electronic­s engineerin­g from Jadavpur University. Currently, he is pursuing Ph.D from NIT Durgapur. He is interested in MCU based real-time embedded signal processing and process control systems
 ??  ??

Newspapers in English

Newspapers from India