First of all, the people counter is a device which detects the number of people traversing an entrance. I had thought that making a people counter to secure my room when I had to go a vacation for two weeks. Also, I wanted to use the people counter as an alarm that warns people who do not have the permission to enter the room. A laser is the best option to count something accurately with an LDR because of its nature of speed so I decided to use lasers with LDRs for the counting jobs. There is three possible entrance in my room (two doors and one window) so I used three lasers and three LDRs. However, I realized that I need to control remotely the device if I want to choose between the which entrance's laser is open or whether the alarm is on or not. So that I added an HC-06 Bluetooth module to communicate to the device with an Android app I created. Moreover, the Android app displays the number of people who enter the whichever entrance you want to observe.
To support my projects and articles, you can visit my website here :)
There are a lot of different ways to create an android app such as converting codes from HTML to Java or programming the app with Python. However, the MIT App Inventor is the easiest way because of its structure of drag and drop when you want to make an android app but do not forget that it has not been compatible with the iOS yet.
People Counter! is the name of the app and it includes two screens named Screen1 and Screen2.
It is the home screen to continue to the main screen but firstly, the password which is set in the MIT App Inventor must be entered correctly. (The default password that I set is "counter".)
It is the main screen and the menu to control Arduino board and the result of the people counter which is sent by Arduino is displayed on this screen.
You can choose, which laser is on or whether the alarm is open or not, on this screen furthermore you can see the result of the people counter and set it to start from zero.
A laser (light amplification by stimulated emission of radiation) is a device which sends the package of the light through the very straight line to the target basically. And an LDR (light-dependent resistor) can easily detect the increase in the intensity of the light if the laser is pointed directly to itself. When there is an obstacle between the laser and the LDR, the LDR detects a decrease in the intensity of the light. So, if you could count each decrease in the range of the optimum level, you would have a people counter. According to my experiment with the LDR, the range of the optimum level has to be between 150 and 350.
- Arduino Uno-Modules
- Pin 2 ---------Laser_Module_1
- Pin 3 -------- Laser_Module_2
- Pin 4 -------- Laser_Module_3
- Pin 5 -------- Buzzer
- Pin 6 -------- HC-06 Bluetooth Module(TX)
- Pin 7 ---------HC-06 Bluetooth Module(RX)
- Pin 8 ---------Control_Led_1
- Pin 12 ---------Control_Led_2
- Pin 13 ----------Control_Led_3
- Pin 9 ------- RGB_Module (R)
- Pin 10 ------ RGB_Module (G)
- Pin 11 ------- RGB_Module (B)
Make sure that the lasers are towards the LDRs directly before finishing all parts' connections.
After I tested the device and record a test video, I divided the device into three parts for three different entrance. I have not had my doubts about the security of my room since I used them.