This repository contains the source code and resources for interfacing a Time-of-Flight (ToF) sensor with the PIC24FJ128GA702 microcontroller. This project is designed to measure distances using the ToF sensor and display the results on an LCD or transmit them via UART.
- Interface with a Time-of-Flight sensor to measure distance.
- Display measured values on an LCD.
- Option to transmit data via UART for external applications.
- Written in C for the PIC24FJ128GA702 microcontroller.
To work with this project, you will need:
-
Hardware:
- PIC24FJ128GA702 microcontroller.
- A Time-of-Flight (ToF) sensor (e.g., VL53L0X or equivalent).
- LCD display (optional).
- UART interface for data transmission (optional).
- Breadboard and connecting wires.
- Power supply for the circuit.
-
Software:
- MPLAB X IDE.
- XC16 compiler for PIC24F series.
-
Clone the repository:
git clone https://github.com/MannyShussan/Tof-with-PIC-24FJ128GA702.git
-
Open the project in MPLAB X IDE.
-
Connect the hardware components:
- Wire the ToF sensor to the I2C pins of the PIC24FJ128GA702.
- Connect the LCD (if used) to the appropriate data and control pins.
- Ensure UART connections are made if data transmission is required.
-
Configure the microcontroller pins as specified in the source code.
-
Build and upload the firmware to the PIC24FJ128GA702.
- Power on the circuit.
- Observe the measured distances displayed on the LCD or transmitted via UART.
- Adjust the sensor position as needed to test its range and accuracy.
- src/: Contains the source code files.
- include/: Header files for the project.
- docs/: Documentation files (e.g., circuit diagrams and explanations).
Contributions are welcome! If you find issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE
file for details.
- Special thanks to the creators and maintainers of the PIC24FJ128GA702 microcontroller and related tools.
- Inspired by the practical applications of ToF sensors in distance measurement and automation.
For further questions or support, feel free to contact the repository owner.