Python modules to control a robot car that is connected to 2 DC motors and a variety of sensors. The car is controlled by a Raspberry Pi Zero 2w and can operate in two modes:
- Autonomous Mode - Follows a tape on the flor automatically (GIF)
- Manual Mode - Lets you manually control the cars movement
Pi_Car.pysets up a socket server on the local network and listens to inputs from a client. It contains the scripts to follow the tape, avoid obstacles and be controlled manually.remote_control.pyis the second important script, which runs on the laptop. It detects key inputs and sends input commands to the pi-car using a simple python client server connection.
- Raspberry Pi Zero 2W – Main controller
- DC Toy Motors (130 Size, 4.5–9V DC) – Drive wheels
- MCP3008 – 8-channel 10-bit ADC (SPI interface for analog sensors)
- SHARP GP2Y0A02YK0F – Infrared distance sensor
- MPL3115A2 – I2C barometric pressure / altitude / temperature sensor
- Adafruit 9-DOF IMU (LSM303) – Accelerometer and magnetometer
- TCS34725 RGB Color Sensor – For line following
- LSM303AGR – Additional accelerometer breakout
- Monochrome 128x64 OLED – Displays sensor readings and mode status
- Real-time sensor data integration (distance, color, IMU, pressure)
- Tape-following algorithm using RGB sensor
- Remote control via keyboard over TCP/IP
- Modular Python scripts for easy extension
- Includes simple test scripts for each sensor; feel free to use if you have the same sensor.
