Skip to content

This project is designed to harness the capabilities of Arduino, an electronic compass, and an inertial measuring unit (IMU) BNO055 to control an SG90 servo motor using the HW-170 PCA9685 driver, all communicating over the I2C Bus

Notifications You must be signed in to change notification settings

ReinhardLenz/-ArduinoCompassControl

Repository files navigation

ArduinoCompassControl:

https://youtube.com/shorts/UkHEMtTI964

I2C Servo Navigator Welcome to the ArduinoCompassControl repository! This project is designed to harness the capabilities of Arduino, an electronic compass, and an inertial measuring unit (IMU) BNO055 to control an SG90 servo motor using the HW-170 PCA9685 driver, all communicating over the I2C Bus. This README provides a comprehensive overview of the project, its setup, and usage instructions.

Introduction

ArduinoCompassControl is a project aimed at integrating an electronic compass with an Arduino to determine the north direction using the BNO055 IMU. Based on this data, the SG90 servo motor is controlled via the HW-170 PCA9685 driver. The project utilizes I2C communication to facilitate efficient data exchange between components.

Photo:

servo_compas-Arduino-GY90-BNO055

Features

Compass Navigation: Determine the north direction using the BNO055 IMU. Servo Control: Adjust the SG90 servo motor position based on compass data. I2C Communication: Efficient data exchange between Arduino and peripherals. Modular Design: Easily extendable and adaptable to other projects. Hardware Requirements To get started with ArduinoCompassControl, you'll need the following hardware components:

Arduino board (e.g., Arduino Uno) BNO055 Inertial Measuring Unit SG90 Servo Motor HW-170 PCA9685 Servo Driver I2C Bus connectors and wires Software Requirements Ensure you have the following software tools and libraries installed:

Arduino IDE (version 1.8 or later) Adafruit BNO055 library Adafruit PCA9685 library Wire library (for I2C communication) Installation Clone the Repository: Clone this GitHub repository to your local machine using the following command:

Open Arduino IDE: Launch the Arduino IDE and open the project folder.

Install Libraries: Install the required libraries via the Arduino Library Manager:

Navigate to Sketch -> Include Library -> Manage Libraries. Search for and install the Adafruit BNO055 and PCA9685 libraries. Upload Code: Connect your Arduino board to your computer and upload the provided code.

Configuration Modify the configuration settings in the Arduino sketch to suit your setup:

I2C Addresses: Ensure the I2C addresses for the BNO055 and PCA9685 match your hardware setup. Servo Parameters: Adjust the servo parameters (e.g., min/max angles) based on your requirements. Usage Once the setup is complete, follow these steps to use the ArduinoCompassControl:

Power On: Connect the Arduino to a power source. Compass Calibration: Ensure the BNO055 is calibrated for accurate compass readings. Servo Adjustment: The SG90 servo will automatically adjust based on the compass data. Monitor Output: Use the Arduino Serial Monitor to observe real-time data and debug if necessary. Troubleshooting If you encounter any issues, consider the following troubleshooting steps:

I2C Communication: Verify the connections and addresses of I2C components. Library Conflicts: Ensure no conflicting libraries are installed in the Arduino IDE. Calibration: Recalibrate the BNO055 for accurate readings. Contributing We welcome contributions to ArduinoCompassControl! If you'd like to contribute, please fork the repository and submit a pull request. Ensure your code follows best practices and includes relevant documentation.

License This project is licensed under the MIT License. See the LICENSE file for more information.

Contact For any questions or feedback, please reach out to the project maintainer at [email protected].

Thank you for exploring ArduinoCompassControl! We hope this project serves as a valuable resource for your compass navigation and servo control needs. Happy coding!

About

This project is designed to harness the capabilities of Arduino, an electronic compass, and an inertial measuring unit (IMU) BNO055 to control an SG90 servo motor using the HW-170 PCA9685 driver, all communicating over the I2C Bus

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published