This project enables distance measurement using a Raspberry Pi and an ultrasonic sensor. The ultrasonic sensor sends and receives sound waves to calculate the distance to an object, making it a useful tool for various applications.
- Raspberry Pi (any model with GPIO pins)
- Ultrasonic Sensor (e.g., HC-SR04)
- Jumper Wires
- Power Supply for Raspberry Pi
- Raspberry Pi OS installed on your Raspberry Pi
- Python 3.x
Connect the ultrasonic sensor to the Raspberry Pi's GPIO pins as follows:
- VCC to 5V
- Trig to GPIO Pin (e.g., GPIO17)
- Echo to GPIO Pin (e.g., GPIO18)
- GND to GND
- Clone this repository to your Raspberry Pi.
git clone https://github.com/mrnithish/ThinkSpeak_Ultrasonic.git
- Navigate to the project directory.
cd ThinkSpeak_Ultrasonic
- Run the Python script to measure distances.
python main.py
- The script will display real-time distance measurements on the console.
- You can configure the GPIO pins and measurement parameters in the
main.py
script to match your setup.
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/fooBar
). - Make your changes.
- Commit your changes (
git commit -am 'Add some fooBar'
). - Push to the branch (
git push origin feature/fooBar
). - Create a new Pull Request.
This project is licensed under the [License Name] - see the LICENSE.md file for details.