Skip to content

M5Stack and Bluepad32 integration for easy Bluetooth remote control of LEGO vehicles with GeekServo and Power Function motors

License

Notifications You must be signed in to change notification settings

pink0D/M5Bluepad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

M5Bluepad library features extension classes for easier use of Bluepad32 with M5Stack units.

Bluetooth remote control with M5Stack Atom-Lite and Atomic Motion Base

Atomic Motion Base is kind of Arduino shield for controlling servo motors. It's designed to be used with Atom series controllers from M5Stack.

Atom-Lite is based on ESP32 with Bluetooth Classic support so it can establish wireless connection to most modern gamepads, including XBox Wireless Controller and Sony DualShock/DualSense.

Unit 8Servos can be used to connect additional 8x Servos so up to 14x Servos and 2x DC motors can be attached in total.

Most M5Stack units have LEGO-compatible mounts so if used together with GeekServo motors, this combo makes possible building small size yet powerful and extensible remote control machines like cars or robots.

IMG-1619 IMG-1613 IMG-1620 IMG-1677

YouTube demo

M5Stack and Power Functions motors

Atomic HDriver Base features a DC-motor driver capable to be powered from a 3S LiPo battery. It's also compatible with Atom controllers, so together with a GeekServo this setup enables building cars with proportional steering.

IMG-1678

More info

M5Stack and Mould King modules

Atom-Lite and Atomic HDriver Base can be used together to make an adapter which can control Mould King 4.0 or 6.0 modules with a gamepad. An additional GeekServo can be attached to the grove port.

Mould_King_M5_cover

More info

YouTube demo

Using BluepadHub with other controllers

While this library was initially created for using with Atom-Lite, it is also compatible with other M5Stack controllers based on ESP32-PICO-D4, ESP32-PICO-V3 or ESP32-D0WD chips.

The main BluepadHub class in this library is independent from M5Stack hardware, so it can be used to implement bluetooth remote control with many other boards based on ESP32 chips supporting Bluetooth Classic, like ESP32-PICO-MINI02 or ESP-WROOM-32.

Supported M5Stack controllers Unsupported controllers
✅ Atom-Lite ❌ AtomS3-Lite
✅ Atom-Matrix ❌ AtomS3
✅ Atom-Echo ❌ Atom EchoS3R
✅ Core2 ❌ CoreS3
✅ Core Basic
✅ StickC-Plus2
✅ All controllers based on ESP32-PICO-D4, ESP-32-PICO-V3 and ESP32-D0WD ❌ All controllers based on ESP32-S3, ESP32-C3, and ESP32-C6

Supported servo and motor control units

Description of some most common setups is available on this wiki page.

Unit Status
M5Stack Atomic Motion Base ✅ Supported
M5Stack Atomic HDriver Base ✅ Supported
M5Stack Unit 8Servos ✅ Supported
M5Stack Unit HBridge Planned
Mould King Power Module 4.0 ✅ Supported
Mould King Power Module 6.0 ✅ Supported
GeekServo ✅ Supported
Other units and devices Can be impemented with custom code in sketch

Using the library

  1. Install boards and libraries in Arduino IDE (wiki)
  2. Start with uploading TestBluepad32 example to test connection between your gamepad and the controller
  3. Continue to explore AtomicLiteMotion sketch and learn how BluepadHub handles gamepad's input to control motors and servos
  4. Check out more examples for supported M5Stack units

License & credits

  • M5Bluepad is open source and licensed under the MIT License
  • Bluepad32, on which the M5Bluepad greatly depends, is also open source, licensed under Apache 2. Bluepad32 depends on the BTstack made by BlueKitchen GmbH. BTStack is free to use for personal open source projects, but commercial for other uses
  • Mould King BLE protocol was originally implemented by @J0EK3R and @vicocz in brickcontroller2

Contacts

EMail: pink0D.github@gmail.com

About

M5Stack and Bluepad32 integration for easy Bluetooth remote control of LEGO vehicles with GeekServo and Power Function motors

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published