Control a Pi bot with a Wiimote
Les Pounder travels back to 2014, the last time that he held a Wiimote that wasn’t embedded in an LCD TV.
OUR EXPERT
Les Pounder is associate editor at Tom’s Hardware and a freelance maker for hire. He blogs about his adventures and projects at http://bigl.es.
We are travelling back in time. Nine years, to be precise. That W was the last time we connected a Nintendo Wiimote to a Raspberry Pi. In this tutorial, we are learning how to configure a Pi to communicate with a Wiimote over Bluetooth. We’ll put the connection to use by constructing a very simple robot control script to spin motors connected to a Cytron Maker Drive motor controller. Using this script as a template, you can easily build a remote-controlled robot using the Raspberry Pi 4, 3B+, Zero W or Zero 2 W.
YOU NEED
Pi 4/4B+/ Zero W/2 W
Cytron Maker Drive
4x AA battery box
4x AA batteries 2x DC motors
5x femaleto-male jumper wires
Code: https:// github.com/ lesp/ LXF307- Wiimote- Robotics/ archive/refs/ heads/main. zip
Wiring up the circuit
The circuit has four main components: a Raspberry Pi, a Maker Drive motor controller, motors and a power source for the motors. The Pi connects to the motor controller using pins 14, 15, 18 and 23. These control the direction in which the two motors spin. We also connect any GND pin on the Pi to the GND pin of the Maker Drive. Next we connect an external 5-6V power source to the VB+ (red) and VB- (black, GND) terminals of the Maker Drive. The VBand Pi GND connection form a common ground from which the circuit can base a voltage reference. The motors are connected to M1A, M1B and M2A, M2B. These are controlled by the Pi GPIO pins, but the Maker Drive protects the delicate GPIO pins from the motors, as motors can pull a lot of current. Please refer to the circuit diagram in the project’s download.