This repository contains various embedded systems projects focusing on real-time control, navigation, and sensor integration for autonomous systems. Each project demonstrates the integration of sensors, actuators, and control algorithms for specific embedded applications.
This repository demonstrates embedded systems projects that integrate real-time feedback control, sensor data processing, and motor actuation for various use cases like hovercraft control, LED sequencing, and distance measurement.
Each .ino file represents a standalone project or module that can be executed on an Arduino-compatible microcontroller.
Description:
This project controls a sequence of LEDs based on a switch input. The sequence iterates through four states, illuminating different LEDs in each state.
Key Features:
- Simple GPIO and digital write/read functionality.
- Implements delays to control sequence timing.
- Great for learning basic digital I/O.
Description:
Displays distance measured (in meters) using LEDs. The LED pattern changes based on predefined distance ranges, with higher ranges illuminating specific LEDs.
Key Features:
- Distance-to-LED mapping logic.
- Use of GPIO pins for both input and output.
- Demonstrates practical distance visualization using LEDs.
Description:
Reads distance data from a Sharp IR distance sensor and outputs the computed distance over the Serial Monitor.
Key Features:
- Converts analog sensor values into real-world distance using a calibration equation.
- Filters and bounds sensor readings to handle out-of-range values.
- Outputs distance at regular intervals.
Description:
A state machine-based hovercraft control system. Controls lift fan and directional motors through defined states like START, ACTIVATE, MOVE, and DEACTIVATE.
Key Features:
- Implements a finite state machine for structured state transitions.
- Controls PWM motors for lift and thrust.
- Provides modularity for hovercraft control.
Description:
Introduces IMU-based control for the hovercraft. The project integrates real-time orientation feedback from an MPU9250 IMU to maintain hovercraft stability.
Key Features:
- IMU integration for yaw control.
- Basic PD control for rotational stability.
- Real-time Serial Monitor feedback for debugging.
Description:
Enhances hovercraft IMU control with a PD feedback loop. Adjusts the hovercraft’s yaw based on rotational feedback for precise orientation control.
Key Features:
- Proportional-Derivative (PD) control for yaw stabilization.
- Configurable gain parameters for tuning.
- Includes structured motor control logic.
Description:
Integrates optical flow sensors and an IMU to track hovercraft motion in x-y space. Computes translational motion using camera slip data.
Key Features:
- Combines optical flow data with IMU orientation.
- Computes velocity and absolute position for the hovercraft.
- Low-pass filters for smooth motion estimation.
Description:
Combines PD control for rotational stability with optical flow data for precise hovercraft motion. Tracks and compensates for drift while maintaining directional stability.
Key Features:
- Uses IMU yaw feedback for rotational control.
- Tracks translational drift using optical flow sensors.
- Modular state machine implementation for navigation.
Description:
This is the most advanced hovercraft control system in the repository. Combines PD rotational control, optical flow-based x-y tracking, and position control using IMU data.
Key Features:
- Real-time hovercraft position and velocity control.
- Combines IMU and optical flow data for robust navigation.
- Implements multi-stage navigation goals with precise motion tuning.
The projects use the following Arduino libraries:
- MPU9250 for IMU integration.
- PWMServo for servo motor control.
- OpticalFlowCamera for optical flow sensor data.
PeriodicActionfor periodic task management.
Install these libraries via the Arduino Library Manager or download them from the linked repositories.
-
Clone the repository:
git clone https://github.com/Keeby-Astro/Embedded-Real-Time-Systems-Practice.git cd Embedded-Real-Time-Systems-Practice -
Install the necessary libraries.
-
Open the desired
.inofile in the Arduino IDE, select your microcontroller board, and upload.
- Microcontroller: Arduino Mega, Teensy, or equivalent with sufficient GPIO pins.
- Sensors:
- IMU: MPU9250 for orientation and angular velocity feedback.
- Optical Flow Cameras: For x-y motion tracking.
- Sharp IR Distance Sensor (for distance-related projects).
- Actuators:
- Brushless motors with ESCs (Electronic Speed Controllers).
- LEDs for display and indicators.
- PWM-controlled servo motors.
- Power Supply: Ensure appropriate power for motors and sensors.
- Load a project: Select and upload the
.inofile corresponding to the project you want to run. - Connect peripherals: Refer to the pin assignments in the source code and ensure sensors, motors, and other peripherals are properly connected.
- Monitor data: Use the Serial Monitor in the Arduino IDE for debugging and runtime information.
- Tune parameters: Adjust control gains (e.g.,
Kp,Kd) and thresholds to fit your hardware setup.
This repository is licensed under the MIT License. Feel free to use, modify, and distribute the code with proper attribution.