The Research and Design of a New Electronic Communication Counter for Sensors

With the development of Internet of Things, in addition to the basic counting function, the counter also needs to integrate more functions to meet the application requirements, such as display, communication, charging functions and other functions. Therefore, it is very necessary to design a new electronic counter which has an ability to communicate with outside, display counting information and energy supplement. In this paper, we design a new electronic counter based on the pulse counting theory, information communication theory and flash memory technology. First of all, we will count the pulse signal through the signal input circuit and the signal processing circuit into the control circuit, which can identify the digital pulse signal. Secondly, the control circuit count the number of digital pulse signal, the count number will be real-time displayed on the digital tube. Meanwhile, the counter communicates with the Bluetooth device (smartphone, pad, etc.) via the Bluetooth module. And users can use the Bluetooth device to configure the counter's operating parameters, clear or pre-count values, view the counter operating conditions and historical data.


Introduction
With the development of Internet of Things (IoT), sensors are deployed in a variety of applications, to sense the building infrastructure, environmental information and control operation procedures automatically [1,2].In lots of sensors, there is a special and common function to count, which is a very important basic operation in digital system.The functional module-electronic counter is to count the periodic or triggering events.It is a logical circuit to achieve this operation.Counter in the digital system is mainly counting the number of pulses in order to achieve measurement, counting and control functions, and both frequency function.
The counter is composed of the basic counting unit and some control gates.And the counting unit is made up of a series of various triggers with storage information function, such as RS trigger, T trigger, D trigger and JK trigger etc [3,4].In addition to the basic counting function, the counter also needs to integrate more functions to meet the application requirements, such as display, communication, charging functions and other functions.Therefore, it is very necessary to design a new electronic counter which has an ability to communicate with outside, display counting information and energy supplement.
In this paper, we design a new electronic counter based on the pulse counting theory, information communication theory and flash memory technology.First of all, we will count the pulse signal through the signal input circuit and the signal processing circuit into the control circuit, which can identify the digital pulse signal.Secondly, the control circuit count the number of digital pulse signal, the count number will be real-time displayed on the digital tube.Meanwhile, the counter communicates with the Bluetooth device (smartphone, pad, etc.) via the Bluetooth module.And users can use the Bluetooth device to configure the counter's operating parameters, clear or pre-count values, view the counter operating conditions and historical data.
The rest of this paper is organized as follows.In section 2, we introduce system model of counter in detail.In section 3, we introduce the system workflow, and then, in section 4, we give the detail description on functions of counter.Finally, we give the conclusions in section 5.

System model
In the new electronic counter, we employ various of functional models to improve the counter function, such as the control circuit, power supply circuit, digital tube display circuit, illumination sensor, real-time clock circuit, flash memory, signal input circuit, signal processing circuit, keypad, indicator light, Bluetooth module and antenna as shown in figure 1.
The architecture of new electronic counter 2.1 Control circuit.
In the system, the control circuit is connected with most of models, such as the power supply circuit, the digital tube display circuit, the illumination sensor, the real-time clock circuit, the flash memory, the signal processing circuit, the keypad, the indicator light and the Bluetooth module, and the control circuit is used for controlling the work of each peripheral device [5].

Power supply circuit.
The power supply circuit is used for converting the external input power into the regulated DC power supply required by the system.The power supply circuit is connected with the control circuit, the digital display circuit, the illumination sensor, the real-time clock circuit, the flash memory, the signal processing circuit and the Bluetooth module.

Digital display circuit.
The digital display circuit is connected with the control circuit and the power supply circuit.The digital display circuit is mainly used to display the count value of the counter

Light intensity sensor.
The light intensity sensor is connected with the control circuit and the power circuit.The light intensity sensor measures the visible light intensity of the environment.The control circuit adjusts the brightness of the digital tube according to the illumination value, to ensure that the user do not feel glare or look at the digital tube under different lighting conditions unclearly.

Real-time clock.
The real-time clock circuit keeps connection with the control circuit and the power supply circuit [7].The real-time clock circuit is use to provide real-time time for the control circuit.The circuit contains a rechargeable battery that automatically powers the rechargeable battery when the external power supply fails, allowing the real-time clock circuit to continue operating.

Flash memory.
The flash memory is connected with the control circuit and the power supply circuit, and the flash memory is used for storing the history and operating parameters of the counter [6,8].

Signal input circuit.
The signal input circuit is connected with the signal processing circuit, the signal input circuit is used for connecting the counting pulse signal and providing the electromagnetic compatibility protection measures, and has good anti-interference performance.

Signal processing circuit.
The signal processing circuit is connected with the control circuit, the power supply circuit and the signal input circuit.The signal processing circuit converts the counting pulse signal into a digital pulse signal which can be recognized by the control circuit, and the control circuit counts the number of the digital pulse signal.
Moreover, there are also several models.The button is connected with the control circuit, and it is used to set the working parameters of the counter in the field, cleared or prefabricated count value.The indicator light is connected with the control circuit, and the indicator lamp is used to indicate the working status of the counter.The Bluetooth module is connected with the control circuit, the power circuit and the antenna, and the Bluetooth module is used for realizing the wireless communication function between the counter and the Bluetooth device [9,10].The antenna is connected to the antenna interface of the Bluetooth module and the antenna is used to radiate and receive wireless signals.

System Workflow
Counting pulse signal through the signal input circuit, the signal processing circuit into a control circuit can identify the digital pulse signal, the control circuit on the number of digital pulse signal count, the count will be displayed in real time on the digital tube.
Counter saves each updated count: When the count value is updated, the control circuit reads the real-time clock circuit of the real time information, real-time information and the time information stored with the counter value to the Flash memory.
The counter communicates with the Bluetooth device (smartphone, tablet, etc.) via the Bluetooth module.Users can use the Bluetooth device to configure the counter's operating parameters, clear or pre-count values, view the counter operating conditions and historical data.

The wireless communication function
In the counter, we adopt the Bluetooth (BLE 4.x) wireless communication.User can utilize the Bluetooth device to set the counter parameters, clear or pre-made count value, view the counter operating conditions and historical data.

The power failure memory function
In order to ensure the normal work after the power failure, we design the power failure memory function, which can store the main data into memory when power failure and restore them when restart.Moreover, we employ a built-in real-time clock and Flash memory, it can record each counter action time.

The Light automatic adjustment function
To meet the requirement of display information, we design the built-in illumination sensor, which can adjust the brightness of the digital tube according to the ambient light intensity values.

The functions of counting models
In our solution, the counter can be set to cumulative count, preset count and other control methods.Also it can be set to the addition count, subtraction count, addition and subtraction reversible count and other counting methods.And it can be set to the maximum counting speed.To improve durability, the counter adopts the electronic counter without moving parts, and the electrical durability is greater than 10 million times.

Summary
According to various requirements in applications of internet of things, we design a new electronic counter consisting of some auxiliary functions, such as communication functions, light auto-sensing function, power-off memory function based on the pulse counting theory, information communication theory and flash memory technology.The new electronic counter has a wide range of applications, can effectively support a variety of counting functions, such as the calculation of transaction frequency, the number of measurement cycles, the definition of cycle length, the establishment of transaction trigger mechanism.Meanwhile, users can use the Bluetooth device to configure the counter's operating parameters, clear or pre-count values, view the counter operating conditions and historical data.