F16: Micro Watch Monitoring System
Contents
Micro Watch Monitoring System
Abstract
The Micro Watch Monitoring System uses Amazon's Alexa Voice Service to relay monitored data from a network of SJ-One Boards with the assistance of the Raspberry Pi 3. The monitored data from a SJ-One Board is transmitted and received via a Xbee Wire Antenna module. The monitored data is then uploaded to our backend system, Google Firebase, by the Raspberry Pi 3, and is accessible through any device integrated with the Alexa Voice Service.
Objectives & Introduction
The objective of this project is to be able to monitor a network of SJ-One Boards for statistical data that is accessible via voice commands acknowledged by the Alexa Voice Service.
Tasks
- Create FreeRTOS tasks to monitor sensor data, pin dat, and OS statistics on the SJ-One Board
- Create a task that parses sensor data into Javascript Object Notation (json) and utilizes the Xbee Wire Antenna to wirelessly transmit it via the UART protocol
- Create a python script for the Raspberry Pi 3 that parses data received by the Xbee Wire Antenna and relays it to Firebase
- Create an Alexa Skill that can answer user queries by accessing data in the Firebase Real-time Database.
Team Members & Responsibilities
- SJ-One Board Firmware Design
- Hardware Connectivity Design
- Firmware and Hardware System Testing
- Raspberry Pi 3 Firmware Design
- Amazon Alexa Voice Service Skill Design
- Firmware and Voice Service System Testing
Schedule
Week | Begin Task | Task Description | Result | Planned Completion | Actual Completion |
---|---|---|---|---|---|
1 | |
|
|
|
|
2 | |
|
|
|
|
3 | |
|
|
|
|
4 | |
|
|
|
|
5 | |
|
|
|
|
6 | |
|
|
|
|
7 | |
|
|
|
|
8 | |
|
|
|
|
9 | |
|
|
|
|
10 | |
|
|
|
|
Parts List & Cost
Part | Quantity | Price | Merchant |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Design & Implementation
Hardware Design
Discuss your hardware design here. Show detailed schematics, and the interface here.
Xbee Wire Antenna Module
The Digi XCTU software was used to configure the Xbee Wire Antenna modules. The module that is placed on the SJ-One Board is setup as a transmitter while the module connected to the Raspberry Pi 3 via the Xbee Explorer Dongle is setup as a receiver. The SJ-One Board sends data to the Raspberry Pi 3 via UART3 protocol, and the Raspberry Pi 3 parses this data upon receiving it.
Hardware Interface
In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.
Software Design
Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.
SJ-One Board Monitoring Task
For this task, three tasks were implemented to gather data from the operating system, sensors, and pins of the SJ-One Board. The operating system task calculates the CPU usage of each running task in the system along with the amount of global memory used, allocated memory used, allocated memory available, and memory available on the system. The sensor task reads data from the temperature sensor, light sensor, and accelerometer on the board. The pin task checks if any of the on-board switches are being used or not. These three tasks then send all the data collected to a fourth task which is the consumer. The consumer receives the data, stores it in three separate queues, and initializes the UART3 protocol on the board to prepare transmitting data to the Raspberry Pi 3 via the Xbee Wire Antenna module.
Raspberry Pi json parsing and Firebase Upload
Amazon Alexa Skill
Implementation
This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.
Testing & Technical Challenges
Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.
Include sub-sections that list out a problem and solution, such as:
SJ-One Board Monitoring Task Issues
While implementing the monitoring driver for the SJ-One Board, the queues that transmitted data to the consumer task were not functioning properly. Every compile run would net an issue with the queue.h header file that caused some confusion. To fix this issue, each section of the code was checked to see what section was creating the compile issues. It was discovered that our queues were sending the wrong data types to the consumer. Once the data types were modified to the proper characteristic of each queue, the issue was resolved.
While implementing the Xbee task within the consumer task, establishing the connection between the Xbee Wire Antenna on the SJ-One Board with the Xbee Wire Antenna on the Raspberry Pi 3 was troublesome. The first test was to see if data could be sent to the SJ-One Board from the Xbee Wire Antenna connected to the Digi XCTU software. The gets() function from the char_dev.hpp header file was implemented to see if data could be received and shown in Hercules. This function could not parse and display the test data sent as needed, so the next function implemented was the getChar function from the char_dev.hpp header file. This function allowed data transmission to instantly be seen in Hercules as it was being typed in the XCTU console which solved our receiving issue. Once this was complete, the second test ran was to send data out from the SJ-One Board. Using the putline() function, test data was sent to the XCTU console, the software successfully received it on the first try, and our sending and receiving issues were resolved.
Conclusion
Designing this project is a great way to learn about the functionality of the SJ-One Board, Raspberry Pi 3, Xbee Wire Antenna, Google Firebase, and Amazon Alexa. Throughout testing, it was deduced that more time should be spent on debugging the project since the amount of time that was allocated for it was insufficient. If we were to recreate this project, we would expand the project's functionality to include the detection of the communication buses actively being used on the SJ-One Board. The Micro Watch Monitoring System is now fully functional and ready to be deployed to the future CMPE 146 classes!