Skip to content
No description, website, or topics provided.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Keypad Control.png
README.md
Remote Control.png
ir_hasher.py
robot.jpg
robot_bt.py
robot_controller.py
robot_led.py

README.md

Raspberry-Pi-Robot

Robot

External Resources

External resources were used in this project:

Components

The robot has four main components to programming.

robot_bt.py is the main file that runs and handles Bluetooth and infrared signals

  • It uses threads to run the Bluetooth, infrared, and LED clock controls simultaneously

robot_controller.py handles all servo motor speed and direction control

  • It does this by setting the pulse width of signal to the servo motor to a certain width
    • Widths 500-1500 move backwards
    • Widths 1500-2500 move forwards
    • Width 0 stops

robot_led.py controls the RGB LED strip and holds the various patterns

  • It maintains a queue of commands to set LEDs in an orderly fashion
  • It holds the robot state to determine which pattern to run when commands are issued

ir_hasher.py decodes data from the infrared receiver

  • The Raspberry Pi has already been calibrated to the IR remote (Car MP3) to receive certain hashes when buttons are pressed
  • You can change the hashes to your remote by changing the hashes constant in this file

Getting Started

  1. SSH into the Raspberry Pi and begin the program
  • Enable the pigpio daemon
sudo pigpiod
  • Begin the program
sudo python robot_bt.py

Note: You can automate step one by adding these commands to /etc/rc.local. Then, when the Raspberry Pi is turned on, the commands will automatically run, so there is no need to SSH into the Raspberry Pi.

  1. Connect to Bluetooth to control the robot
  • Use a phone to connect to the Raspberry Pi with a Bluetooth terminal
  1. Control the robot with either Bluetooth or infrared!
  • Bluetooth: use the keypad to control the robot
  • Infrared: press buttons to control the robot
  1. When done, enter “q” in the Bluetooth terminal to quit the program

Robot Control

Bluetooth/Keypad Control:

BT/Keypad

Infrared Remote Control:

Infrared

You can’t perform that action at this time.