SunFounder PiDog with Raspberry Pi Zero

SunFounder PiDog with Raspberry Pi Zero

Hello and welcome back. In this article, we are going to introduce a cool Robot dog from SunFounder. It’s very interesting and mainly based on Raspberry Pi technology. For that, I have used the Raspberry Pi Zero W board. But you can use Raspberry Pi 4,3B+ or 3B board. This dog is great for kids, adults, students, teachers, enthusiasts, and makers alike. It can do a lot of things just like a real dog: walk, sleep, run, turn left and right, scratch its ears, bob its head, wag its tail, and more. For that, five main components are included in this robot dog. That’s the ultrasonic sensor, sound sensor, touch switch, 6 DOF(Accelerometer and Gyroscope) module, and camera module. What’s more, it boasts advanced features such as face tracking and ball tracking capabilities, enhancing its interactivity and versatility. Also, 12 servo motors are included for moving the robot dog. Especially, my interesting feature is the RGB LED strip. It’s displaying the emotion als of this dog. Furthermore, this project offers an exciting opportunity to learn Python programming, as you delve into the world of robotics and explore the capabilities of this remarkable creation.

  • If you want more info about this Robot dog – Click on me
  • You can buy this PiDog kit using this link – Click on me

Specifications of PiDog

  • Compatible motherboards – Raspberry Pi 4/3B+/3B/Zero W
  • Action Set – Walking, Sleeping, Running, turning left, turning right, Scratching ears, bobbing head, wagging tail, push-up
  • Sensors – Ultrasonic module, touch switch module, 6 DOF sensor module
  • RGB LED strip – Emotional Expression
  • Battery type – 2 x 18650 Battery
  • Battery life —  1.5 Hours
  • Connection Mode – WIFI/AP
  • Body Material —  Aluminium Alloy
  • Expansion Board – SunFounder Robot Hat
  • Camera – 5MP camera
  • Voice commands – forward, backward, turn left, turn right, trot, stop, lie down, stand up. Sit, bark, bark harder, pant, wagtail, shake head, stretch, doze off, push-up, howling, twist body, handshake, high-five
  • Charging time – About 2-3 hours
  • Control mode – SunFounder Controller App
  • Programming language – Python
  • Number of servos – 12

OK, let’s assemble this Robot dog step by step. For that, follow the steps below. If you want, you can use the SunFounder instructions. For that use this link — Click on me

Step 1

Firstly, unbox and identify components one by one.

Step 2

Now, install the Sound direction sensor module on Plate A. Then, connect the 7-pin wire to it.

Step 3

Next, install the Raspberry Pi Zero board on it. Then, connect the FPC cable to the camera port and install the Robot HAT.

Step 4

Now, connect the Sound direction module cable to the robot HAT. Then, connect the one servo motor for the dog tail and install the battery using a velcro sticker.

Step 5

And then, charge this dog and turn on the power.

Step 6

Now, let’s install the Raspberry Pi OS and download the required modules. For that, follow the instructions below.

  • First, plug the SD card to the computer. Then, download the Raspberry Pi OS to your computer and run this setup.
  • Next, select your device, Operating system, and SD card.
  • Now, go to the settings and enter your hostname, username and password, SSID, and password. Then. select your country and enable SSH. Finally, click the ok button. Then, it will install it on your SD card.

Step 7

Next, insert this SD card to the Raspberry Pi board and power on it. Then install the required modules to the Raspberry Pi board. For that, follow the instructions below.

  • First, open Windows Powershell with the Administrator. Then log into the Raspberry Pi terminal using the following commands.
  • ping -4 raspberrypi.local
  • ssh [email protected] — Please use your local IP address.
  • Then, run the following commands one by one.
  • sudo apt update
  • sudo apt upgrade
  • sudo apt install git python3-pip python3-setuptools python3-smbus
  • cd ~/
  • git clone -b v2.0 https://github.com/sunfounder/robot-hat.git
  • cd robot-hat
  • sudo python3 setup.py install
  • cd ~/
  • git clone -b picamera2 https://github.com/sunfounder/vilib.git
  • cd vilib
  • sudo python3 install.py
  • cd ~/
  • git clone https://github.com/sunfounder/pidog.git
  • cd pidog
  • sudo python3 setup.py install
  • cd ~/pidog
  • sudo bash i2samp.sh
