Software
Software Implementation
Our software proposal outlines the steps for the program to effectively operate. It begins by initializing all sensors and drivers and establishing a secure connection with each of them. The program then monitors sensor values and compares them with predefined thresholds to determine the appropriate actions, including controlling the motors. By following these steps, our software will enable smooth and reliable operation of the system.
Check Appendix G - Software Proposal for more information

MPLABX Peripheral Overview
See the following figures for the peripherals and pin GPIO structure utilized in the MPLAB Code Configurator



Topic Table
Below is our table summarizing all the published and subscribed messages for our topic:
EGR314/Team205/Hall_Effect
| Field | Value 1 | Value 2 (optional) |
|---|---|---|
| Name | Hall_Raw_Pos | Wind_Speed |
| Description | Hall Effect Raw Position | Linear Velocity calculated by using Rotational Hall Effect Position and internal clock timer |
| Units | dec | m/s |
| Minimum | 0 | 0 |
| Maximum | 4096 | inf. |
| Type | uint16 | uint16 |
| Format string | %i | %5.5f |
| Unique identifier | h | hh |
Combined exampleh22047;hh00001.04375
EGR314/Team205/Temp_Sensor
| Field | Value 1 | Value 2 (optional) |
|---|---|---|
| Name | Temp_Read_F | Temp_Read_C |
| Description | Ambient Temperature In F | Ambient Temperature in C |
| Units | Fahrenheit | Celcius |
| Minimum | -104 | -40 |
| Maximum | 257 | 125 |
| Type | uint8 | uint8 |
| Format string | %u | %u |
| Unique identifier | t | tt |
Combined examplet77;tt25
EGR314/Team205/Motor_Controller
| Field | Value 1 | Value 2 (optional) |
|---|---|---|
| Name | Motor_Fault_Read | deploy_state |
| Description | fault values | deploy state of the motor(on/oof) |
| Units | bool | bool |
| Minimum | 0 | 0 |
| Maximum | 255 | 1 |
| Type | uint8 | bool |
| Format string | %u | %u |
| Unique identifier | m | mm |
Combined examplem00101001;mm1
EGR314/Team205/PIC
| Field | Value 1 | Value 2 (optional) |
|---|---|---|
| Name | Thresh_Value | CLK_TMR |
| Description | Internal Counter for Repeated Threshold Triggers. Important as to not activate motor system due to accidental outlier sensor readout. | Readout of internal Clock Timer |
| Units | int | sec |
| Minimum | 0 | 0 |
| Maximum | 5 (Non-Static) | inf. |
| Type | int | double |
| Format string | %u | %0.3f |
| Unique identifier | c | cc |
Combined examplec3;cc26.075
Feedback Controller Diagram
Below is our feedback controller diagram which outlines the simplistic software loop to actuate our motors based on measured sensor data

Future Software Design Changes
The current system uses an OLED screen for displaying data via bar charts. Adding additional user interface elements on top of our button, such as more complex read-only ESP32 commands, would allow the user for more interactivity and control.
The code performance can be optimized for smaller-scale embedded systems such as these which have minimal processing energy and memory. Utilizing simpler functions, algorithms, and smaller data types will reduce memory usage and optimize the overall hardware platform. Small changes such as declaring constant variables and reducing utilization of global variables will also create a better performance impact.
Given that our microcontroller only has 10kb of programmable memory, we could consider writing data to an onboard SD card if more peripherals and sensors were added to the system. With our current design, we were exceeding 90% capacity so external memory could be a valid option. The PIC Microcontrollers have slower processing speeds so utilizing interrupt service protocols (ISP) in our code algorithms will significantly improve performance and reduce the apparent lag of our single-threaded code capacity.