69. Pi-robot tank

In this project, we will combine the functions of Bluetooth control, and live webcam onto a 3-d printed chassis. Like in the previous project, we made a robot that can just be controlled by Bluetooth using the Bluedot app. This app not only connects to the raspberry pi like on the settings, but it also utilizes the GUI "dot", which can be interacted with by touch. The Raspberry PI will now have the official pi-camera wired to the PI-board, which will be utilized for live streaming.
The chassis will be more tank-looking since it allows the controlled robot to go over terrain, and it will carry more electronics needed to operate than the standard chassis.

<Tank>

Since this robot will have 2 main functions, we will split it up into 2-one for Bluetooth control, and the other for webcam functionality. For the Robot, we will need the Tamiya tracked set since the kit provides the wheel and tracks needed to turn the base as a tank chassis. We will also need a Raspberry Pi, the L298 motor driver, motors, a 5-volt battery supply, and a chassis.

<Chassis>

Once we acquired the chassis by buying or 3d printing it out, we can install the side of the motor by side together. To secure them together, something like Flex glue will bond the motor gearboxes to the chassis. Once you got the gearboxes secure, assemble the rest of the chassis from the kit as shown in the picture. The shaft has to be inserted through the holes and at each end of the shaft, attach the wheel, and cap. The geared wheels have to be inserted into the shaft of the gearbox so that it moves the tracks. After that, assemble the tracks together to make it longer, while closing it off so that it becomes a loop.
Once everything was assembled, install the tracks to the chassis, and rotate the gearbox to make sure it was spinning freely. Load Raspian to the sd card, and boot up the PI once it's installed.

<Pi>

To start off with the Bluetooth control, follow the same steps for installing Bluedot on the Raspberry Pi, and the Bluedot app on the Android phone. You will also need to pair the phone and the Pi together by Bluetooth, which can be done with simple steps:
1. Make your phone discoverable in the settings.
2. Enable Bluetooth and make it discoverable in Raspberry PI.
3. In the Raspberry Pi, scroll through the list to see if it can find the phone if so, pair it.
4. You will have a pin code generated during pairing, click ok on the phone first, and now to the pi.
Now you are finished getting the 2 devices to pair up, despite the error saying no services.
You will need to make use of the same Bluedot robot code from the previous project since it has the necessary functions to move the robot in 4 directions.

<Assembly>

At this point, you are ready to attach the camera to the Pi and do the live streaming, Once the Pi camera was installed, keep a note of the IP address you're using since this is where we will see the scene displayed by the camera.
In the Pi, make sure that the camera was enabled as well as the SSH and VNC. Once you know the IP and the camera was enabled, you will need to write a python code that utilizes the pi-camera but also creates a separate HTTP page in your web browser.
Once you wrote the python code, test to make sure that it executes without any kind of errors nested in the code itself.
It's only a matter of time to go to the web browser of your choice and then type in the IP address in the address bar in HTTP, for example: (http://127.0.0.0:8000).
Once both functions are working, it's time to wire the components up to the tank chassis, making sure that everything is powered up properly, and the connections are in the right place.

<Side view>

For the power, you will need to have 18650 batteries connected in parallel so that you can increase the capacitance. Attack the black and red wires to the right terminals of the battery, and then connect it to the TP4056 module. You will also need to connect the 2 boost convert to the battery, where one is 5 volts and the other is 9 volts.
 At this point, once the power supply was connected to the right modules, it's time to test out the video capabilities, and the Bluetooth control!


Comments

Popular Posts