Previous article:
🐶 Raspberry Pi 4 Initial Setup
A simple guide to enabling I2C, installing libraries, and preparing your Raspberry Pi for the FreeNove Robot Dog.
This section prepares your Raspberry Pi for running the FreeNove Robot Dog by:
- installing the required Python libraries
- enabling the I2C hardware interface
- verifying that both system modules(software) and I2C devices(hardware) are working correctly
This setup is required before running any robot control code.
Overview of Steps
- Obtain the robot code and ensure Python 3 is used
- Enable required interface(I2C)
- Install Python dependencies
- Verify I2C communication at both system and device levels
📦1. Download the Robot Code
cd
git clone --depth 1 https://github.com/Freenove/Freenove_Robot_Dog_Kit_for_Raspberry_Pi
The project will be cloned into your home directory.
⚙️2. Enable Required Interface(I2C)
You can enable hardware interfaces from the Raspberry Pi desktop UI.
Open Configuration
- Click the Raspberry Pi icon (top-left)
- Go to:
Preferences → Control Centre
(Authentication required)
※ Do not unslide VNC or SSH.
If you do, then you need to recover ssh and redo the Enable VNC inside raspi-config from previous step. You can leave Serial Port and Serial Console alone.
Required settings:
✅SSH — allows remote terminal access
✅VNC — allows remote desktop connection
✅I2C — required for sensors (MPU6050, PCA9685)

Click Close, then authenticate again.
🔄 Reboot
In Terminal, type:
sudo reboot
Reboot is required for the settings to apply.
📚3. Install Python Libraries
Move to the project directory:
cd ~/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code
Run the setup script:
sudo python setup.py
👉 This installs:
- hardware control libraries
- sensor drivers
- GUI libraries (e.g., PyQt5)
🔍4. Verify I2C Module (System Level)
Check that the I2C kernel modules are loaded:
lsmod | grep i2c
Expected output:
i2c_dev 16384 0
i2c_bcm2835 16384 0
i2c_brcmstb 12288 0
💡 What each module means
-
i2c_dev — userspace interface (
/dev/i2c-*) - i2c_bcm2835 — main I2C controller driver for Raspberry Pi
- i2c_brcmstb — Broadcom STB I2C driver (newer kernels)
If these appear, I2C is enabled at the OS level.
✅ These are the correct modules for Raspberry Pi OS Bookworm and newer kernels. If you see output → I2C is working at the system level
🔍5. Verify I2C Devices (Hardware Level)
Install tools (if not already installed):
sudo apt-get install i2c-tools
sudo apt-get install python3-smbus
Scan the I2C bus:
(Just keep this in mind for now. You need to build robodog to check the i2c status.)
i2cdetect -y 1
Expected addresses:
0x40 (PCA9685) — controls all robot leg servos(servo controller)
0x48 (PCF8591) — reads analog sensor data(ADC chip)
If both appear, the robot control board is connected correctly.
💡 What do these numbers mean?
- I2C is a communication system used to connect hardware modules
- Each device has a unique address
- i2cdetect scans and lists connected devices
👉 In this robot:
0x40 → PCA9685 (servo controller)
→ controls the robot’s motors (legs)
0x48 → PCF8591 (ADC chip)
→ reads sensor and analog data
If both appear, the robot control board is connected properly.
✅ Summary
- Clone the FreeNove repository
- Ensure Python 3 is used
- Enable SSH, VNC, I2C, and Camera
- Install required Python libraries
- Verify I2C communication
- Check I2C module (
lsmod) - Check I2C devices (
i2cdetect)
- Check I2C module (
🎯 Key Takeaway
There are two levels of I2C verification:
-
System level (sofware):
lsmod→ confirms I2C is enabled -
Device level (hardware):
i2cdetect→ confirms hardware is detected
Both must be correct for the robot to operate.
👉 Next article: 🛠️Building the FreeNove Robot Dog
