🎯 Embedded Systems Project 2025

PARMCO

Phone App RPi Motor Control

An innovative embedded system bridging iOS, Raspberry Pi, and hardware. Control a motor wirelessly with style and precision.

🎧 Project Theme Song

Listen to the official AI generated PARMCO development soundtrack while you scroll! Created with https://lyricsintosong.com/.

Architecture

System Overview

A complete end-to-end embedded system demonstrating seamless hardware-software integration

Data & Control Flow

1

User Input

User adjusts speed slider or direction on the iOS app interface

2

BLE Transmission

App writes data to GATT characteristic via CoreBluetooth

3

RPi Processing

C program receives, parses, and translates into hardware commands

4

Motor Control

GPIO signals drive L293D H-bridge to control motor speed and direction

System architecture diagram

System Architecture Diagram

Components

Three-Tier Architecture

Each component plays a crucial role in the system's operation

📱

iOS Application

The user-facing controller acting as the BLE Central device.

  • SwiftUI interface design
  • CoreBluetooth framework
  • Real-time BLE communication
  • Intuitive speed & direction controls
🖥️

Raspberry Pi 4

The central hub and BLE Peripheral managing all operations.

  • Raspberry Pi OS
  • C program with BlueZ library
  • GPIO control via pigpio
  • PWM signal generation
⚙️

Motor & Driver

Physical hardware translating digital signals into motion.

  • L293D H-Bridge driver
  • 12V DC Motor
  • FC-51 IR proximity sensor
  • Bidirectional speed control
See It In Action

Project Demonstrations

From hardware assembly to full wireless control

System Setup

A walkthrough of the hardware and bluetooth setup process, demonstrating how to power the circuit and setup a bluetooth connection.

iOS App & Motor Control

The complete integrated experience showing real-time Bluetooth latency. This demo covers the different modes of the iOS application (manual, automatic, and game mode) and how they each control the motor system.

User Interface

📱 iOS App Screenshots

A visual tour of the custom-designed iOS application, featuring the BLE connection, control modes, and the integrated game.

iOS Bluetooth Connection Menu Screenshot

BLE Connection

iOS App Manual Control Mode Screenshot

Manual Mode

iOS App Automatic Control Mode Screenshot

Automatic Mode

iOS App Game Mode Screenshot 1

Game Start

iOS App Game Mode Screenshot 2

Game In Progress

iOS App Game Mode Screenshot 3

Game Over

The iOS application provides three distinct control modes: Manual, Automatic, and Game Mode.

Hardware

Circuit Design & Setup

Detailed circuit schematic, pinout configuration, and power requirements

🔌 Circuit Operation

The circuit utilizes an L293D dual H-Bridge motor driver to control a 12V DC motor, enabling the Raspberry Pi to manage both speed via PWM and direction via logic signals.

An FC-51 IR proximity sensor tracks RPM data from the motor, with its digital output fed to an RPi GPIO input for real-time monitoring.

An IRFZ34 N-Channel MOSFET acts as a low-side switch for an LED indicator, providing visual feedback when the motor is active.

Power & Safety

  • Motor powered by external 12V DC supply
  • L293D logic and IR sensor powered by RPi 5V pin
  • Common ground between RPi and motor circuit
  • Internal flyback diodes and thermal shutdown protection
  • ⚠️ FC-51 IR sensor must use 5V, not 12V to prevent damage

🧰 Circuit Components Checklist

Required Components

  • Raspberry Pi 4 (or similar compatible model)
  • L293D Motor Driver IC
  • 12V DC Motor
  • FC-51 IR Sensor (for RPM measurement)
  • LED Indicator (e.g., 5mm red LED)
  • IRFZ34 N-Channel MOSFET (or NPN Transistor)
  • 12V Power Supply (DC)
  • 220Ω Resistor (for LED current limiting)
  • 10kΩ Resistor (for MOSFET/transistor base)
  • Assorted Jumper Wires

Optional but Recommended Tools

  • Breadboard (essential for prototyping and testing)
  • Multimeter (crucial for testing power, ground, and pin voltages)
  • Soldering Iron and Solder (for more permanent connections)
  • Wire Strippers

Circuit Schematic

Circuit schematic diagram

Raspberry Pi Pin Assignments (BCM)

Pin (BCM) Function Description
GPIO 17 PWM Output Speed control to L293D Enable pin
GPIO 23 Direction 1 Motor direction to L293D Input 1A
GPIO 24 Direction 2 Motor direction to L293D Input 2A
GPIO 5 IR Sensor Input Reads digital output from FC-51
5V Logic Power Supplies 5V to L293D & sensor
GND Ground Common ground for all components
Development Tools

