Kyndr - the Smart Kindergarten

by cincoutprabu in Circuits > Wearables

383 Views, 3 Favorites, 0 Comments

Kyndr - the Smart Kindergarten

Kynder Architecture 3.png

The idea is to build a platform for safety and security of school children. Today, there are numerous child trafficking rackets targeting young and innocent school children. Parents are leaving their loved ones to private carrier vehicles like vans and auto-rickshaws. Especially, middle-class working parents from developing countries (like China, India, Indonesia, etc.) doesn't have much choice other than trusting the private vehicle operators. The idea of this project is to build a smart ID card for school children and a system of sensor nodes (base stations) to safely track the children from the moment they leave the home in school-bus or private carrier vehicle. The overall objective is to provide peace of mind to parents regarding their children's safety.

Each ID card carried by children is a safe BLE (Bluetooth Low Energy) enabled device that will be constantly communicating with the base stations installed on the school premises (classrooms, prayer halls, play areas, restrooms, vehicle boarding area, etc.) and on vehicles (school buses and private carrier vehicles). The base stations are smart enough to identify a set of known school children nearby and broadcast the information to a web server on cloud. The data and statistics collected by the server will be made available to parents (thru their mobile phones), to school administrators and to government officials (if necessary).

The system is capable of sending notifications to parents about key events like child reached the classroom by morning, left the classroom by evening, spent 30 minutes on lunch hall, etc. Also, critical alerts will be raised to parents and school administrators when a potential mishap is detected like children have left the vehicle but haven't reached the classroom within few minutes or if child haven't reached the carrier vehicle after school closing time.

In addition to tracking children's location, each ID card can serve as a wearable tracker too (similar to Fitbit One) in order to capture the activity details throughout the child's day out at school.

This instructable doesn't cover how to implement all of the above proposed ideas. The scope of this instructable is to demonstrate indoor location tracking using Intel Edison and TI CC2650 SensorTag. Currently, location tracking is achieved by reading samples of RSSI (Received Signal Strength Indicator) values between a base station (Intel Edison board) and an ID card (TI SensorTag). There could be more advanced ways for reliable indoor location tracking, which will eventually be incorporated into Kyndr when it rolls it to next stage.

Following are the parts needed:

  • 1x Intel Edison + Arduino Breakout Board (for every school zone or vehicle)

http://www.adafruit.com/products/2180

  • 1x Texas Instruments CC2650STK SensorTag (for every child to be tracked)

https://store.ti.com/cc2650stk.aspx

  • 1x iOS or Android device (for every parent)

Setup Intel Edison for BLE Development

IMG_2825.JPG
  • Assemble the Edison Compute Module with Arduino Breakout Board by following the steps here.

https://software.intel.com/en-us/assembling-intel...

  • Download and install the Edison installer which will flash the Edison with latest firmware and install the Intel XDK IoT edition. I used Windows 64-bit version installer and IDE.

https://software.intel.com/en-us/iot/library/edis...

  • Setup a USB serial connection to Edison using putty.

https://software.intel.com/en-us/setting-up-serial...

  • Assign a name & password to the board, and then connect it to WiFi. Running the following command from putty will allow you to do these one by one: "configure_edison --setup".

https://software.intel.com/en-us/setting-up-seria...

  • By now, you should be ready with your Intel Edison board for development with Intel XDK IoT edition. You can test your setup once with blink example if necessary.

https://software.intel.com/en-us/blinking-led-with...

  • Enable Bluetooth on the board and install necessary libraries for communicating with BLE enabled devices.

http://rexstjohn.com/configure-intel-edison-for-bl...

Setup Database and Mobile App on Cloud

KyndrDBOverview.png
KyndrDBDataSample.png

