Mecanum Motion 2 – Arduino Uno R4 Wifi

Video link = https://www.youtube.com/watch?v=DYcEgvdhoOE

A while back I got the chassis with the mecanum wheels being controlled by an adafruit.io dashboard. I have revamped the controller to now be an Arduino Uno R4 WiFi controller with an Adafruit MotorShield V3, once again controller by an adafruit.io dashboard.

The code for this is here:

https://github.com/directorcia/Azure/blob/master/Iot/Arduino%20Uno%20R4%20Wifi/Adafruit-IO/chassis-control.cpp

and the documentation for the code is now at:

https://github.com/directorcia/Azure/wiki/Arduino-Uno-R4-Wifi-Chassis-Control-Script

which saves me having to explain it here.

Arduino Uno R4 Wifi Wheel test

Video URL = https://www.youtube.com/watch?v=Ed9reoDO2EA

Now that I have my Arduino Uno R4 Wifi connected to the Internet and Adafruit.io, the next challenge is to get the wheels turning so to speak.

To do this I need a motor driver and wanted one that would easily connect to the Arduino Uno R4 Wifi without too much soldering. I therefore chose:

adafruit_products_powerjump.jpg

Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit – v2.3

the instructions for this board are here:

Adafruit Motor Shield V2

and the software library is here:

Adafuit_Motor_Shield_V2_Library

however. it turns out that I should have also bought:

Shield stacking headers for Arduino (R3 Compatible)

but I’ll come back to that.

Screenshot 2025-07-27 084259

With the headers soldered into place, I could then insert the Adafuit Motor Shield directly onto the Arduino Uno R4 Wifi as shown above.

I then uploaded the following code to the Arduino Uno R4 Wifi:

https://github.com/directorcia/Azure/blob/master/Iot/Arduino%20Uno%20R4%20Wifi/Adafruit%20Motor%20Shield%20V3/test-motors.cpp

to test all the motors. The results of this are shown in the video at the top.

Using the ‘vibe’ coding and with thanks to Github Copilot, getting the results I wanted was really easy. It even installed the Adafuit_Motorshield drivers for me as well.

Now I know the shield works along with the all the motors. The next was to be to get the DFRobot 1602 LCD display working on teh Arduino Uno R4 Wifi. It was then I realised that I should have used the:

Shield stacking headers for Arduino (R3 Compatible)

as I now didn’t have an easy way to connect the display. Damm! I’ll need to figure something else out to get the display working with the board. However, I am very pleased that the Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit – v2.3 works well and all the motors on my chassis are all operational again. I am now back to where I was with the S32 controller over a year ago.

If you haven’t worked out yet, I’m trying to get back to this point:

Mecanum motion

but with a more compact controller and motor driver.

Robot arm in action–Linear motion

Video link = https://www.youtube.com/watch?v=zdtojnnbCBg

Now that I have my robot arm actually working, I can share the video of its operation above. It basically operates one servo at time to pick up and object and then place that object to the left. It will simply continue to do that over and over.

The code for this is here:

https://github.com/directorcia/Azure/blob/master/Iot/Arduino%20Uno%20R3/Robot%20Arm/routine1.cpp

Which I’ll explain in an upcoming post soon.

After that I want to modify the operation so that it more more naturally and operates multiple servos together to arrive at its destination.

The wheels are turning

mc-wheels

Hopefully you can see from the above video that I have now got all the wheels turning on the frame in the same direction.

With the motor basics done, next I’ll get the rig talking to WiFi and outputting information to the LCD display.

Following that, the next step is to determine how to move in different directions with these Mecanum wheels.