In this simple project we’ll use a motion sensor to detect if an object is passing in front of our Raspberry Pi. Then we’ll count how many times that happens, and send this value to Ubidots.
People counters are typically expensive devices used in the retail industry to understand how shoppers behave. Thanks to Raspberry Pi and Ubidots, we’re able to build a functional people counter in a few hours and with a few bucks!
Once we send the people counting data to Ubidots, we can create nice graphs for analysis, as well as SMS/Email alerts.
Step 1: Getting the right materials
To complete this project you’ll need:
- A Raspberry Pi Model B
- A PIR Sensor by Parallax
- A Raspberry Pi compatible USB WiFi Dongle
- A USB battery pack to power the Raspberry Pi (this is optional in case you want to leave the Pi completely wireless)
- Three female-female jumper wires
Step 2: Wiring things up
The PIR motion sensor is quite simple to use because it only has three pins:
- A signal pin that outputs “1” when there is movement and “0” when there isn’t.
No need to solder anything, nor to write complex I2C or serial functions to detect this signal; just plug the cables straight to the GPIO pins of your Raspberry Pi and it will work!
Step 3: Casing
Because the PIR sensor is very sensitive to movement, I used the jumper switch behind it to set the lowest posible sensibility.
For more detail: How to build a People Counter with Raspberry Pi and Ubidots