0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

๐Ÿงช Testing Modules on the FreeNove Robot Dog

0
Posted at

๐Ÿ‘‰ Previous article: ๐Ÿ› ๏ธ Building the FreeNove Robot Dog
https://qiita.com/tri-edge/items/61102e5ae0df0b685eff

๐ŸŽฏ Goal

After assembling the robot dog, this step verifies that all hardware modules are working correctly.
Completing these tests helps prevent issues when running full control programs later.

๐Ÿงฐ Preparation

  • Insert the battery
  • Turn ON switches S1 and S2
  • Place the robot on a flat surface (use calibration supports or small supports or blocks to slightly lift the body off the ground)
  • Connect to Raspberry Pi using VNC Viewer (GUI required)

๐Ÿ” Check I2C Devices

โ–ถ Run

i2cdetect -y 1

Expected addresses:
0x40 โ†’ Servo driver (PCA9685)
0x48 โ†’ ADC
0x68 โ†’ MPU6050 sensor [docs.freenove.com
image.png
๐Ÿ‘‰ If any address is missing, check wiring connections.

๐Ÿค– Servo Test

โ–ถ Run

cd ~/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server
sudo python test.py Servo

image.png

โœ… Result

The robot moves through several poses (A โ†’ B โ†’ C โ†’ D)
image.png
Smooth movement means the servos are working correctly

โš ๏ธ Troubleshooting

Incorrect movement โ†’ check servo wiring and channel connections

Code

from Servo import *
servo=Servo()
def test_Servo():
    try:
        for i in range(90):
            servo.setServoAngle(4,90-i)
            servo.setServoAngle(7,90-i)
            servo.setServoAngle(8,90+i)
            servo.setServoAngle(11,90+i)
            time.sleep(0.01)
        for i in range(90):
            servo.setServoAngle(2,90-i)
            servo.setServoAngle(5,90-i)
            servo.setServoAngle(10,90+i)
            servo.setServoAngle(13,90+i)
            time.sleep(0.01)
        for i in range(60):
            servo.setServoAngle(3,90-i)
            servo.setServoAngle(6,90-i)
            servo.setServoAngle(9,90+i)
            servo.setServoAngle(12,90+i)
            time.sleep(0.01)
        print ("\nEnd of program")      
    except KeyboardInterrupt:
        print ("\nEnd of program")

๐Ÿ”Œ ADC (Battery Voltage) Test

โ–ถ Run

$ sudo python test.py ADC

image.png

โœ… Result

Battery voltage is printed every second

Code

from ADS7830 import *
adc=ADS7830()
def test_Adc():
    try:
        while True:
            Power=adc.readAdc(0)/255.0*5.0*2
            print ("The battery voltage is "+str(Power)+"V")
            time.sleep(1)
            print ('\n')
    except KeyboardInterrupt:
        print ("\nEnd of program")

๐Ÿ“ Ultrasonic Sensor Test

โ–ถ Run

sudo python test.py Ultrasonic

image.png

โœ… Result

Distance (cm) is displayed continuously

Code

from Ultrasonic import *
ultrasonic=Ultrasonic()                
def test_Ultrasonic():
    try:
        while True:
            data=ultrasonic.get_distance()   #Get the value
            print ("Obstacle distance is "+str(data)+"CM")
            time.sleep(1)
    except KeyboardInterrupt:
        print ("\nEnd of program")

๐ŸŒˆ LED Test

The RGB LED module is positioned at the top.
image.png

โ–ถ Run

sudo python test.py Led

image.png

Input PCB version (V1.0). It looks like the below.

Connection board (PCB_V1.0)
image.png

image.png

โœ… Result

LED cycles: Red โ†’ Green โ†’ Blue โ†’ White โ†’ Off

Code

def test_Led():
    try:
        #Red wipe
        print ("\nRed wipe")
        led.colorWipe([255, 0, 0]) 
        time.sleep(1)

        #Green wipe
        print ("\nGreen wipe")
        led.colorWipe([0, 255, 0]) 
        time.sleep(1)

        #Blue wipe
        print ("\nBlue wipe")
        led.colorWipe([0, 0, 255]) 
        time.sleep(1)

        #White wipe
        print ("\nWhite wipe")
        led.colorWipe([255, 255, 255]) 
        time.sleep(1)

        led.colorWipe([0, 0, 0])   #turn off the light
        print ("\nEnd of program")
    except KeyboardInterrupt:
        led.colorWipe([0, 0, 0])   #turn off the light
        print ("\nEnd of program")

๐Ÿ”Š Buzzer Test

โ–ถ Run

sudo python test.py Buzzer

image.png

โœ… Result

Buzzer sounds for about 3 seconds

Code

from Buzzer import *
buzzer=Buzzer()
def test_Buzzer():
    try:
        buzzer.run('1')
        time.sleep(1)
        print ("1S")
        time.sleep(1)
        print ("2S")
        time.sleep(1)
        print ("3S")
        buzzer.run('0')
        print ("\nEnd of program")
    except KeyboardInterrupt:
        buzzer.run('0')
        print ("\nEnd of program")

buzzer.run(cmd)
This function has one input parameter. If the input is โ€˜1โ€™, the buzzer will be turned on. If the input is โ€˜0โ€™, the buzzer will be turned off.

๐Ÿ“ท Camera Test

โš™ Setup

Edit config:

sudo nano /boot/firmware/config.txt

Enable:

camera_auto_detect=1

Or manually configure if needed.

โ–ถ Run

cd ~/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server
python camera.py

image.png

โœ… Result

An image file (image.jpg) is generated under
/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server
image.png

Checklist

โœ… I2C devices detected
โœ… Servos move correctly
โœ… ADC shows voltage
โœ… Ultrasonic returns distance
โœ… LED cycles colors
โœ… Buzzer works
โœ… Camera captures image

๐Ÿ’ก Tips

  • Keep hands away from moving parts
  • Most issues are caused by wiring mistakes
  • Press Ctrl + C to stop any test

โœ… Once everything passes, you're ready to move on to full robot control and programming!

๐Ÿ‘‰ Next:
๐ŸŽฎ Letโ€™s Control Your FreeNove Robot Dog!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?