In the last part of the ArduRover series. I posted a video of the robot driving around while being controlled with a PC. The program running on the PC was sending data to Arduino using a serial port, and the Arduino then transmitted the data to the robot. This setup had few major issues, however.
First, driving the robot with keyboard proved quite difficult. The following picture is a screenshot of the app I used to control the robot in that video.
It is written in C# using .NET framework in Visual Studio, and while it was somewhat useful to test the motors, steering the robot by adjusting only one side at a time was challenging. Annoying, to put it less mildly. The only controls available to the user are sliders which set motor speed and buttons that instantly stop the robot.
The other big issue I had was that the laptop I used for testing is a bit too heavy to be carried around with one hand, all while driving the robot with the other. Well, a guy running around with a laptop and a pet robot may look a bit weird.
To make the controls more intuitive and portable, I needed some preferably handheld device that could connect to an Arduino and would be light enough to carry around for an extended period of time. Bonus points for concealability. Originally, I intended to use an old RC plane controller that I would mount the Arduino onto, but then a much simpler solution occurred to me: my Android phone! That fits all the requirements perfectly. It’s light and it’s handheld. We just need to connect it to the Arduino somehow, either using the USB port or by Bluetooth.
The next app I came up with is written in Java using Android Studio. It’s much more advanced than the C# app above. It has multiple screens and allows the user to control all the subsystems, not just the motors. Let’s take a look at the layout of one of the screens.
Each of the screens is split into several parts. On both sides of the screen, there are sliders (marked 1 and 2 in the above image) to set direction and speed of left-side and right-side motors. This placement should allow the user to control the robot movement in a more natural way: move the slider up to go forward, move it down to go backward. The further the slider goes, the faster that side turns. Easy!
Next is the big “Stop” button on the bottom (3). It’s pretty self-explanatory; pressing this button will stop the motors. When I was testing the robot with the C# app, this was probably the most useful button, so I decided to keep it in this app as well. In the top part of the app, there’s a bar with several tabs (4). Since there are too many controls to fit on a single screen, this bar allows the user to switch between different screens. The screen contents are displayed in the center area (5). This means that the user is able to drive the robot and stop all motors from any screen!
The screens (in the order as they are placed in the top bar in the app) are: