In this lesson, we will show you how to connect 4 DOF robot arm to Raspberry Pi and Use web browser to control the 4 servo joint of the arm.
|1||Raspberry Pi board||1|
|2||MG995 or SG90 Servo Motor||4||M2.2*8 Self Tapping Screw x 2
M2*4 Self Tapping Screw x 1
|Click here to buy|
|PCA9685||Raspberry Pi Physical Pin#|
|PWM 15||Finger servo|
|PWM 14||Wrist servo|
|PWM 11||Arm servo|
|PWM 10||Base servo|
Step 1: Please run following command to download Linux script file:
then type the following command to install python program:
Step 2: type following command to enter the folder osoyooarm
Step 3: Find your Raspberry Pi IP address by typing following command:
You will see the IP board IP address like this:
In above example, 192.168.0.28 is the IP address of our Pi. You need to use this IP address to update the python code in Step 4.
Step 4: Type the following command to edit the file webcar.py
Change the default ip address 192.168.0.26 in line 15 to the raspberry pi IP address from Step 3, and cick “Ctrl”+”X” then “Y” to save the file and then click “enter” to exit
Step 5: Run the code by typing command
sudo python3 ~/osoyooarm/webarm.py
Step 6: In your PC or cell phone which is the same wifi network of your Raspberry Pi, open the browser and visit http://your_RaspberryPi_ip_address, you will see following UI
In the page, there are 4 Sliders which can control for servo joint, you can move the slider in order to rotate the servo and change arm and finger positions.
Marcelo Rovai : Python WebServer With Flask and Raspberry Pi
DownLoad Url osoyoo.com