top of page

Update Feb 24, 2019

- Bought the ultrasonic sensors.

- Studied the data sheet of the sensor.

​

Update March 1, 2019

- Try to make the speaker work, but found that we don't have the functional cable.

- Bought the cable.

- Started writing the code for ultrasonic sensor.

​

Update March 7, 2019

- Completed the basic structure of the code.

- Connected the sensor with the board with Vcc, GND, and two selected GPIO pins for Trig and Echo.

- Configured the pins, and tried to get the signal from the sensor.

- We tried to use the built-in functions Chip_GPIO_SetPinState(LPC_GPIO, GPIO_Trig_PORT, GPIO_Trig_PIN, true) to set the pin state, but it did not work that the pin state was not set to the expected value.

​

Update March 11, 2019

- We figured out that the part we need for the alarm is actually DAC not I2S. We tried the sample code for DAC, and put necessary parts in our codes.We created a high frequency alarm to play when the distance is greater than 50cm.

- We are still trying to make the GPIO work correctly.

 

Update March 16, 2019

- We changed the GPIO pins which were more suitable for our codes. There was a problem in calculating the distance, and we correct it to make it work.

- After we made the sensor work ideally, we were tried to make the sensor to be more sensitive to detect the movement of the 'door'. We tried to get more data feedback and limit the range of the distance so that once the 'door' moved, the alarm would start.

- We also limited the range of the detection to make it more precise by using a shoe box embedded the sensor in order to receive less noise. 

- The result and behavior of the sensor were finally satisfying, and the alarm worked correct with warning given by the Termite timely. The whole project behaved as ideally as what we expected.

- We finished the project.

Overview:

There are four pins on the ultrasonic sensor, GND, Vcc, Trig, and Echo. We connected GND and Vcc directly to the corresponding pins on the board, and Trig to P0.9, and Echo to P0.24, both are extended GPIO pins. 

The distance is calculated by the equation: (fallingtime - risingtime)/58. 

​

bottom of page