All to often people forget important items that are crucial to their daily activities. Whether it is a phone, wallet, important assignment or other object, forgetting these can disrupt work, school, meetings or other life events. The goal of this project is to create a system to help prevent things getting left behind.
How it worksA RFID tagged is placed on an item the user wants to remember. A photon is setup in a room in your house, most likely a bedroom or office space. This photon is connected to a motion sensor and a RFID tag reader. When the photon senses motion, it will start looking for a RFID signal from the tag reader. After twenty seconds, it publishes an event to the second photon. The second photon, near the exit of your house, is connected to a motion sensor and a buzzer. If the event published indicates that the tag was read, the on-board led turns on when motion is sensed. Otherwise, the buzzer will go off for two seconds. This will alert the user that they forget the item they placed a tag on.
The video below is a brief demonstration of how the process work .
Hardware
The first step is to connect the RC522 RFID Tag reader and the PIR sensor to the photon as shown below.
The schematic for the circuit that includes the RFID Tag reader pin label is posted in the schematic section. The completed circuit should look like the image below.
The next step is to setup the second photon that will alert the user. The image below shows the circuit diagram for the second photon.
The schematic for the circuit is posted in the schematic section. The completed circuit should look like the image below.
Code for this project uses the RC522 RFID Reader Library found in the particle IDE. First the code looks for input from the pin connected to the motion sensor's output in the first photon. if motion is detected, the loop runs for twenty seconds and publishes "photon_rfid_completed" event. The data in the event published is dependent on the status of the tag. If the tag is read, the datum is "Detected". Otherwise, it publishes "not detected". The other photon is subscribed to events from the first photon and when it sees the event "photon_rfid_completed" it will begin to look for input from the motion sensor. When it sees this input it will give the alert corresponding to the event data.
To setup the code, create a new app on build.particle.io. Click on the "+" sign at the top right corner of the IDE to add new tab. Copy the .cpp and .h file from the github link posted in the code section and paste in the corresponding tab. This is the library needed for the RC522 tag reader. Copy and paste the main code posted in the code section into the .ino tab (Comment out the code that request for thingspeak Write API for now by adding "//" in front of the code). Flash the code on the first photon.
The second photon does not need a library so the code for the buzzer and PIR sensor can be copied and pasted into the .ino tab of a new app. The code is then flashed on the second photon.
Thingspeak Integration
Thingspeak.com can be used to graphically view outputs published by photon. The first step is to create a new account on thingspeak.com. Create a new channel and copy the Write API key. The line in the code where this should be pasted is indicated in the sketch. Remove the comment sign in front of the write API line of code. The next step is to setup a new integration using webhook. This can be accessed by opening console.particle.io/integrations . Click on "new integration", click on "custom JSON" and paste the code in the thinkspeak code tab in the code section below. Save the integration. The completed webhook integration should look like the image below.
After the webhook integration, the motion detection count can be visualized on thingspeak.com. The image below shows the graphical display on thingspeak.
The graph shows the number of times motion is detected on the first photon every five minutes.
How the project could be improved
When the project was first conceived, the idea was that the RFID card would have a larger read range than it does. Cheaper consumer RFID cards like the one we used have a very limited range, inches from the sensor, and this limits the uses of this object. Optimally with a higher end active sensor that can read tags from a further distance, a user could have multiple tags registered to their items and it would automatically read them all and could notify the user of what exactly is missing.
Comments