NXP Cup Line Follower - Complete Documentation
๐ Overview
This repository contains comprehensive documentation for building and programming a line follower robot for the NXP Cup competition using the FRDM-MCXN947 development board.
The project includes:
- Hardware assembly guides (shield PCB and complete car)
- Programming tutorials (MCUXpresso IDE setup and firmware development)
- Component lists with purchase links
๐ฏ Project Components
Main Hardware
- FRDM-MCXN947 - NXP Freedom development board (Arm Cortex-M33)
- NXPCUP-Shield-FRDM-MCXN947 - Custom shield PCB for motor drivers and sensors
- 8x Line Sensors - Infrared reflective sensors with LM339 comparators
- 2x DC Motors (25GA-370) - Rear wheel drive
- 2x DRV8833 - Dual H-bridge motor drivers
- LiPo Battery - 7.4V 2200mAh with XT60 connector
Software
- MCUXpresso IDE - Development environment
- MCUXpresso Config Tools - Pin and peripheral configuration
- SDK for MCXN947 - Hardware abstraction layer
๐ Documentation Structure
Start here for the complete assembly and programming guide.
Detailed Guides
-
Component List
- Complete bill of materials
- Purchase links
- Required tools
-
Shield Electronic Components
- Detailed component specifications
- Resistors, capacitors, ICs, connectors
- Polarized component warnings
-
Shield Assembly Guide
- Step-by-step soldering instructions
- 19 detailed assembly steps with images
- Quality checks and verification
- PCB cleaning
-
Car Assembly Guide
- Mechanical assembly (chassis, motors, wheels)
- Electrical connections (motors, sensors, battery)
- 15 detailed steps with safety checks
- First power-on test
-
Programming Guide
- MCUXpresso IDE installation
- SDK setup
- LED blinky demo
- Project import
- Sensor reading functions
- Motor control functions
๐ Quick Start
1. Gather Components
Review the component list and order all required parts.
2. Assemble the Shield
Follow the shield assembly guide to solder all electronic components onto the PCB.
Key steps:
- Solder resistors, capacitors, diode
- Solder IC sockets and connectors
- Mount DC-DC converter and motor drivers
- Insert LM339 ICs
- Verify with multimeter
3. Assemble the Car
Follow the car assembly guide to build the complete robot.
Key steps:
- Mount motors and wheels
- Install ball caster
- Mount FRDM-MCXN947 board
- Connect shield
- Mount line sensors
- Install battery
- First power-on test
4. Setup Programming Environment
Follow the programming guide to install and configure the development tools.
Key steps:
- Create NXP account
- Download and install MCUXpresso IDE
- Install SDK for MCXN947
- Install Config Tools
- Test with LED blinky demo
5. Import and Run Project
- Import the provided line follower project
- Build and download to board
- Test sensor reading and motor control
6. Implement Your Algorithm
Use the provided sensor and motor functions to create your own line following algorithm!
๐ ๏ธ Key Features
Hardware
- โ
8 line sensors with digital output (via LM339 comparators)
- โ
Differential drive control (2 independent DC motors)
- โ
DRV8833 motor drivers with PWM speed control
- โ
5V regulated power from 7.4V LiPo battery (MP1584EN)
- โ
Modular design with stackable shield
- โ
Easy debugging via USB (MCU-LINK)
Software
- โ
Pre-configured project with sensor and motor drivers
- โ
Simple API for sensor reading and motor control
- โ
CTIMER PWM for smooth motor speed control
- โ
GPIO digital input for fast sensor reading
- โ
Flexible configuration via macros
๐ Technical Specifications
FRDM-MCXN947
- MCU: MCX N947 (Arm Cortex-M33)
- Flash: 2MB
- RAM: 512KB
- Clock: Up to 150 MHz
- Peripherals: CTIMER, GPIO, UART, I2C, SPI
Motors
- Type: DC geared motors (25GA-370)
- Voltage: 6-12V
- Speed: ~1000 RPM at 12V
- Control: PWM (0-100%) + direction (2 GPIO pins per motor)
Sensors
- Type: Infrared reflective (8 sensors)
- Output: Digital (0/1 via LM339 comparators)
- Detection range: 3-5mm optimal
- Interface: GPIO digital input
Power
- Battery: 7.4V 2S LiPo, 2200mAh
- Regulation: 5V @ 3A (MP1584EN step-down)
- Connector: XT60
โ ๏ธ Safety Warnings
LiPo Battery Safety
- โ ๏ธ Never short circuit battery terminals
- โ ๏ธ Never charge unattended
- โ ๏ธ Always use LiPo-specific charger
- โ ๏ธ Always store in fireproof bag
- โ ๏ธ Check polarity before connecting (XT60 connector)
Soldering Safety
- โ ๏ธ Wear safety glasses
- โ ๏ธ Work in well-ventilated area
- โ ๏ธ Avoid touching hot soldering iron
- โ ๏ธ Wash hands after handling solder
Electrical Safety
- โ ๏ธ Verify polarity before connecting battery
- โ ๏ธ Check for short circuits with multimeter
- โ ๏ธ Turn off power before making connections
- โ ๏ธ Keep liquids away from electronics
๐ Educational Objectives
This project teaches:
- Electronics: PCB assembly, soldering, component identification
- Embedded systems: Microcontroller programming, peripheral configuration
- Control systems: PWM, GPIO, sensor interfacing
- Robotics: Differential drive, line following algorithms
- Debugging: Multimeter usage, troubleshooting hardware/software
๐ค Contributing
This is an educational project for the NXP Cup competition. Contributions are welcome!
How to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement)
- Commit your changes (
git commit -m 'Add improvement')
- Push to the branch (
git push origin feature/improvement)
- Open a Pull Request
Areas for contribution:
- Additional assembly photos
- Code examples
- Algorithm improvements
- Translations
๐ License
This project is open source and available under the following licenses:
- Hardware (PCB, schematics): CERN Open Hardware Licence v2 - Strongly Reciprocal (CERN-OHL-S-2.0)
- Documentation (markdown, images): Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0)
- Software (firmware, code examples): MIT License
See LICENSE for details.
๐ Resources
Official Documentation
Datasheets
๐ง Support
For questions or issues:
- Search existing GitHub Issues
- Open a new issue with detailed description
๐ Acknowledgments
- NXP Semiconductors - for the FRDM-MCXN947 platform and NXP Cup competition
- Contributors - everyone who helped improve this documentation
- Students - who will build amazing line followers with this guide!
๐ธ Gallery
Ready to build your line follower? Start with the Main Tutorial! ๐๐จ
Made with โค๏ธ for NXP Cup