PIR Sensor output to firebase

Hi everyone,

I have an assignment on counting the number of people passing by the corridor. I need to store the sensor output to the firebase database. My board is an Arduino UNO, i have searched on the internet and couldn’t find anything useful things on it. I have tried arduino-firebase but didn’t work for my board. So what can i do to store the sensor output to firebase database? Thank you very much!

Your first problem is on accurately counting the number of people passing. I would say it is near impossible using a PIR.
How would you know if it was activated by one person or two people or a group?
How would you know if they were entering or leaving the corridor?
What happens if somebody turns round and goes back?

You cannot run a database on an Arduino but the Arduino can make use of sensors and communicate back results using WiFi, Ethernet or Serial links.

So you need to say what software the "firebase database" is and what is it running on.

I am using firebase "realtime database" and my arduino UNO board is connected to my laptop. So can i send the data through my laptop's wifi?

There are several threads out here related to people counting - do a search.

It's not trivial, at all, and the best results are probably by using image recognition techniques (and that's out of scope of Arduinos).

MIKUxICE:
I am using firebase “realtime database” and my arduino UNO board is connected to my laptop. So can i send the data through my laptop’s wifi?

Yes, but you’re going to have to write a program on your laptop that talks to Firebase. Google’s documentation shows multiple ways to do this including helper libraries in a variety of languages.

That program can also talk to the Uno over serial to gather the corridor count data to send to Firebase. That’s all quite straightforward although it may take a while to get it working even so.

But, as noted above, if you actually need any kind of accurate count, this is a hard problem to solve.

Thank you for your answer, this is just the assignment task. Must do it using PIR sensor. So to run the sensor i have to use the arduino ide, and i'm using html and Js to show the result on a web page. What application and talk to both html and the PIR sensor?

PIR sensor: that's just a basic on/off signal. It doesn't count people, it just informs you of the presence of something warm that's moving. That's what they do. I have no idea how you intend to relate this to anything resembling the number of people, unless you have someone at the door that makes sure only one person at a time can pass through, and that there is at least 1-2 seconds between people passing to allow the PIR to deactivate (usually 1-2 seconds is the minimum time it'll stay active upon detection of movement).

For the html part you could use an ESP8266 as simple web server, it serving the page with the counter to you. I don't know enough of javascript to know whether you can have it update automatically, but you can dynamically create the page with the latest number included and re-request it regularly.

MIKUxICE:
…this is just the assignment task. Must do it using PIR sensor.

What people are telling you is that the assignment, as you have described, cannot be done.

Maybe you have not understood the assignment properly?
You can use a PIR to detect that people are in the corridor and you can count the number of times people are detected in the corridor but you cannot use the PIR to count the number of people in the corridor.

ardly:
Maybe you have not understood the assignment properly?

Fair chance it's just another case of an instructor not really understanding what they're asking for.