Port Assignment Overview
VEX IQ Brain Port Map
- Motors (1-4)
- Sensors (7-10)
- Built-in
| Port | Component | Direction | Notes |
|---|---|---|---|
| PORT1 | Base Motor | Reversed | 360° rotation with inertial feedback |
| PORT2 | Shoulder Motor | Reversed | Max torque: 95%, bumper safety |
| PORT3 | Elbow Motor | Reversed | Max torque: 95% |
| PORT4 | Gripper Motor | Reversed | Current sensing: 0.3-0.5A |
Wiring Diagram
Motor Connections
Motor Configuration Code
Fromvex_brain/src/main.py:169-178:
Motor Direction Settings
Testing Motor Direction:Motor Torque Settings
| Motor | Max Torque | Reason |
|---|---|---|
| Base | 100% (default) | Low load, smooth rotation |
| Shoulder | 95% | High load, prevent gear damage |
| Elbow | 95% | High load, prevent gear damage |
| Gripper | 100% (default) | Current sensing used instead |
The shoulder and elbow motors are limited to 95% torque to prevent mechanical damage during unexpected collisions or high-load situations.
Sensor Connections
Sensor Configuration Code
Fromvex_brain/src/main.py:63-71:
Distance Sensor Mounting
- PORT7: Gripper Distance
- PORT9: Base Distance
Location: Mounted on gripper, facing forwardOrientation: Sensor should point toward the center of the gripper openingDetection Zone: 0-40mm directly in front of gripperPurpose: Detects when object is within grasp rangeWiring: Use shortest VEX smart cable to avoid interference
Bumper Sensor Mounting
PORT10: Bumper- Location: Mounted at maximum shoulder extension point
- Trigger: Should activate only when shoulder reaches mechanical limit
- Safety: Prevents shoulder from exceeding safe range of motion
- Wiring: Route cable along shoulder joint, secure to prevent snagging
TouchLED Placement
PORT8: TouchLED- Location: Visible location on robot body (front or top)
- Purpose: Visual status feedback for debugging and operation
- View: Should be visible from normal viewing angle
- Wiring: Short cable, can be mounted near brain
Serial Communication Setup
Hardware Connection
Cable Specifications
- Type: Standard USB A to Micro-USB cable
- Length: 1-2 meters recommended for flexibility
- Quality: Use shielded cable to minimize EMI
Port Configuration
- VEX Brain Side
- Raspberry Pi Side
Device Path: Settings:
/dev/serial1Initialization (vex_brain/src/main.py:32-36):- Baud rate: Not specified (USB CDC virtual serial)
- Data format: 8N1 (default)
- Flow control: None
Message Protocol
Format: JSON messages terminated with newline (\n)
Structure:
Troubleshooting Serial Connection
Raspberry Pi cannot find /dev/ttyACM1
Raspberry Pi cannot find /dev/ttyACM1
Check connected devices:Possible outputs:
/dev/ttyACM0- Use this instead- No output - VEX Brain not detected
- Try different USB port
- Check USB cable (must support data, not just power)
- Verify VEX Brain is powered on
- Check dmesg for connection errors:
Connection established but no messages received
Connection established but no messages received
Check:Debug Raspberry Pi side:
- VEX Brain program is running
- Serial port opened correctly on both sides
- Message format is valid JSON
Messages corrupted or incomplete
Messages corrupted or incomplete
Possible causes:
- Baud rate mismatch (should be 115200)
- Buffer overflow from too many messages
- Cable quality/EMI issues
Camera Connection
USB Camera Setup
Connection: USB camera → Raspberry Pi USB port Configuration (perception/vision/camera/main.py:6-9):
0: First camera (built-in or first USB)1: Second camera/dev/video0: Specific device path
Power Considerations
Raspberry Pi Power
Supply: 5V 3A USB-C (Pi 4/5) or micro-USB (Pi 3)Consumption:
- Idle: ~2.5W
- With camera: ~3.5W
- With AI inference: ~5-7W
VEX Brain Power
Supply: VEX IQ Battery (rechargeable)Capacity: Typically 2000mAhRuntime: 1-2 hours depending on motor usageRecommendation: Keep spare battery charged
Grounding and EMI
Common Ground
The USB connection between Raspberry Pi and VEX Brain provides a common ground reference. No additional grounding is required.
EMI Considerations
Potential interference sources:- Motor PWM signals
- Switching power supplies
- Long unshielded cables
- Use shielded USB cable for serial connection
- Route power cables away from sensor cables
- Secure all connections to prevent intermittent contact
- Use cable ties for strain relief
Safety Guidelines
Emergency Stop Procedure
Software Emergency Stop (vex_brain/src/main.py:200-202):
Verification Checklist
Visual Inspection
- All motors connected to correct ports (1-4)
- All sensors connected to correct ports (7-10)
- USB cable connected between Pi and VEX Brain
- Camera connected to Raspberry Pi USB
- Both devices have independent power supplies
- No cables obstructing moving parts
Power-On Test
- VEX Brain powers on (screen lights up)
- Raspberry Pi powers on (LED activity)
- TouchLED lights up (white on init)
- Camera detected (
ls /dev/video*)
Hardware Check Service
Run the check service:Expected response:
- Check service passes
- All motors respond
- All sensors read values
Communication Test
- Serial connection established (
/dev/ttyACM1) - Messages sent successfully
- Responses received
- No JSON decode errors
Wiring Best Practices
Cable Management
- Use cable ties to secure bundles
- Leave slack for moving joints
- Route through center of rotating base
- Label cables for easy identification
Strain Relief
- Secure cables near connectors
- Avoid sharp bends
- Use clips or guides for routing
- Test full range of motion
Connector Care
- Push connectors fully until click
- Don’t pull on cables, hold connector
- Check for bent pins
- Clean contacts if intermittent
Documentation
- Take photos of final wiring
- Mark port assignments on robot
- Keep wiring diagram accessible
- Note any custom modifications
Next Steps
Software Architecture
Learn how the hardware components are controlled by software
Communication Protocol
Deep dive into the serial communication protocol
Quick Start Tutorial
Get your system running with a step-by-step tutorial