The system level block diagram shown above elaborates on the hardware components of the device controlled by the Arduino code. To create this device, an Arduino, distance sensor, water sensor, motor, Neopixel LED ring, alarm, and tubing was used. The water sensor, distance sensor, and Arduino were crucial components of this device. We decided that the water sensor was an appropriate sensor to use due to the system’s dependence on fluid levels. We also decided that the distance sensor was a better sensor to use than a motion sensor because it allowed us to create thresholds that were later used in the Arduino code. The motor and tubing was utilized to generate the movement of water flow to imitate the flow or urine. Lastly, the Neopixel LED ring was utilized instead of three separate LEDs that would light up to different colors to add to the overall display of the device and reduce the number of components within the device.
The distance sensor contains the trigPin as an output that generates ultrasound bursts based off the Arduino code. The distance sensor’s input is the echoPin that receives these reflected ultrasound waves. The system level block diagram does not show that the distance sensor is also connected to 5V for power and ground, however, this is displayed in the hardware sub-systems below. The distance sensor is used to ultimately receive information on the distance of an object from the sensor. This is accomplished by the distance sensor by triggering ultrasound bursts, which sets the echoPin to HIGH. The echoPin is then set to LOW when a wave from the trigPin is reflected back to the sensor. The Arduino code records the duration of how long echoPin was set to HIGH, which is then utilized to calculate the distance. This parameter is ultimately compared to threshold values which help determine the status of the urinary bag.
The block diagram above also displays how the input and outputs of the water sensor are dependent on the Arduino code. The water sensor contains the input “sensorPower,” which is connected to digital pin 7, which provides 5V of power when pin 7 is turned to HIGH and no power when pin 7 is turned to LOW. The water sensor then generates an output “sensorPin,” which is shown by pin A0 in the Arduino. The system level block diagram fails to show that the water sensor is also connected to ground, but this is also displayed in the hardware sub-systems below. The function of the water sensor is to return the water resistance value, which is then compared to threshold values to help determine the status of the urinary bag.
The three other outputs of this system are the Neopixel LED ring, alarm, and motor. The motor is not controlled by the Arduino code and is only used to model the urine flow of a patient. Thus, it was not included in the system level block diagram. The Neopixel LED ring is connected to digital pin 6 and outputs a specified color depending on the water level resistance and distance received by the distance sensor. In this same way, the alarm is connected to digital pin 11 and turns on within the main loop of the Arduino code based on the water level resistance and distance received by the distance sensor.