Skip to main content

Control software for remote Fischertechnik Maker Car with SFZ PCB.

Project description

SFZ-PiTechCar (Python Package)

PiTechCar Logo

Python-based software for controlling a Fischertechnik Maker Kit car via a custom-built PCB and Raspberry Pi. Provides precise motor control (forward/backward) and steering via a servo. Supports the official 8.4V Fischertechnik NiMH battery.

Additional sensors can be connected using stemmaQT connectors and controlled with CircuitPython-based libraries.


Required Hardware

Fischertechnik Maker Kit Car

Fischertechnik Maker Kit Car

The base platform for the PiTech Car project, including chassis, wheels, motors, and steering mechanism.

Fischertechnik NiMH battery

Fischertechnik 8.4V NiMH Battery

Provides reliable power for the PiTech Car HAT+, motors, servo, and Raspberry Pi. Includes a standard charger.

Note: Higher-power Raspberry Pi models may draw too much current, causing undervoltage warnings or preventing the Raspberry Pi from starting. It is recommended to use a Raspberry Pi 3 or Raspberry Pi 3A+.

Raspberry Pi 3A+

Raspberry Pi 3A+

Serves as the main controller for the car, running the Python software and handling communication with the PiTech Car HAT+. Other Raspberry Pi models (e.g., 3B+, 4) are also compatible.

PiTech Car HAT+

Custom-Built PiTech Car HAT+, Falko Schmidt, SFZ, 2025

Handles motor control (forward/backward) and steering via servo, interfaces with the battery, and provides stemmaQT connectors for additional sensors. Designed specifically to integrate seamlessly with the Python control software and Raspberry Pi.

Pi Hut Controller

Pi Hut Controller (Remote Control)

Used to control the PiTech Car. Interfaces with the Raspberry Pi over USB, allowing the user to drive, steer, and send commands remotely. Only the joysticks are used; the buttons can be assigned for custom functionality.


Software Prerequisites

⚠️ This software only works on Raspberry Pi systems!

The Python control software requires several CircuitPython libraries to interface with sensors. On Raspberry Pi, these libraries rely on the Blinka compatibility layer from Adafruit. To install Blinka, run the following commands:

cd ~
pip3 install --upgrade adafruit-python-shell
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
sudo -E env PATH=$PATH python3 raspi-blinka.py

Create a virtual Python environment to isolate and manage all required software libraries:

python -m venv ftberry_python_venv
source ftberry_python_venv/bin/activate

Software Installation

Before installing the software, make sure the Python virtual environment is activated. Then install the software by running:

pip install sfz-pitechcar

All required dependencies listed below will be installed automatically.


Pre-Usage

Before running the software, you need to identify and profile the controller you are using. The Python library ApproxEng Input is used for this purpose. Follow the official profiling instructions here:

ApproxEng Input Profiling Guide

After profiling, move the generated YAML file into the correct directory as described in the documentation. Once this is done, your controller is ready for use with the PiTech Car software.


Usage

Open a terminal and create a Python file in your home directory:

cd ~
nano pitech_car.py

Paste the following code into pitech_car.py:

from pitechcar.car import PiTechCar

car = PiTechCar()
car.run()

Notes:

  • car.run() starts the main control loop.
  • Controller disconnects and cleanup are handled automatically for safety.

Auto-Start on boot

If you want PiTechCar to start automatically, first create a bash script that activates your virtual environment and starts the Python program:

cd ~
nano pitechcar_controller.sh

Add the following content (adjust the virtual environment path if needed) and make it executable:

#!/bin/bash
source ~/ftberry_python_venv/bin/activate
python3 ~/pitech_car.py
sudo chmod +x ~/pitechcar_controller.sh

Next, create a service file:

sudo nano /etc/systemd/system/pitechcar_controller.service

Add the following content (replace USERNAME with your actual username):

[Unit]
Description=PiTechCar Controller
After=usb-devices.target
Wants=usb-devices.target

[Service]
Type=simple
User=USERNAME
WorkingDirectory=/home/USERNAME
ExecStart=/bin/bash /home/USERNAME/pitechcar_controller.sh
Restart=on-failure
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

Enable the service to start on boot:

sudo systemctl enable pitechcar_controller.service

Start the service immediately (optional, without reboot):

sudo systemctl start pitechcar_controller.service

Your PiTechCar controller should now run automatically on boot.


Python Package Dependencies

ℹ️ All dependencies listed here are automatically installed with the package.


Project Structure

sfz-pitechcar/
├── assets/              # Images and diagrams for README
├── scripts/             # Example scripts
│   └── run_car.py       # Main script to start the PiTech Car
├── src/pitechcar/       # Python package
│   ├── hardware/        # Low-level hardware modules (motors, sensors, battery)
│   └── modules/         # Higher-level control modules (motor, battery, WiFi)
├── README.md
├── pyproject.toml

Contributing

Contributions are welcome! To contribute, please fork the repository, make your changes, and submit a merge request. For major changes or feature additions, consider opening an issue first to discuss your ideas.


License

This project is licensed under the BSD-3-Clause License. © 2026 Falko Schmidt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sfz_pitechcar-0.1.1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sfz_pitechcar-0.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file sfz_pitechcar-0.1.1.tar.gz.

File metadata

  • Download URL: sfz_pitechcar-0.1.1.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sfz_pitechcar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e373382bee3984312d40f30e1e9154f0bb8030d701dd62c9f9036030c3baf2d0
MD5 d91fece072ce75a67bbfb998f29689c4
BLAKE2b-256 28766ffb05b2383c9706a9a54907d93091d2e96f8e2b74eb01a77d072b84e300

See more details on using hashes here.

File details

Details for the file sfz_pitechcar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sfz_pitechcar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sfz_pitechcar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ced4dc5c4b4fd68633c707606b67cb4905a63bb8d608fb99f96b3cd1d20d6b53
MD5 86d3c4d9484d916d6046477271fdd2c7
BLAKE2b-256 f89c945f4d8dd287a5ef2dc74ef2a2a797269074469e45f709f6c95dbd31b5f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page