AI-Powered Development

Leveraging cutting-edge AI tools to accelerate development and enhance code quality

🤖

Claude AI

Code generation, debugging assistance, and architecture design consultation

Code Review Documentation
💬

ChatGPT

Algorithm optimization, troubleshooting, and API documentation interpretation

Problem Solving Optimization
🧠

Cursor AI

Real-time code suggestions and autocomplete for Swift and C development

Autocomplete Boilerplate
🎨

Gemini Pro

UI/UX design concepts, icon generation, and visual asset creation

Design Assets

📝 AI Interaction Log

Explore our complete development journey with AI tools. This comprehensive log documents every AI interaction, prompt, and solution throughout the project lifecycle.

  • 500+ AI-assisted code generations
  • Debugging sessions and solutions
  • Architecture decisions and rationale
  • Learning moments and breakthroughs
View Complete Log →

Full transparency in AI usage

Technical Stack

Code Libraries & Frameworks

A detailed breakdown of every library, including trade-offs and selection rationale.

🖥️ Raspberry Pi C Libraries

GLib / GIO

D-Bus / Event Loop

The core library enabling asynchronous D-Bus communication with the BlueZ Bluetooth stack.

Rationale: Chosen over PyBluez or Bleak because it is the only reliable way to implement a **GATT Server** (peripheral role) on Linux using the native, well-maintained BlueZ stack.

BlueZ

Bluetooth Stack

The official Linux Bluetooth protocol stack, accessed via the high-level D-Bus interfaces.

Code Usage: The C program uses interfaces like GattManager1 to register the **Nordic UART Service (NUS)** and handle iPhone WriteValue commands.

pigpio

Hardware PWM

High-performance C library providing direct hardware GPIO access and true hardware PWM control.

Rationale: Chosen because it is the **only actively maintained** option that provides **hardware PWM**, which is essential for smooth motor control without audible whining.

pthread

Concurrency

The standard POSIX threading library used for managing concurrent execution of tasks.

Code Usage: Used to run the **RPM monitoring in a separate thread** to maintain microsecond-level precision while the main loop handles command processing and I/O.

Named Pipes (FIFO)

Inter-Process Comm.

A low-latency, text-based POSIX mechanism for inter-process communication (IPC).

Rationale: Chosen as the simplest, most debuggable IPC method, beating complex alternatives like sockets or shared memory for low-frequency command passing.

math.h

Mathematics

Standard C math library providing mathematical functions for control algorithms.

Code Usage: Essential for implementing the **PID controller**, which uses functions like fabs() for calculating the absolute value of the RPM error.

📱 iOS Application Frameworks

CoreBluetooth

BLE Framework

Apple's native framework for implementing the BLE Central role (scanning, connecting, GATT).

Rationale: This is the **only viable option** for performing BLE communication on the iOS platform.

UIKit

UI Framework

The mature and performant framework providing the app's main view controllers and UI components.

Rationale: Chosen over SwiftUI for better **stability and reliability** when integrating complex BLE callbacks and ensuring compatibility with older iOS versions.

SpriteKit

2D Game Engine

Apple's native 2D game framework used to implement the Flappy Bird-style control game.

Rationale: Provides a native, performant **physics engine** for collision detection, which is superior to implementing custom animation in UIKit.

Foundation

Core Utilities

The fundamental framework providing essential data types, collections, and threading utilities.

Code Usage: Necessary for handling Data types for BLE communication and managing threading via DispatchQueue.

Complete Technology Stack

Swift UIKit SpriteKit CoreBluetooth C BlueZ GLib / GIO pigpio POSIX Threads Named Pipes (FIFO) GATT Protocol PID Control
The Minds Behind PARMCO

Meet the Team

Engineering students bridging the gap between software and hardware

Blake Withee

Blake Withee

Embedded Systems Engineer

Specialized in embedded systems and low-level programming. Focused on the hardware integration, C programming for the Raspberry Pi, physical circuit design, and website design.

Gaelen Collins

Gaelen Collins

Software Engineer

Responsible for the iOS Application development. Handled the SwiftUI interface design, CoreBluetooth implementation, and user experience logic. Additionally worked on C programming for the motor and bluetooth server.

🎧 Project Theme Song

Listen to the official PARMCO development soundtrack.