Door Counter

Inspiration

In the United States public libraries are required to keep track of statistics on how many people use their services. This can be done in many ways, such as keeping a tally of how many reference questions are asked or how many children attend a storytime. Libraries would like affordable ways to automate some of this statistical work. One potential area of automation is through using door counters to keep track of how many people visit the library each day.

What it does

This project uses an ir breakbeam sensor to count how many people enter and exit a library each day. Currently I have the count displayed with a 7-Segment display, but I hope to modify it so the count is sent via wifi to an IoT web interface. I want to help librarians automate the collection of usage statistics for their facility.

How I built it

I combined an IR breakbeam (transmitter/receiver pair) with a 7-segment display on an arduino uno. It took me a full afternoon to get that working and now it's Memorial Day weekend, so next week when I go back to work I hope to add a wifi shield.

Challenges I ran into

State change (software)

I was so excited about this idea that I ordered the components then wrote the first version of the C program while I waited for delivery. Just because a program compiles doesn't mean it's free of semantic errors, though! Once I uploaded my code to the built prototype, I realized that first version of the program had a bug. The counter continuously incremented for the duration of a beam break. I rewrote it to only increment when the state of the beam changed from unbroken to broken. This way if someone lingers in the doorway they will only be counted once.

Reflectance (hardware)

I got the device to the point where it worked when the TX and RX were held very close to each other. However, I need them to cover the span of a doorway. I considered using separate power supplies on each side of the door frame, but that would be inconvenient with AC and problematic if battery powered. Instead I am trying to find a reflective material that will bounce the signal across the span of a doorframe. This will let me place both transmitter and received on the same power source and within the same housing.

Accomplishments that I'm proud of

Before this project I had only soldered film projectors which have very large connnections. The tiny connections on the backpack made me very nervous that I might mess it up and accidentally solder two connections together. I overcame my fear by practicing soldering the pins on a row of headers. It helped me build up my confidence before soldering the backpack.

What I learned

The first few times i ran the code on the board I used println statements for debugging. I was getting some gobbledegook in the serial monitor. I learned that I needed to add some delays in my program to allow the code to execute smoothly. My entire project was possible because of the h files and demo code from adafruit.

What's next for Door Counter

I want to make a smaller version with the adafruit trinket. I want to make a smaller wifi enabled IoT version with the adafruit feather Huzzah. I want to make a datalogger version with the Arduino101. I want to make a series that are connected to multiple doorways in a facility.

Built With

Share this project:

Updates