Before going further into base station setup and testing location tracking, let's setup the database and mobile app. You can create the database and mobile app in any tool of your choice. I used Microsoft SQL Server 2008 R2 Express for creating the database and ASP.NET & C# in Visual Studio Express 2012 for Web to create the mobile app. The database schema can be inferred by going through the DB scripts.

  • Add records into ZoneList and DeviceList table depending on how many base stations and ID cards you have. Each zone corresponds to a base station (Intel Edison board) and each device corresponds to an ID card (CC2650 SensorTag).
  • Download and open the mobile app code in Visual Studio. Modify the connection string in DBHelper.cs file so that it points to the correct database just restored. The mobile app contains two web pages namely API.aspx and ChildList.aspx. Modify the auth-key in Page_Load event of both web pages. The mobile app uses this auth-key to validate whether the requests received are from known base stations. The base stations call API.aspx with appropriate values as part of query string in order to log the device events whenever a child with Kyndr ID card reaches or leaves a zone.
  • Publish and deploy the mobile app into your web server. I used IIS-7 (Internet Information Services) to publish the ASP.NET mobile app.
  • Test the mobile app by opening the below URL in a desktop or mobile browser. Replace "localhost" with your web server IP address and "key" with your auth-key. You should be able to see the list of devices you configured in DeviceList table in the database.

http://localhost/KyndrWebApp/API.aspx?authkey=key&command=getDeviceList

Setup Base Station

XDK-Choose-Device.png

Let's setup the Intel Edison boards to work as base stations (similar to iBeacons).

  • Replace the Web API Server URL and Web API Key in main.js based on what you setup in Step 2 above.
  • Choose the target base station board (Intel Edison + Arduino Breakout board) from IoT Device dropdown. The screenshot shows two of my Intel Edison boards named as CLASSROOM and SCHOOLBUS.
  • Build and run the project on the selected device. You should be able to see the text "Listening for Kyndr ID Cards.." in the console log and also the onboard LED should begin blinking indicating that the base station is listening for ID cards nearby.

Note: If you see the text "Please check if Bluetooth is ON" in the console log, check whether you have turned on the Bluetooth as mentioned in Step 1 above.

Track the ID Cards

IMG_2820.JPG
IMG_2823 Resized.jpg

Finally, we're here... let's begin simulating the location tracking by using Intel Edison as beacons and SensorTag as mobile roaming devices.

  • Connect each base station to a power source (a fully charged 9V battery should be sufficient for Intel Edison + Arduino Breakout Board) and place them in different places across your home or wherever you are. You can also place one in your car, provided the board is able to access your WiFi network. For real time usage, the base stations for vehicles need to be able to communicate with the web server thru cell data (not in scope of this article).
  • If you are using the CC2650 SensorTag for first time, pull the tab on the battery to power on the device. Otherwise, turn the device on using the power button on the right.
  • Open the below link in your mobile browser (iOS or Android or other). I created a simple iOS app with a full-screen web browser control to launch the below link in my iPhone 5S (shown in the demo video). You should see the list of devices along with the last event associated with each of them.

http://localhost/KyndrWebApp/ChildList.aspx?authkey=key

  • Take different ID cards to nearby different base stations along with your mobile phone. You should be able to see real-time event changes for each ID card (reached a zone or left a zone) on your mobile device.

In the demo video, I have two CC2650 SensorTags named Alice and Bob being tracked by a base station (Intel Edison) and providing real-time updates to my iPhone.

Key Highlights and Further Improvements

  1. Last N number of RSSI sample values are used for tracking the ID Cards in order to avoid wrong zoning because of fluctuating/incorrect RSSIs.

  2. TI CC2650 SensorTag has a battery life of upto one year.

  3. ID cards can be attached/embedded to school uniform, school belt or badge so that the intruders doesn't know that the child is being tracked.

  4. No burden on parents to buy expensive wearables or smart-phones or smart-watches for kids.

  5. No monthly payments or data-plans for parents.

  6. Ability to know where is your kid right now.

  7. Configurable rule-based alerts. Critical alerts are sent to parents and school administrator instantly.

  8. Alert if your child haven't reached the school within x minutes after leaving the school bus or carrier vehicle.

  9. Alert if your child haven't reached the vehicle within x minutes after leaving the vehicle boarding area at school.

  10. Heat map about the places visited by the kid on school campus over a time period.

  11. Holding the onboard panic button in the ID card for x number of seconds will instantly raise an alarm to parents and school administrators. The alarm will include information like location (list of nearest base stations),
    GPS coordinates (if available), speed of movement (based on onboard sensors), temperature, altitude, etc.

  12. The base stations on school-buses and private carrier vehicles can be equipped with GPS to accurately track the routes traveled and advanced trackers to gain insights on driving behaviors, speeding, number of stops made, etc.

  13. Automatic attendance system to understand the student attendance behaviors for different subjects throughout the day.