This project transforms an Arduino Uno R4 WiFi into a WiFi-controlled motor system using the DroidPad app.
It enables joystick-based movement, button toggles, a speed slider, and even a self-driving mode using ultrasonic sensors. The Motors are controlled using the Arduino Motor Shield Rev3.
The system communicates over TCP, allowing seamless real-time control.
-
WiFi Connectivity : Uses ESP32 (Uno R4 WiFi) to host a TCP server.
-
Joystick Control : Control movement via an 8-axis joystick.
-
Button & DPAD Support : Supports additional input actions.
-
Slider for Speed : Adjust the speed dynamically.
-
Self-Driving Mode : Uses ultrasonic sensors for obstacle avoidance.
-
Motor Control : Smooth forward, backward, and turning motion.
-
Easy Debbuging : Serial prints for DroidPad interaction with IDs.
-
Customisability options : Easy layout adjust thanks to the DroidPad app with unique IDs for everything.
-
Clone the Repository
git clone https://github.com/Klixxy/ArduTank.git
-
Upload the Code to your Arduino using the Arduino IDE.
-
Monitor Serial Output for the WiFi details.
-
Connect & Control via DroidPad!
-
Download DroidPad: GitHub Repository
-
Connect your device to the Arduino's WiFi network.
-
Scan this QR code with the App to get a ready to use template:
-
Optional: manually enter the following settings in the app:
- Type: TCP
- Host: (Check Serial Monitor for IP)
- Port:
8080
-
Add controls and give them IDs (only if you do it manually):
- 1 D-pad (Default ID)
- 1 Switch (Default ID)
- 1 Joystick (Default ID)
- 1 Slider (Default ID, Max. value 10)
- 2 Buttons (changed IDs because there are two of them: button1 and button2)
-
Connect by pressing the small play icon.
-
Start controlling your car or tank! 🎮
Motor Pins as of the documentation of the Arduino Motor Shield Rev3.
Every Pin can be changed, if you have different Hardware.
In this version the Pins 1 and 2 are Outputs for Light and a Horn, hence the toggle on one Button.
| Component | Pin |
|---|---|
| Motor A Direction | 12 |
| Motor A PWM | 3 |
| Motor A Brake | 9 |
| Motor B Direction | 13 |
| Motor B PWM | 11 |
| Motor B Brake | 8 |
| Button 1 (only on if pressed) | 1 |
| Button 2 (toggled if pressed) | 2 |
| Ultrasonic Sensor 1 (Trigger/Echo) | 7 / 6 |
| Ultrasonic Sensor 2 (Trigger/Echo) | 5 / 4 |
- Arduino Uno R4 WiFi
- Arduino Motor Shield Rev3
- 2 x DC Motors
- 2 x HCSR04 Ultrasonic Sensors
- Check the Serial Monitor
(9600 baud)for logs. - Ensure DroidPad is connected to the same WiFi.
- If motors don’t respond, check wiring & power supply.
This project is open-source under the MIT License.
Happy Hacking!