1 Project UCI Stormcraft Sponsor: Shorbagy Mohamed Daniel Stoll, Abhijith Jose, Charles (Kolt) Stark MAE 189: Capstone Design University of California, Irvine Professor Mark Walter and Professor David Copp 11/10/2023 2 Table of Contents Executive Summary.....................................................................................................................4 Chapter 1: Project Definition...................................................................................................... 6 Primary Research:................................................................................................................... 6 Problem Definition:.................................................................................................................. 7 Design Attributes table:......................................................................................................7 High-Level Work Breakdown Structure (WBS):................................................................. 8 Gantt Chart:....................................................................................................................... 9 Wiring Diagram:................................................................................................................. 9 Chapter 2: Conceptual/Preliminary Design.............................................................................10 Internal Subsystem................................................................................................................ 10 Communication Protocols:............................................................................................... 10 Microcontroller:.................................................................................................................11 Battery..............................................................................................................................11 Frame Subsystem..................................................................................................................12 Frame Design:................................................................................................................. 12 Anemometer:................................................................................................................... 13 Summary of Preliminary Design............................................................................................ 16 Description of Design:......................................................................................................16 SWOT Analysis:.....................................................................................................................21 Cost Estimates:......................................................................................................................21 Chapter 3: Critical Design/Analysis......................................................................................... 22 Detailed Engineering Analysis and Component Testing........................................................ 22 I2C Communication......................................................................................................... 27 Bluetooth Low-Energy......................................................................................................28 Pin Input Capture............................................................................................................. 29 Functional Architecture.................................................................................................... 30 Prototype Plan....................................................................................................................... 32 Validation Plan................................................................................................................. 32 Chapter 4: Prototype Performance and Final Design ....................................................... 34 Description of Final Design....................................................................................................34 Re-design.........................................................................................................................34 Electrical Component Assembly...................................................................................... 35 Prototype Verification.............................................................................................................37 Temperature and Humidity Requirements Verification.....................................................37 Temperature and Humidity Calibration.............................................................................37 Wind Speed Calibration................................................................................................... 38 Wind Direction Calibration............................................................................................... 39 Bluetooth Range Verification............................................................................................40 Chapter 5: Design Recommendations and Conclusions ...................................................42 3 Accomplishments Summary............................................................................................ 42 Design Recommendations For the Future....................................................................... 42 Lessons Learned............................................................................................................. 43 Conclusion....................................................................................................................... 43 References................................................................................................................................. 44 4 Executive Summary In this new age of technology, information is superfluous and easy to access. Information and data acquisition has only gotten faster and easier for the average person, though that is not to say that it is idealized for each person and for each specific situation. Access to widely available weather data surely may help people with their general needs such as knowing what temperature it is outside to know what to wear, knowing the humidity outside for sensitive gardening needs, or even knowing the wind speed to prepare for unsafe driving conditions. Even though severe conditions for any of these cases will clearly be communicated to people on a need-to-know basis from the government, this is still a market for very localized data from weather stations that will give precise measurements for each person in their exact location. Something like this will also prove valuable to those who want to have data that they can control instead of relying on an over-the-air source that can have delays or consistent connections. A weather station would need to integrate various sensors; temperature, humidity, and barometric pressure sensors operate by altering the electrical current through the device based on changing atmospheric conditions. We aim to design a weather station that should be able to be battery operated, have data wirelessly transmitted, be compact, and have real-time updates. Requirements include an operational humidity range between 20%-80%, a temperature range up to 110F, data updates at least every 30 seconds, and the ability to transmit information at least 150 feet. Photo of Assembled Weather Station 5 We made the following design decisions to achieve these goals. For the internal subsystem, we chose to do a communication protocol of Bluetooth Low Energy due to simplicity, and mobile phone compatibility; for a microcontroller, we chose the STM32 for its documentation, and more importantly, the coder’s familiarity with the software. These solutions to the design allowed us to be able to connect all the sensors that we need and be able to wirelessly send the meteorological data over Bluetooth to a mobile phone. For the frame and chassis subsystem, the two popular designs for current solutions for weather stations included a stacked design, where the sensors are directly on top of one another, or a separated design, where the sensors are separated from the middle of the chassis with arms. We ended up using a hybrid design of both of these, due to ease of manufacturing, and compactness, both important considerations for the weather station. Also, another design consideration was the method in which a wind sensor would be implemented into the design, in which many different ways are often used in other weather stations. We ended up using a cup anemometer design due to its durability, ease of manufacturing, and cost. Finally, the mounting system was considered, which was important as a weather station needs to be versatile in where it can be placed so that it can get the specific meteorological data that the user needs. We ended up deciding on a universal U-mounting pole due to its efficient use of space despite its versatility, cheap cost, and resistance against obstacles, such as wind. The results and verifications that we observed us to fulfill these constraints. The weather station that was made was able to accomplish almost all of the goals that we set out to do. The goal was to create a localized weather station that could measure the temperature, humidity, wind speed, and wind direction. We set physical constraints on the capabilities of this weather station and we were able to match all these goals. These requirements include the ability to sense temperature up to 44°C; the weather station’s sensors were able to measure up to 50°C. Another requirement was for it to detect humidity up to 80% in a given space, in which the weather station was able to detect up to 85%. A requirement of information update at least every 30 seconds and a max wireless data transmission range of 150 feet from the microcontroller unit to the data receiver was also important to the project. These requirements were fulfilled by the ability of the microcontroller being able to transmit data once every second and having an RSSI of -89.45 at 150 feet. Also, a size constraint that was set for the station was for it to fit within the space of 1’ x 2’ x 3’; the dimensions of the weather station were 9.5” x 15.5” x 29.5”. Lastly, the weather station should be able to withstand typical winds in the Orange County region, which was 30 mph. Using the simulations that were shown above, the design was made to withstand these wind speeds fairly easily. Though our three main needs of wireless data transmission, compactness, and real-time updates were met, the wireless aspect could be improved as we were not able to make the battery-powered circuits within the time limits given to us. This leads us to some improvements we can make in the future. 6 Chapter 1: Project Definition Primary Research: Weather stations offer the advantage of gathering real-time meteorological data, providing valuable insights into local atmospheric conditions. Current solutions on the market were typically equipped to measure temperature, humidity, barometric pressure, and wind conditions. This information is a valuable asset for various applications from research and agriculture to an end user simply planning their day’s activities. Figure 1: Typical components of a Weather Station (Sungeeta, n.d.) To deliver this data, a weather station would need to integrate a variety of sensors. Temperature, humidity, and barometric pressure sensors operate by altering the electrical current through the device based on changing atmospheric conditions. Some technologies include principles of capacitance, resistance, thermal conductivity and optics. Moreover, “cup-design” anemometers are frequently used to measure wind speed while wind vanes determine wind direction. These particular sensors will be discussed in more detail in Chapter 2. 7 Problem Statement: While there is weather data for general areas widely available for most people in urban areas, weather stations such as this help provide very localized data to your specific area. It also cuts out the intermediary step of separate off-site data sites that can be affected by area signal strength and geological inconsistencies at finer scales. Personalized weather stations such as this allow for accurate weather data within the closest possible range, and in real-time without relying on external sources of bottlenecks or outages in the surrounding network or power. Weather stations provide useful data for those that require very precise and quick updates of meteorological data such as gardens that are extra sensitive to humidity changes, underwater fish tanks that are sensitive to changes in temperature etc. Problem Definition: We need to read localized weather data including: temperature, humidity, barometric pressure, wind speed and direction and transmit that information wirelessly. We will design and build a weather station that is battery-operated and can operate within typical Orange County weather conditions. The weather station needs to be battery-operated, have data wirelessly transmitted, be compact and have real-time updates. Requirements include an operational humidity range between 20%-80%, a temperature range up to 110F, data updates at least every 30 seconds, must transmit information at least 150 feet, and it must last 7 days on a single charge. Design Attributes table: Table 1 : Design Attributes Table 8 High-Level Work Breakdown Structure (WBS): 1. Problem definition (All) a. Formalize Problem Statement b. Determine Stakeholder Needs and Requirements c. List design attributes and constraints 2. Solution (All team members) a. Research solutions to specific subsystem b. Compare and contrast available solutions c. Generate prototype concept 3. Conceptual Design a. Internal Subsystem (Daniel Stoll) i. Research and compare communication protocols ii. Develop high-level wiring diagram iii. Select appropriate MCU b. Frame Subsystem (Abhijith Jose) i. Research different methods of wind speed and direction recording ii. Modeling possible physical wire routing iii. Ease of manufacturing and assembly-driven design c. Mounting Subsystem (Charles (Kolt) Stark) i. Research existing solutions of mounting methods for weather stations ii. Compare the advantages and disadvantages of different concepts iii. Potential for placement on multiple angles or surfaces driven design 4. Prototype a. Firmware and Data communication (Daniel Stoll) i. Develop drivers for each sensor ii. Organize and process appropriate data iii. Transmit information wirelessly to client iv. Ensure appropriate voltage levels for each component b. Manufacturing and Assembly (Abhijith Jose / Charles (Kolt) Stark) i. Buying off-the-shelf parts ii. 3D modeling CAD models and tolerancing iii. 3D printing and manual manufacturing iv. Solid model simulation testing for c. Stress Testing (Abhijith Jose) i. Wind vane directions testing ii. High-velocity wind speed testing iii. Drop/durability testing iv. Clamp strength testing d. Sensor Validation (Daniel Stoll) i. Ensure functional system integration ii. Test sensor accuracy iii. Debug developed code 9 Gantt Chart: Figure 2 : Gantt Chart Wiring Diagram: Figure 3 : Wiring diagram 10 Chapter 2: Conceptual/Preliminary Design Internal Subsystem Communication Protocols: Among wireless communication protocols for Internet of Things (IoT) solutions, Long Range (LoRa) , Zigbee, and Bluetooth Low-Energy (BLE) are the most common. LoRa stands out for its long range capabilities, extending its functional range over several kilometers. It achieves this in part by operating at much lower frequencies than the other two at the cost of requiring more specialized hardware. Both Zigbee and BLE operate on the 2.4GHz ISM band like other protocols such as wifi. This offers the advantage of cross compatibility, since a device only needs to include a single antenna for a wide range of functionality. All three protocols are optimized for low power consumption and as a result, suffer from limited bandwidth. Table 2: Communication protocols compared When comparing the protocols, all three provided adequate range for our purposes, effectively eliminating LoRa from consideration. BLE and Zigbee are similar in many aspects but BLE is a much more ubiquitous protocol and can be found in many consumer products, including many smartphones. This native compatibility along with lower cost and complexity made it the ideal candidate for our design. 11 Microcontroller: Table 3: Microcontrollers compared There are countless microcontrollers from many different manufacturers that would serve our needs. However, we narrowed our search to three candidates due to a combination of cost, accessibility, and familiarity. The arduino platform provides a beginner friendly experience which sacrifices hardware efficiency. Another candidate, the ESP-32 offers a wealth of features at an affordable price, but its lack of power efficiency and personal familiarity made it a less than ideal solution. Finally, STMicroelectronics’ STM32 Nucleo board provided many advanced features, power efficiency, and excellent documentation. Based on this criteria, we decided to proceed with this platform. Battery The stm32-Nucleo board provides two dedicated oscillators for use as the system clock source; the HSI and HSE. The HSI is an oscillator embedded within the MCU itself and is the default clock source upon reset. However, clock accuracy degrades with increasing temperature unlike the HSE which is a dedicated oscillator independent of the MCU. According to the datasheet, the board draws 72mA of current at maximum frequency and all peripherals enabled when using the external oscillator (HSE) as the system clock source 1. With this information, we can calculate the required battery capacity to ensure a 7 day operational period. Capacity = Imax x 168 hr = 12,096 mAh 1 STMicroelectronics, “DS10693 Rev 10”, STM32F446xC/E, 2021 12 Frame Subsystem Frame Design: Table 4: Frame Designs compared Weather stations tend to come in many different shapes and sizes, but the following two shapes were the ones that had the most benefits that were used by most weather stations. The frist design is one where there sensors are stacked on top of each other, and the second design in which the sensors are mounted off centered coming off a pole, held together by an arm for each sensor. From the decision matrix, it is found the stacked design was not as easy to manufacture as it requires some unconventional means of assembly to make sure wires do not get tangled. This, though, is outweighed by the lower cost for the lower amount of material needed for the stacked design, and that it fits the design constraints of being smaller, better. 13 Anemometer: Table 5: Anemometer Designs compared An anemometer is a device that measures wind speed and direction. It is a common instrument used in weather stations. There tends to be 3 different ways to make a sensor that senses wind speed: a cup design, a vane design, and a hot-wire design. These 3 tend to be the most common forms of wind speed sensing in the industry. Using the design matrix, it is found that the vane design tends to be the most durable since it is protected by an outer plastic layer, as opposed to the hot wire which has an extremely sensitive end that is not suited for outdoor use. Manufacturing, though, is simpler on the cup design, since it will have to be made from scratch for our design (explained later in the Preliminary Design Summary) Accuracy is be the best on the Hot Wire design since its commercial/lab applications, whereas the vane design is completely dependent on the direction of wind, thus making it practically useless. Though it may not be the most compact, the previous considerations, including the very low cost, make the cup design the best one to use for this weather station. 14 Mounting Subsystem According to a personal weather station siting guide from weather.gov, the placement and method of mounting a weather station is crucial to the accuracy of its sensors and the readings it displays (“Personal Weather Station -Siting.” Available: https://www.weather.gov/media/epz/mesonet/CWOP-Siting.pdf). Mounting Mechanism Design: Table 6: Mounting Mechanism Existing Solutions Design Matrix The method chosen for mounting our weather station was not only determined through the design requirements to be able to withstand forces like wind speed and weight capacity, but it was also impacted by our ability to redesign (or improve upon) already existing solutions and manufacture them within the allotted time. While originally considering redesigning a tripod to create a universal mounting mechanism, the time, materials and manufacturing tools needed to create it within the scope of the project would prove too difficult to have a functioning prototype before the scheduled deadline. After revisiting the problem definition and adjusting the design constraints, a bracket mount was agreed upon to mount the weather station as it still allows us to pursue the objective of creating a more portable and adjustable weather station. 15 Bracket Mount: Table 7: Bracket Mount Decision Matrix The bracket mount concept for mounting our weather station was largely determined by our design objective to have the station be capable of being placed on multiple surfaces or angles in case of the need for relocation. When considering which bracket mount would be used in our final design, we also wanted to account for the potential of screws failing by the threads becoming stripped as a result of continual vibrations generated by wind forces. Our group leaned toward, and decided on, using a universal mounting pole bracket as it most closely followed our design objectives and met our design constraints. 16 Figure 4 (left): sketches of bracket mount and dimensions; Figure 5 (Right): potential for bracket mount at different angles and on different surfaces (https://www.newegg.com/p/16R-06F4-00055?item=9SIBJPFK5H5714&source=region) Summary of Preliminary Design Description of Design: The following concepts are the best choices for the preliminary design. For the internal subsystem, the Bluetooth low Energy for the communication protocol, and the STM32 for the microcontroller. For the Frame subsystem, the stacked frame design for the assembly, the cup design for the anemometer design. Other things are likely a given since there are not many variations on how they are designed for existing solutions, such as wind vane design or temperature/pressure sensor holders. The following design was made using some estimated dimensions of possible sensor choices for all the data objectives we had, with a large emphasis on the anemometer design, and the interface connection to the wind vane. 17 Figure 6: Preliminary design Overview The Figure above shows an overview of the general structure for the weather station. Bear in mind that since it is a preliminary design, not all parts are modeled one-to-one, neither is every part shaped exactly right. This model shows where most of the sensors and subsystems will be in place and how they will interact with each other. Starting from the bottom, shows a placeholder yellow box for the clamp, (since it requires very little necessary modeling for an off the shelf part) connected to the orange frame base that holds the microcontroller. Above that, is the 3D printed housing for the humidity, temperature, and pressure sensors, which may possibly be tweaked for better data transmission. 18 Figure 7: Detailed look on anemometer design The figure above shows a detailed view on how the anemometer will work. The cup design choice, the large gray piece shown, will be a fully 3D printed part. The reason why this design does ot allow for an off the shelf anemometer is because of the stacked frame design that was selected. Since the sensors need to be placed on top of each other, the sensors must be on top of each, but not interfere with each other as they both revolve. If the anemometer has one cable going down to the microcontroller, there would be no way to have a cable from the wind vane on top, down to the microcontroller, all the spinning cups will be tangled on the wires. Thus, the system of a central column with wires running from inside the middle, which will be explained in more detail in the next subsection. For the Anemometer itself, a hall sensor will be used, mounted on the purple sensor housing, and a cable on the inside going to the microcontroller. The cups will be printed with a hollow core that will be secured to a rotary ball bearing (light blue), which is connected to a steel central column (dark blue). The wind speed will be determined by the amount of the times, the pink magnet, mounted underneath the cups, which will trigger the hall sensors every time a revolution has been made, being able to change rpm to a tangential wind speed. 19 Figure 8: A Detailed look on wind vane design The figure above shows a detailed view of the design for the wind vane and the centralized design discussed in the last section. In this case, a steel housing that interacts only slightly smaller for the inner diameter of the bearing, so that attachments can be fairly simple. As the hall sensor cables can be routed down towards the microcontroller, the wind vane sensor requires cables that go through the anemometer through the central column. After it goes up the column, it interacts with the printed connecting housing, which holds up the rotary connector. This is very important as the sensors being used to find angle direction will be placed on the data collector, which turns. To make sure that the cables do not twist on each other and break, a rotary connector is used to interface to the magnetometer. 20 Figure 9: Preliminary dimensions for design 21 SWOT Analysis: Figure 10: SWOT Analysis Chart Cost Estimates: Table 8: Preliminary Bill of Materials (Link) 22 Chapter 3: Critical Design/Analysis Detailed Engineering Analysis and Component Testing Final Design Overview Figure 10: Updated Final Chassis Design Our team’s chassis design was originally designed based off of stacked weather station designs where the individual sensors were stacked on top of each other. However, we revisited our design constraints and decided to base our design off of a hybrid stacked and separated concept, where the premise of holding all of the sensors on one rod remained the same, but the individual components were kept separated on the same arm. We came to this decision after realizing that we were unable to integrate store bought sensors into the stacked design. This allowed us to still keep everything centralized to the same mounting mechanism and stacked everything together except the wind vane and anemometer. 23 Table 9: Updated Frame Design Matrix As previously stated, the frame subsystem was drastically changed for the new current iteration. This mishap of the previous iteration came from not considering the importance of the time to manufacture. As shown at the bottom of Table 9, a key decision of time to manufacture was weighted and added, which gave us the result that the hybrid design, where some parts are stacked and other parts are put on arms, was the best design moving forward. Table 10: Detailed BOM 24 Table 10: Detailed BOM The MCU housing (in green), the MCU cap (in red), and the pipe mounting bracket (in red) were all modeled in SolidWorks. Once all of the design decisions were finalized for the stacked design portion of the weather station, the MCU was printed at FABworks. The assembly lead put together the microcontroller and sensor wiring, the MCU, radiation shield, screws, and the anemometer and wind vane. Sensors The weather station that was being built had the requirements to be able to measure temperature, humidity, wind speed, and wind direction. These all required seperate sensors to be mounted onto the chassis, but each sensor requires its own chassis design to be able to have the most accurate readings. Wind speed: The wind speed sensor, or the anemometer, is a drastic change from the initial design iteration of the midterm report. As described earlier, we decided to go with an 25 off-the-shelf anemometer, to not only simplify the design and manufacturing, but also make sure that it is properly calibrated from the factory and operational within the time limit given. Wind direction: The wind direction sensor was also an off-the-shelf product that was bought to make sure that we had a properly calibrated sensor, as opposed to manufacturing it from scratch and saving time at the same time. The design to use off-the-shelf products also allowed for the consistency in measurement data, if future iterations of the weather station were built. Both of the wind speed and wind direction sensors with screw/nut mounted onto the wooden plank. Temperature/Humidity: The sensors to sense temperature and humidity were very tiny sensors that were wired up the microcontroller. Though there was no impact on the measurement validity of the humidity sensor depending on where it was placed on the weather station, this did apply to the temperature sensor. As direct sunlight can cause the temperature sensors to drastically fluctuate based on the time of the day on the way that the weather station is oriented towards the sun. To make sure that the weather station will read consistent temperature no matter the orientation, we designed the radiation shield, as shown in Figure X, to protect the temperature from direct sun rays. 2 bowls were used, held by nuts and washers, to be a small distance apart, to allow for enough airflow into the temperature sensor so it can measure accurately. Chassis Figure 12: Photo of Assembled Weather Station 26 MCU Housing: The generally micro controller housing unit, the green cylindrical object shown in Figure X. The housing was made completely entirely through 3D printing. It is also the base in which the entire weather station runs through. To create this design for the weather station, we decided to design a way for it to be held up entirely through thread rods that run through the entire chassis. We were able either print three holes or drill the holes accurately throughout all the chassis parts, and run rods that hold everything together by nuts to stabilize the entire weather station. Cap & Bracket Mount: A concern that the team faced in finishing the assembled prototype was finding a solution for how the weather station would be mounted to the metal pipe that came with the universal mounting bracket. After some discussion, we agreed that a type of cap that would cover and hold onto the MCU would be necessary. The design lead created a 3D model of the cap, which would be friction-fitted to the MCU and would also have enough room for the metal pipe to comfortably hold onto the chassis without potentially damaging the electrical components. The design lead also created a set of brackets that would hold onto the metal pipe in order to hold the chassis higher on the pipe as well as to prevent the pipe from pushing up on the electrical components. Figure 13: Cross-section view of cap to microcontroller housing unit 27 Figure 14: Part of the set of pipe brackets for the metal pipe Figure 15: MCU Cap and Pipe Bracket Subassembly 28 After the MCU Cap and pipe brackets were 3D printed, we friction-fitted the cap to the MCU and used some electrical tape, in addition to nuts and screws to help increase the friction of the pipe bracket’s hold on the metal pipe. We also screwed the pipe bracket into the MCU Cap to ensure that the pipe bracket would not rotate or be loosened. Some other design changes of note include using a wood plank instead of a 3D printed piece to hold the anemometer and wind vane, in addition to not being able to integrate a battery within the final prototype design. We used a wood plank because there were fabrication errors with the 3D printing process, and so we ran out of time to reprint it correctly. We were unable to integrate a battery also because of time, where we incorrectly calculated the amount of space in the MCU holder and were at a stage in the design process where a battery was not necessary for the functionality of the prototype testing. I2C Communication The Inter-Integrated Circuit Protocol (I2C) is a multi-master, multi-slave protocol that is commonly used in inter-device communication. It exchanges data via half-duplex wiring, utilizing one line for bidirectional data transmission while a dedicated clock line ensures timing compliance. Compared to alternative serial transmission protocols such as UART, SPI, or USB, the I2C master device can distinguish between connected devices using a unique address, allowing multiple slave devices to be connected to the same bus. To interface with the humidity and temperature sensor, an I2C connection was established when the slave address (0x40 in hexadecimal) was sent to the slave device followed by a write bit. After the successful transmission of each byte, the slave sends an “Ack” bit, acknowledging the request. The master then sends the 0xE3 command to request a temperature measurement. A read request is initiated to the slave address and a raw 2-byte temperature reading is returned. After the raw reading is converted to an integer, the final temperature value is calculated using the formula given in Figure 11. 29 Figure 16: I2C Communication Bluetooth Low-Energy Bluetooth Low-Energy is a wireless communication technology that debuted with the Bluetooth v4.0. At the core of the BLE protocol is the Generic Attribute Protocol or GATT, which defines a hierarchy for organizing the data as it is shared across devices. GATT operates on a client-server model where data is stored in attributes which can be read, written to by the client. The hierarchical structure of GATT is organized into three main components: Services, Characteristics and Descriptors. Each service contains characteristics which represent specific pieces of data or functionalities. In our case, the GATT profile contains two services which hold two characteristics each as shown in Figure 17. The weather service (a) contains the humidity and temperature data while the wind service contains the wind speed and direction. When a characteristic is selected, the user can choose to read or be notified of the given data at intervals specified in the software. 30 Figure 17: Bluetooth GATT profile Despite its high energy efficiency, BLE is capable of a respectable range of around 300 feet. However, in real world scenarios where obstacles are present, the effective range may be considerably less. For our purposes, we require data to be successfully transmitted up to 150 feet which would satisfy the vast majority of residential applications. Pin Input Capture Our chosen anemometer contains an optical sensor that outputs 20 5V pulses per shaft revolution. Since the pins of STM-32 Nucleo board are only 3.3 V compliant, a 100β¦ and 220β¦ resistor were used to divide the voltage to acceptable levels. Once the microcontroller receives the signal from the anemometer, a timer in input capture mode measures the time period between the rising edge of each signal as demonstrated in Figure 17. The final wind speed is then calculated using the following formula: π€πππ π ππππ = 1.7 * πΆππ’ππ‘ππ_π£πππ’π 20 * πππππ_πππππ’ππππ¦ Figure 18: Pin Input Capture Functional Architecture Since our weather station needs to measure 4 distinct values, we need to process the captured data and convert it into standard units in a process outlined in Figure 18. First, the raw temperature and humidity readings are captured from the Adafruit si7021 temperature and humidity sensor. They are converted to 16-bit integers to allow arithmetic to be performed. To 31 convert the raw readings to Celsius and % Relative Humidity respectively, we use the following formulas: 125×π»π’π. π ππππππ 65536 175.72×ππππ. π ππππππ − 65536 %π ππππ‘ππ£π π»π’πππππ‘π¦ = π·ππππππ πΆπππ ππ’π = − 6 (Silicon Labs, 2022) 46. 85 (Silicon Labs, 2022) To measure the wind direction, the analog output of the wind vane was converted to digital values from 0 to 4096, depending on the position of the needle. For example, 0 degrees relates to a 0 reading whereas a 2048 reading relates to an angle of 180 degrees. The following formula was used to convert captured values to angular degrees. π΄πππ’πππ π·ππππππ = π΄ππππ π ππππππ 4096 × 360 Finally, the wind speed is measured using pin input captures and converted to linear speed in the process outlined in the last section. These values are then transmitted to client devices via BLE Figure 19: Functional Architecture 32 Prototype Plan Validation Plan We will validate the accuracy and functionality of our sensors to ensure compliance with the design requirements. For the temperature and humidity sensor, we require an operational range of up to 45° Celsius and 80% relative humidity. These extreme conditions will be recreated using a hair dryer on heating mode to reach high temperatures and a sauna for high humidity conditions. We will also test the received signal strength index (RSSI) at a distance of 50 and 150 feet. Once the sensors are shown to operate in our desired conditions, their accuracy will be verified using various reference measurements. The wind direction sensor will be validated by sweeping the sensor over a certain reference angle, say 90°, and the measured value will be compared. Once the prototype is assembled, the anemometer will be tested by placing it atop a car moving at a predetermined speed to verify its accuracy. The temperature sensor will be plunged into an ice-water bath to create a reference temperature of 0 degrees Celsius. Next, the humidity sensor will be compared to an off-the-shelf humidity meter to ensure proper calibration. Finally, the BLE effective range will be tested in an open area at 50 and 150 feet, while documenting the change in received signal strength index (RSSI). Design Verification For the verification of our design, we decided to perform a stress test and perform a bending moment calculation on the bracket mount under the wind pressure from wind speeds of 30 mph, as it will be holding the weight of the weather station. The design lead created a mach replica of the solid model assembly with each component of the chassis being substituted with a 33 rectangular prism that covers the maximum surface area possible for each one. The force of wind exerted on each surface was done with the formula πΉπ = 1 2 2 * πΆπ * ρ * π΄ * π . The surface area was converted from mm2 to in2, the density of air in english units is 4.67 × 10^5 lb/in³, the wind speed was converted from 30 mph to 528 in/sec, and we assumed that the rectangles were considered flat plates so the drag coefficient for a flat plate is 1.05. Since our units were in english, we had to convert the resulting value from the force of wind formula to newtons. 1 Newton is approximately 7.23 lb-ft/s2, so we converted that into lb-in/s2 by multiplying by 12, which equates to 1 Newton being approximately 86.8 lb-in/s2. The value of the wind force equation would be divided by 86.8 to get our force of wind in newtons to more easily understand the SolidWorks simulation testing. An example calculation would be: 2 5 2 2 2 π΄ (π π’πππππ ππππ) = 23. 2 ππ ; πΉπ = 0. 5 * 1. 05 * 4. 67 π₯ 10 [(ππ * ππ)/π ] * 23. 2 [ππ ] * 528 [ππ/π ] 2 πΉπ = 158. 4 [(ππ * ππ)/π ]; 158. 4 / 86. 8 = πΉπ = 1. 83 π Area (in2) Fd (lb-in/s2) Fd (N) 23.2 11.4 12.8 11.4 2.12 0.324 28.4 19.8 14.3 22.7 15.0 158.0 77.9 87.4 77.9 14.5 2.21 194.0 135.0 97.4 155.0 102.0 1.83 0.898 1.01 0.898 0.167 0.0255 2.24 1.56 1.12 1.79 1.18 34 Figure 20: Chassis Assembly Block Layout For Simulation 35 Figure 21: Stress Test Performed With Applied Forces Our stress test analysis of the chassis under 30 mph wind speeds resulted in a maximum stress of 4.295e+01 N/mm2 (MPa) of stress. According to SolidWorks the aluminum 3003 alloy applied to the bracket mount has a yield strength of approximately 4.136e+01 N/mm2 (MPa), so under these types of wind speeds our design may cause some deformation in the bracket mount. Chapter 4: Prototype Performance and Final Design Description of Final Design Re-design Nothing on the chassis, or sensor usage has changed from what was previously presented in Chapter 3. Thus the re-design, drawings, BOM, and cost analysis of these parts stay the same. The first redesign was explained earlier, which was made right after the midterm report submission. 36 Electrical Component Assembly First, the si7021 temperature and humidity sensor was soldered to a daughter board and the power, ground, SDA, and SCL lines were connected to the microcontroller. The lines of the wind speed meter were also soldered to this board along with the voltage divider. (Figure 22) After ensuring secure connections, the daughter board was placed under the blue radiation shield with cables running downward to the microcontroller. Once the daughterboard was in place, the microcontroller was fitted into the green housing and any loose cables were secured with zip ties. The wind direction and speed sensor were mounted to their respective sections and the cables were fed through the provided holes in the radiation shield. (Figures 24) Figure 22: Daughterboard 37 Figure 23: MCU in its housing Figure 24: Wind Direction and Speed sensors 38 Prototype Verification Temperature and Humidity Requirements Verification Per our design requirements, we needed to verify that our sensor measured temperature up to 44 degrees Celsius and up to 80% Relative Humidity. To recreate extreme heat, a blow dryer with heating functionality was directed at the sensor. Over a period of 80 seconds, the readings rose from 27β to 49β (Figure 24) , demonstrating an appropriate temperature range. To verify the appropriate humidity range, we placed the sensor in a bathroom and ran a hot shower. Over a period of 120 seconds, the % relative humidity rose from 67% to 85%, easily exceeding our requirement of 80%. Figure 25: Temperature and Humidity Verification Temperature and Humidity Calibration Once we demonstrated the appropriate measuring range of the temperature and humidity sensor, we needed to verify its accuracy. An ice bath was prepared to create a reference temperature of 0β and the sensor was carefully wrapped in tin foil. This kept the water from damaging the sensor and provided a conductive medium for the sensor to interact with the ice bath. Once the temperature readings stabilized, 20 measurements were taken, yielding an average of .05β and a maximum error of +0.4 β (Figure 26), matching the published accuracy of ± 0. 4β. (Adafruit Si7021 Temperature & Humidity Sensor Breakout Board, n.d.) The humidity readings were compared to the reference values provided by an off the shelf humidity meter. The reference sensor provided a constant reading of 56% relative humidity. The adafruit Si7021 provided a higher resolution and yielded an average value of 56.04% and a maximum error of +0.5%. 39 Figure 26: Temperature and Humidity Calibration Wind Speed Calibration We designed a wind speed testing methodology by placing the weather station atop a car and moving at a constant speed of 14 m/s. Readings were taken every 0.25 seconds for a duration of 5 seconds. 3 trials were performed with means of 13.62 m/s, 15.33 m/s, and 13.19 m/s respectively. However, there are potential drawbacks with this method since existing wind patterns were not taken into account which could introduce significant variations in our result. Factors such as turbulence generated by the vehicle's structure could affect the readings as well. A more rigorous approach, such as a wind tunnel, would eliminate environmental variables to provide a more accurate calibration process. 40 Figure 27: Wind Speed Calibration Wind Direction Calibration Wind direction sensor accuracy was measured by rotating the needle at 2 different reference angles. 10 trials were performed at 90° and 180° and yielded average readings of 89.3° and 179.4° with a maximum error of ±5°, which exceeded the advertised accuracy of ±3°. For the purposes of transmitting cardinal directions (north, south, etc), this level of accuracy is generally acceptable. Figure 28: Direction Sensor Calibration 41 Bluetooth Range Verification Received Signal Strength Index (RSSI) is a metric used in wireless communication to quantify the power level of received radio signals, typically measured in decibels (db). Higher RSSI values generally correspond to stronger signals while lower values suggest weaker signals or a greater distance from the transmitter as illustrated in Figure 28. Figure 29: RSSI Guide The RSSI values were taken at 50 feet and 150 feet. The latter value represents the maximum distance that data would be expected to reach on a reasonably sized residential property. At 50 feet, the average RSSI was -65.3 decibels which represents an excellent signal strength. At 150 feet, the average RSSI was -89.5 which represents a fair signal, providing a more than acceptable signal for our low-bandwidth purposes. Figure 30: RSSI Verification Safety and Risk Assessment (Failure Mode and Effects Analysis) 42 Potential Failure Mode Severity of Failure (1-5) Effects of Failure Failure Causes Recommended Solution(s) or Action(s) Water From Rainfall Damaging Electrical Components 5 Electrical components would need replacing and chassis would need reassembled Water damage from rainfall placing electrical tape around wiring Damage to Temperature / Humidity Sensor From Heat 3 Weather station would transmit inaccurate temperature readings Heating of plastic bowls from sunlight could heat the temperature sensor to the point of damaging it Replace bowls with a more heat-resistant material Metal Pipe Sliding Up Into MCU And Potentially Damaging Electrical Components 4 Damaged electrical components would need replaced and chassis would need reassembled Friction fit of tape and bracket is weakened and can no longer hold onto metal pipe Protect wiring inside MCU with protective material Bracket Mount Failure 5 Potential destruction of chassis if mount failure results in weather station falling High wind speeds cause slight deformities in bracket mount A a stronger material instead of aluminum for the bracket mount Wood Plank Rotting 2 Weakening of wood could cause screws to become loose Exposure to the elements Replace with a different material Figure 31: Safety and Risk Assessment (Failure Mode and Effects Analysis) 43 Chapter 5: Design Recommendations and Conclusions Accomplishments Summary The weather station that was made was able to accomplish almost all of the goals that we set out to do. The goal was to create a localized weather station that could measure the temperature, humidity, wind speed, and wind direction. We set physical constraints on the capabilities of this weather station and we were able to match all these goals. These requirements include the ability to sense temperature up to 44°C; the weather station’s sensors were able to measure up to 50°C. Another requirement was for it to detect humidity up to 80% in a given space, in which the weather station was able to detect up to 85%. A requirement of information update at least every 30 seconds and a max wireless data transmission range of 150 feet from the microcontroller unit to the data receiver was also important to the project. These requirements were fulfilled by the ability of the microcontroller being able to transmit data once every second and having an RSSI of -89.45 at 150 feet. Also, a size constraint that was set for the station was for it to fit within the space of 1’ x 2’ x 3’; the dimensions of the weather station were 9.5” x 15.5” x 29.5”. Lastly, the weather station should be able to withstand typical winds in the Orange County region, which was able to withstand 30 mph. Using the simulations that were shown above, the design was made to withstand these wind speeds fairly easily. Though our three main needs of wireless data transmission, compactness, and real-time updates were met, the wireless aspect could be improved as we were not able to make the battery-powered circuits within the time limits given to us. This leads us to some improvements we can make in the future. Design Recommendations For the Future As previously mentioned, one important improvement that can be made is to make the weather station completely wireless. In its current form, it does not need to be fully tethered for it to work, but a “handshake” must be introduced by a computer on sensor measurement startup. In the future, we will make it so that it can be connected to a battery-powered bank, allowing it to start with only a power source, without an external user. Another future improvement to the wireless connection includes a WiFi connection to allow for an Internet of Things (IOT) integration for remote access of the weather station data, instead of relying on Bluetooth transmission. Providing a more user-friendly graphics user interface (GUI) will also be helpful as the current interaction can be confusing for some to clearly see the data that is transmitted in real-time. Mechanically, an improvement we could have not made was to eliminate the use of friction fitting joints from the assembly of the weather station. Friction fitting joints heavily rely on the precision of the machining, inconsistency in repeated assembly, and heavy wear on materials when disassembled and reassembled. Ideally, any use of friction fitting in the weather station, such as holding the MCU holder unit to the bracket holder cap, should be replaced with more secured housings. This can include using latches, screws and nuts etc. Lastly, an improvement that can be made to have a positive environmental impact would be the 44 introduction of solar energy to power the weather station. Though the design was made to accommodate any power source that we can feed through a USB connection, which is possible from solar powered sources already, a future iteration that accommodates this within the design to encourage more environmentally friendly power sources would be desirable. Lessons Learned This quarter has been very taxing for the entire team, in terms of workload and time. The project, though it seemed simple at first, became quite a daunting task, especially while juggling all other aspects of life at the same time. One important lesson that we learned was the importance of communication and teamwork. Many times throughout the project, we had miscommunications and disagreements that may have possibly slowed down the development of fast iterations of the design process. As the weeks progressed, not only did we learn to design and iterate better, but we learned to work as a team more. We found that communication over texts may not correctly describe our intentions and desires at the moment, and that in-person or online meetings where we can have conversations became the best way for us to progress as a team. Another important lesson that we learned was the importance of the time limit within a given project and how things should be placed accordingly. In the beginning of the project, we came up with a stacked design that incorporated a fully custom-made wind speed sensor, with a complicated housing design. We believed that this was the best design at the time as it had the best chassis shape that likely kept the most data integrity and was the most compact. If these things may be true, the time limit of the project would not have allowed us to create these things. Especially making an anemometer from scratch as it would require extensive tolerancing to make it properly calibrated to the standards that we are looking for. Realizing this earlier would have allowed us to move forward quicker and implement some more of the future recommendations that were explained above. Conclusion To conclude, this project was an incredible learning experience for us all. It allowed us to learn boat teamwork, design constraints, time limit constraints, manufacturing, tolerancing, calibration, to name a few. All these things have provided a great challenge to us as engineers that hopefully mimic what we will experience in our real jobs in the upcoming future as we move onto larger, more ambitious, large companies. This project allowed us to learn more about engineering with the hands-on experience of designing something digitally using proper key design justifications and realizing it's not physical form. The skills acquired this quarter will very much be used to propel us all forwards as prepared engineers in our respective fields in the future. 45 References Adafruit Si7021 Temperature & Humidity Sensor Breakout Board. (n.d.). Adafruit. Retrieved December 15, 2023, from https://www.adafruit.com/product/3251 Silicon Labs. (2022). Si7021-A20 [I2C HUMIDITY AND TEMPERATURE SENSOR]. Sungeeta, J. (n.d.). WEATHER STATION. Retrieved December 15, 2023, from http://atmos.washington.edu/k12/grayskies/weatherstation/index.html