Skip to content

RCduino/RCduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

RCduino Logo

RCduino - Arduino RC Vehicle Library

๐Ÿ“š Documentation โ€ข ๐Ÿ› Issues โ€ข ๐Ÿ’ก Examples

Introduction

RCduino 2.0 is a professional-grade Arduino library for building advanced RC vehicles including cars, drones, boats and planes with full IMU, GPS, and safety features.

๐Ÿ“– View Full Documentation Website โ†’

Table of Contents

Key Features

๐Ÿš— Motor Control

  • Brushed/Brushless motor support
  • H-Bridge dual-pin control (L298N, TB6612)
  • ESC calibration
  • Speed regulation with ramping
  • Multiple brake modes (Coast, Brake, Active)

๐Ÿ“ก Receiver Input

  • PWM/PPM/Analog signal decoding
  • 8-channel support
  • Channel reverse, trim, expo, and rate
  • Fail-safe detection
  • Signal validation

๐Ÿ”‹ Power Management

  • Battery voltage monitoring with smoothing
  • Auto cell count detection (1S-12S)
  • Multi-chemistry support (LiPo, Li-Ion, NiMH, NiCd)
  • Low voltage cutoff
  • Per-cell voltage calculation

๐Ÿ›ก๏ธ Safety Systems

  • Bitwise safety flags (multiple simultaneous warnings)
  • Signal loss protection
  • Emergency stop
  • Battery warnings
  • Configurable fail-safe actions

๐Ÿงญ IMU Integration (NEW)

  • Full MPU6050 support
  • Gyroscope and accelerometer reading
  • Complementary filter for sensor fusion
  • Pitch, roll, yaw calculation
  • Auto-calibration routine
  • Temperature monitoring

๐Ÿ“ GPS Navigation (NEW)

  • NMEA sentence parsing (GGA, RMC)
  • Position, altitude, speed tracking
  • Satellite count and HDOP
  • Distance and bearing calculations
  • Waypoint navigation helpers

๐ŸŽฎ PID Controller (NEW)

  • Professional PID implementation
  • Configurable gains (P, I, D)
  • Anti-windup protection
  • Output limiting

๐Ÿ“Š Telemetry

  • CSV and JSON formats
  • Configurable data rate
  • GPS, IMU, and status streaming
  • Custom data support

Quick Start

Installation

Arduino IDE

  1. Download the latest release from GitHub Releases
  2. In Arduino IDE: Sketch โ†’ Include Library โ†’ Add .ZIP Library
  3. Select the downloaded RCduino.zip file
  4. Restart Arduino IDE

PlatformIO

Add to your platformio.ini:

lib_deps = 
    RCduino@^2.0.0

Basic Example

#include <RCduino.h>

RCduino myVehicle(RC_CAR);

void setup() {
  // Add H-Bridge motor (IN1=9, IN2=10)
  myVehicle.addMotor(9, 10, BRUSHED_DC);
  
  // Add steering servo
  myVehicle.addServo(6);
  
  // Add receiver
  myVehicle.addReceiver(PWM_SIGNAL);
  myVehicle.getReceiver()->addChannel(0, 2);  // Throttle
  myVehicle.getReceiver()->addChannel(1, 3);  // Steering
  
  // Add battery monitor
  myVehicle.addBattery(A0, 11.0);  // 11:1 voltage divider
  
  // Add IMU (optional)
  myVehicle.addIMU();
  
  myVehicle.begin();
  
  // Calibrate IMU
  myVehicle.calibrateIMU();
}

void loop() {
  myVehicle.update();  // Handles everything automatically
}

Hardware Requirements

Motor Drivers

  • ESC: Any standard brushless ESC (1000-2000ยตs PWM)
  • H-Bridge: L298N, TB6612FNG, DRV8833, or similar

Sensors (Optional)

  • IMU: MPU6050 (I2C address 0x68)
  • GPS: NEO-6M, NEO-7M, or any NMEA-compatible GPS module

Wiring Examples

H-Bridge Motor (L298N)

Arduino Pin 9  โ†’ IN1
Arduino Pin 10 โ†’ IN2
Motor         โ†’ OUT1, OUT2

MPU6050 IMU

Arduino SDA โ†’ MPU6050 SDA
Arduino SCL โ†’ MPU6050 SCL
3.3V/5V     โ†’ VCC
GND         โ†’ GND

GPS Module

GPS TX  โ†’ Arduino RX (Serial1)
GPS RX  โ†’ Arduino TX (Serial1)
VCC     โ†’ 3.3V/5V
GND     โ†’ GND

Examples

RCduino includes 4 comprehensive examples:

1. Basic RC Car (rc_car_basic)

Simple RC car with H-Bridge motor control and battery monitoring. Perfect for beginners.

Features:

  • H-Bridge motor control
  • Steering servo
  • PWM receiver input
  • Battery monitoring with auto cell detection
  • Speed ramping

2. Advanced H-Bridge Car (rc_car_hbridge)

Demonstrates advanced motor control features including brake modes and expo curves.

Features:

  • Dual H-Bridge motors
  • Multiple brake modes (Coast, Brake, Active)
  • Channel expo and rate control
  • Advanced battery management
  • Status LED indicators

3. Stabilized RC Plane (rc_plane_stabilized)

IMU-based flight stabilization using PID controllers for pitch and roll.

Features:

  • MPU6050 IMU integration
  • Dual PID controllers (pitch & roll)
  • Auto-leveling mode
  • 4-channel receiver support
  • Real-time telemetry

4. GPS Waypoint Boat (rc_boat_gps_waypoint)

Autonomous navigation with GPS waypoint following and heading control.

Features:

  • GPS NMEA parsing
  • Waypoint navigation
  • PID heading controller
  • Distance and bearing calculations
  • Autonomous mode switching

Documentation

Supported Boards

Board Notes IMU GPS
Arduino Uno Full support โœ… โŒ*
Arduino Mega Best for complex builds โœ… โœ…
Arduino Nano Compact projects โœ… โŒ*
ESP32 WiFi/Bluetooth enabled โœ… โœ…

*Uno/Nano lack hardware Serial1, use SoftwareSerial for GPS

What's New in v2.0.0 ๐ŸŽ‰

RCduino v2.0 is a complete rewrite with production-ready features:

Core Improvements

  • โœ… Full H-Bridge motor control - Dual-pin control for L298N, TB6612, DRV8833
  • โœ… Speed ramping - Smooth acceleration/deceleration
  • โœ… Multiple brake modes - Coast, Brake, Active Brake

New Sensor Integration

  • โœ… Complete MPU6050 IMU - Gyro, accelerometer, sensor fusion
  • โœ… GPS NMEA parsing - GGA/RMC sentence support, waypoint navigation
  • โœ… PID controller class - Professional implementation with anti-windup

Enhanced Features

  • โœ… Auto battery detection - 1S-12S with multi-chemistry support
  • โœ… Bitwise safety system - Multiple simultaneous warnings
  • โœ… Channel reverse/trim/expo - Full RC transmitter feature parity
  • โœ… JSON telemetry - Modern data streaming format

Bug Fixes

  • ๐Ÿ› Fixed memory leak in safety status
  • ๐Ÿ› Improved signal validation
  • ๐Ÿ› Enhanced fail-safe reliability

Community

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - Free for personal and commercial use

Copyright (c) 2025 RCduino Development Team

See LICENSE file for details.


Made with โค๏ธ by the RCduino community
Documentation โ€ข GitHub

About

RCduino is a comprehensive Arduino library designed specifically for RC vehicle developers. It provides a complete toolkit for building RC cars, planes, boats, and quadcopters with professional-grade features and safety systems.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages