Smart Home Tracking Setup

by erikpohle in Circuits > Arduino

185 Views, 1 Favorites, 0 Comments

Smart Home Tracking Setup

pic_arduino2.jpg

This is an instructable for setting up Smart Home Tracker.

Pre-Requisites:

- Arduino Board with RFID/NFC Shield

- RFID/NFC Bracelet

- Python installed

Cloning Repository

pic_gith.png
pic_git_dw.png

First go to the github repository located at https://github.com/ErikPohle/CSCI-4380-HMI

Now that you are at the GitHub repository, click the green "Code" button and select "Download ZIP" from the dropdown list.

Extract the Contents in ZIP File

pic_extract.png

Go to the file location where that zip file was downloaded and extract the contents.

Note: Remember where you extracted the contents of the zip file

Download Arduino IDE

pic_arduino_codepng.png

Download the Arduino IDE here: https://www.arduino.cc/en/software

Once done with that, run the IDE and open the file with the name "readMifare.ino" from the location where you extracted the ZIP too.

Connect Arduino to PC/Laptop and Export Code

pic_upload_to_arduino.png

Now that the code is on the Arduino IDE, we need to push that code to the physical device.

First, make sure the Arduino is correctly plugged into the PC/laptop. Then, click the teal button with the left-facing arrow. Wait a few seconds and the code should successfully be uploaded to the arduino!

Run Simulator

pic_sim.png

Now we need to run the simulator, so we know if the smart home tracking is working.

First, make sure python is installed and you have a suitable IDE that works with python (I recommend VSCode). Then, open the IDE chosen and open the file named "simulator.py". Now run the file. If the file fails to run, make sure you have the dependencies installed. You can do this by running "pip install flask" and "pip install flask-restful". Now that the dependencies are resolved, you should be able to run the python file. The service is successfully running if the console output looks something like:

"* Serving Flask app "index" (lazy loading)

* Environment: production

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

* Debug mode: off

* Running on http://127.0.0.1:5002/

(Press CTRL+C to quit)"

Finalize Setup

pic_success.png

Now that all the services are up and running, have the RFID bracelet run past the Arduino with the RFID shield.

The simulator should receive a request and print something along the lines of "Living room light turned on/off by User". Success! The smart home tracking system is working.