This project is a distance measurement system using an MSP430G2553 microcontroller and an HC-05 Bluetooth module. The system measures the distance using a photoresistor and transmits the data to a mobile device via Bluetooth.
- MSP430G2553 Microcontroller
- HC-05 Bluetooth Module
- 16x2 LCD Display
There are the main components, you can find the others in altium file.
- Clone this repository to your local machine.
- Open the project in IAR Studio.
- Connect the MSP430G2553 LaunchPad to your computer.
- Change the desired MAC adress to find in the code. (Also look at Calibration step)
- Build and flash the code to the LaunchPad.
- Connect MSP430 micro controller to your PCB.
- Power on the system.
- It will automatically inquire the device you need to find.
- You will start receiving distance measurements in real-time!
The code starts by initializing the necessary GPIO pins and UART communication. You need to enter the Mac adress of the desired device. Than it will inquire that device, once it found it, will displays the distance on the LCD display. The code also includes error handling for cases where the Bluetooth module fails to connect.
To calibration, you will need to measure the RSSI value in one meter. You have to change this value in code. This value will use in a formula that mesure the distance. Don't forget that you have to mesure this one meter RSSI value environment spesific.