SunFounder PiDog with Raspberry Pi Zero
  • Next, enable the I2C and SPI. For that, run the command below.
  • sudo raspi-config
  • Finally, run the servo zeroing script to set the servo motors to 0 points.
  • cd ~/pidog/examples
  • sudo python3 servo_zeroing.py

OK, everything is fine.

Step 8

Now, connect the tail servo motor to the P11 terminal. Afterward, power off and connect the servo arm to Plate B. Also, connect the cable tie to the end of Plate B.

Step 9

Next, prepare plates C and D for the left and right legs. Use the following images for that.

Step 10

Then, connect the servo arms to these plates and install the servo motors.

Step 11

Next, install the Acrylic D plates on the legs.

Step 12

Now, run the servo zeroing script again and connect the servo motors one by one to the P11 terminal. Finally, power off this robot.

Step 13

Next, assemble the dog legs using the images below.

Step 14

After, connect the servo arms to E plates and install dog legs on these plates.

Step 15

Now, connect these parts to the main body and install the Plate F back side of this dog. Then, connect the servo motors to the robot HAT. For that, use the images below.

Step 16

Next, install the RGB board on Plate G and connect it to the robot Hat using the 4-pin cable. Then, connect the 6-DOF IMU module to the RGB board using a cable. Finally, install the Plate G and IMU module on the robot dog.

Step 17

Afterward, install Plate H to the bottom of this robot and assemble the robot stand using Acrylic plates.

Step 18

Now, run the servo zeroing script again and set the other servo motors to 0 points using the P5 terminal. Then, attach the servo arm to plate I and connect the other servo motors to it. For that, use the picture below.

Step 19

Next, connect the Plate J to it. Then, assemble Plate K and connect it to the servo motor. Afterward, assemble Plate L and install it other side of the above part.

Step 20

Now, install the servo motor on the Plate M. Then, install that plate on Plate N. After, connect the all parts together.

Step 21

Next, connect the servo motors to Robot HAT. Then, connect this part to the main body.

Step 22

Afterward, connect Plate O to the dog head. Then, install the camera module on the Plate P and install the Plate Q on the Plate P.

Step 23

Now, connect the Ultrasonic sensor with the Acrylic E plate. Then, install the touch switch module on the robot head and connect 4-pin wires to these components.

Step 24

Then, connect the ultrasonic sensor and touch switch module to the robot HAT. Finally, install Plate O on the robot dog head. Now, you can manage wires using cable wrap.

Now your robot dog is ready for you.

Step 25

Next, place your dog on the stand and run the calibration script.

  • cd ~/pidog/examples
  • sudo python3 0_calibration.py

Step 26

Now, you can run the following scripts one by one.

  • Function Demonstration –> sudo python3 2_function_demonstration.py
  • Wake Up –> sudo python3 1_wake_up.py
  • Patrol –> sudo python3 3_patrol.py
  • Response –> sudo python3 4_response.py
  • Rest –> sudo python3 5_rest.py
  • Push Up –> sudo python3 9_howling.py
  • Balance –> sudo python3 10_balance.py
  • Ball Track –> sudo python3 13_ball_track.py / http://your IP:9000/mjpg

Step 27

If you want to control this robot dog with the SunFounder app, please follow the instructions below.

  • First, run the following scripts one by one.
  • cd ~
  • git clone https://github.com/sunfounder/sunfounder-controller.git
  • cd ~/sunfounder-controller
  • sudo python3 setup.py install
  • cd ~/pidog/examples
  • sudo python3 12_app_control.py
  • Next, install the SunFounder controller app from the Play Store or App Store.
  • Then, open this app and add the PiDog remote controller.
  • Now, connect the WIFI connection with your IP address.
  • Mydog(Your IP)
  • Finally, click the run button and enjoy your robot Dog.

OK, enjoy this Robot Dog. The full video guide is below. So, we hope to see you in the next project. Have a good day.

SunFounder PiDog with Raspberry Pi Zero

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *