Without further ado, let’s prepare the materials:
1. Materials
-
Raspberry Pi
-
Robotic Arm
-
Tracked Vehicle
-
Power Supply and several Dupont wires, one L298N
-
Tools (various)
As shown in the figure:
2. Wiring
-
First, choose GPIO for control. The Raspberry Pi has a total of 40 GPIOs, but not all of them are suitable for use. I chose GPIO pins 22, 23, 24, and 25 to control the forward and backward movement and steering of the tracked vehicle. GPIO pins 15, 16, 26, 27, 28, and 29 are used to control the rotation of the servos (I used the WiringPi library here). (PS: If any students do not understand servos, you can check out my blog post, which is simple and easy to understand: Raspberry Pi 3B+ Servo Motor Control Code (http://blog.csdn.net/wu_lian_nan/article/details/72510395).)
-
The wiring details are shown in the figure below:
03. The wires are connected, then connect the power supply, assemble the vehicle, and start VNC on the Raspberry Pi, and that’s about it.
3. Control Source Code
-
I have open-sourced the source code, and I hope those who like it can help me improve it. The code is not well written, please don’t mind. Below is the GitHub link: Raspberry Pi Excavator GitHub (https://github.com/yangkuiking/Raspberry-Pi-excavator)
-
Here is the video demonstration link: Raspberry Pi Excavator Video (http://v.youku.com/v_show/id_XMjkzMzQ2NDA2NA==.html?spm=a2h3j.8428770.3416059.1)
4. Where can you find me?
My QQ group address: 253222403
5. Even after reading the article, you might still not understand. I will record a video to teach everyone when I have time.
Welcome to follow our WeChat public account. My knowledge and ability are limited, so if there are any mistakes in the article, please feel free to give me feedback or leave a message. Thank you very much!