Bath-Biodevices-Without-Borders / Bath-Biodevices-Without-Borders/System
Investigate depth sensor
- Dominant language
- C++
- Stars
- 1
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
# Investigate depth sensor
## Problem
The depth sensor was original meant to determine if the sensor are in the water or not to prevent false readings. Well, instead of determining the depth of the water, it instead just determines if there is water on the sensor or not.
This needs to be fixed and an investigation needs to be conducted to determine what voltages correspond to how deep the depth sensor is in the water.
In addition, the program only check if the sensors are in the water prior to taking readings, not throughout the reading. Therefore, the user can dip it in the water, start a reading, and then immediately take it out mid reading producing a false reading.
This can be fixed by adding a check between each sensor reading which just checks if the device is still in the water.
## Current Operation
The function doesn't take any parameters. It starts by reading the state of the water sensor using the `digitalRead()` function. This function returns either 1 or 0, depending on whether the sensor is detecting water or not. The state of the sensor is stored in the integer variable value.
Next, the function checks if value is equal to 1. If it is, the function prints a message to the serial monitor saying "Not in water - " followed by the value of the sensor. This is for debugging purposes. The function then returns 0, indicating that the sensor is not in water.
If value is not equal to 1, the function prints a message to the serial monitor saying "In water - " followed by the value of the sensor. This is also for debugging purposes. The function then returns 1, indicating that the sensor is in water.
In summary, this function is used to check if a depth sensor is in water or not. It does this by reading the state of the sensor and returning a corresponding integer value. The function also prints messages to the serial monitor for debugging purposes.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the function described as reading the depth sensor via digitalRead() and inspect the surrounding reading sequence. Investigate which sensor voltages correspond to water depth, then define how the in-water state should be checked between sensor readings. Done means depth is measured rather than merely detected, and removing the device during a reading cannot produce a false result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100