Arduino Code

Delay to read distance from each of the ultrasonic sensors: 60ms
Average human response rate: 500ms

If the distance from sensor 1 minus the distance from sensor 2 is below tolerance (currently set to be 50 cm), the data received is valid. If the value is equal to or above tolerance, then the data received is invalid and there is a sensor sync error. 
Translation to Code: the absolute value of the difference of the two distances 

Use of two sensors: Using the first sensor is not reliable, because it tends to give false values from interferences at times. We believe this is due to the internal problem in the sensor. Even if there is no problem with using one ultrasonic problem, we would still use two sensors for increased reliability and safety. If there are some problems with one of the sensors, the LEDs won’t give feedback since the two values don’t come close, and therefore alerting the user to get the apparatus repaired or replaced. 

For increased speed in analyzing the environment of the user, we wanted to decrease the delay necessary for the device by transmitting only one signal from one ultrasonic and receive the signal from both, thereby decreasing the necessary delay by 50%. But this raises even more safety concerns and backfires the original intention to increase safety. After all, the delay is only about 20 percent of the average human response rate. 

60ms is the minimum delay recommended according to the datasheets of the ultrasonic sensor used in the device. The speed of sound in dry air at 20*C is approximately 343m/s, which translates into 0.343m/ms. That is, in 60ms, the delay when reading the distance from each of the sensors, the sound transmitted from the ultrasonic sensor travels a bit over 20m, or 20.58m to be exact. Half that distance is the actual distance from the ultrasonic sensor to the object. Around or above that distance is not as accurate due to the design of the ultrasonic sensors. This is one design constraint, but one that doesn’t necessarily interfere with the ultimate goal of the project. 

Source: "Sound Speed in Gases." Speed of Sound. N.p., n.d. Web. 25 May 2016.

Challenges: 
- messing up when working with two ultrasonic sensors 
- could only get one working when tried to use both simultaneously
- problem: signal interference
- solution: delaying when measuring distance from each sensor. 


Refer to the sample codes for sources from which Htet got help in writing the ultimate code for the device. 

No comments:

Post a Comment